Skip to content

Commit 1aa4e9c

Browse files
authored
Issue302-Encrypt Scrap Buckets (#314)
1 parent 7f4308b commit 1aa4e9c

File tree

11 files changed

+113
-1
lines changed

11 files changed

+113
-1
lines changed

source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/test/integ.existing-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
"existingScriptLocation845F3C51": {
44
"Type": "AWS::S3::Bucket",
55
"Properties": {
6+
"BucketEncryption": {
7+
"ServerSideEncryptionConfiguration": [
8+
{
9+
"ServerSideEncryptionByDefault": {
10+
"SSEAlgorithm": "AES256"
11+
}
12+
}
13+
]
14+
},
615
"VersioningConfiguration": {
716
"Status": "Enabled"
817
}

source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/test/integ.pre-existing-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
"existingScriptLocation845F3C51": {
55
"Type": "AWS::S3::Bucket",
66
"Properties": {
7+
"BucketEncryption": {
8+
"ServerSideEncryptionConfiguration": [
9+
{
10+
"ServerSideEncryptionByDefault": {
11+
"SSEAlgorithm": "AES256"
12+
}
13+
}
14+
]
15+
},
716
"VersioningConfiguration": {
817
"Status": "Enabled"
918
}

source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/test/integ.pre-existing-logging-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"Type": "AWS::S3::Bucket",
66
"Properties": {
77
"AccessControl": "LogDeliveryWrite",
8+
"BucketEncryption": {
9+
"ServerSideEncryptionConfiguration": [
10+
{
11+
"ServerSideEncryptionByDefault": {
12+
"SSEAlgorithm": "AES256"
13+
}
14+
}
15+
]
16+
},
817
"VersioningConfiguration": {
918
"Status": "Enabled"
1019
}

source/patterns/@aws-solutions-constructs/aws-kinesisstreams-kinesisfirehose-s3/test/integ.existing-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
"existingScriptLocation845F3C51": {
55
"Type": "AWS::S3::Bucket",
66
"Properties": {
7+
"BucketEncryption": {
8+
"ServerSideEncryptionConfiguration": [
9+
{
10+
"ServerSideEncryptionByDefault": {
11+
"SSEAlgorithm": "AES256"
12+
}
13+
}
14+
]
15+
},
716
"VersioningConfiguration": {
817
"Status": "Enabled"
918
}

source/patterns/@aws-solutions-constructs/aws-kinesisstreams-kinesisfirehose-s3/test/integ.existing-logging-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"Type": "AWS::S3::Bucket",
66
"Properties": {
77
"AccessControl": "LogDeliveryWrite",
8+
"BucketEncryption": {
9+
"ServerSideEncryptionConfiguration": [
10+
{
11+
"ServerSideEncryptionByDefault": {
12+
"SSEAlgorithm": "AES256"
13+
}
14+
}
15+
]
16+
},
817
"VersioningConfiguration": {
918
"Status": "Enabled"
1019
}

source/patterns/@aws-solutions-constructs/aws-lambda-s3/test/integ.pre-existing-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
"existingScriptLocation845F3C51": {
55
"Type": "AWS::S3::Bucket",
66
"Properties": {
7+
"BucketEncryption": {
8+
"ServerSideEncryptionConfiguration": [
9+
{
10+
"ServerSideEncryptionByDefault": {
11+
"SSEAlgorithm": "AES256"
12+
}
13+
}
14+
]
15+
},
716
"VersioningConfiguration": {
817
"Status": "Enabled"
918
}

source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.existing-s3-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@
3636
"existingScriptLocation845F3C51": {
3737
"Type": "AWS::S3::Bucket",
3838
"Properties": {
39+
"BucketEncryption": {
40+
"ServerSideEncryptionConfiguration": [
41+
{
42+
"ServerSideEncryptionByDefault": {
43+
"SSEAlgorithm": "AES256"
44+
}
45+
}
46+
]
47+
},
3948
"VersioningConfiguration": {
4049
"Status": "Enabled"
4150
}

source/patterns/@aws-solutions-constructs/aws-s3-step-function/test/integ.pre-existing-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
"existingScriptLocation845F3C51": {
44
"Type": "AWS::S3::Bucket",
55
"Properties": {
6+
"BucketEncryption": {
7+
"ServerSideEncryptionConfiguration": [
8+
{
9+
"ServerSideEncryptionByDefault": {
10+
"SSEAlgorithm": "AES256"
11+
}
12+
}
13+
]
14+
},
615
"VersioningConfiguration": {
716
"Status": "Enabled"
817
}

source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
"existingScriptLocation845F3C51": {
44
"Type": "AWS::S3::Bucket",
55
"Properties": {
6+
"BucketEncryption": {
7+
"ServerSideEncryptionConfiguration": [
8+
{
9+
"ServerSideEncryptionByDefault": {
10+
"SSEAlgorithm": "AES256"
11+
}
12+
}
13+
]
14+
},
615
"VersioningConfiguration": {
716
"Status": "Enabled"
817
}

source/patterns/@aws-solutions-constructs/core/test/test-helper.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
// Imports
15-
import { Bucket, BucketProps } from "@aws-cdk/aws-s3";
15+
import { Bucket, BucketProps, BucketEncryption } from "@aws-cdk/aws-s3";
1616
import { Construct, RemovalPolicy } from "@aws-cdk/core";
1717
import { overrideProps, addCfnSuppressRules } from "../lib/utils";
1818
import * as path from 'path';
@@ -22,6 +22,7 @@ export function CreateScrapBucket(scope: Construct, props?: BucketProps | any) {
2222
const defaultProps = {
2323
versioned: true,
2424
removalPolicy: RemovalPolicy.DESTROY,
25+
encryption: BucketEncryption.S3_MANAGED,
2526
};
2627

2728
let synthesizedProps: BucketProps;

update-tests.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export constructs="
2+
aws-eventbridge-stepfunctions
3+
aws-events-rule-step-function
4+
aws-kinesisfirehose-s3
5+
aws-kinesisfirehose-s3-and-kinesisanalytics
6+
aws-kinesisstreams-gluejob
7+
aws-kinesisstreams-kinesisfirehose-s3
8+
aws-kinesisstreams-lambda
9+
aws-lambda-dynamodb
10+
aws-lambda-elasticsearch-kibana
11+
aws-lambda-stepfunctions
12+
aws-lambda-step-function
13+
aws-s3-stepfunctions
14+
aws-s3-step-function
15+
aws-sqs-lambda
16+
"
17+
18+
deployment_dir=$(cd $(dirname $0) && pwd)
19+
source_dir="$deployment_dir/source"
20+
21+
./deployment/align-version.sh
22+
cd source
23+
export PATH=$(npm bin):$PATH
24+
25+
for construct in $constructs; do
26+
cd $deployment_dir/source/patterns/@aws-solutions-constructs/$construct
27+
npm run jsii && npm run build
28+
cdk-integ
29+
npm run snapshot-update
30+
done

0 commit comments

Comments
 (0)