Skip to content

Commit fe0ecb4

Browse files
authored
chore(custom-resources): update and fix integ test (#19499)
Fixes #19450. The issue is the public read permissions. Even though the s3 bucket is configured to allow these permissions, public access can be blocked at the [account](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html) level. This makes the custom resource unable to put a public object into the bucket despite correct permissions, causing deployment failure. Since this is a bad experience and the object is unnecessarily public, I have removed that setting. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 28d87bb commit fe0ecb4

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.expected.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"Ref": "MyBucketF68F3FF0"
1919
},
2020
"Contents": "Hello, world, 1980!",
21-
"ObjectKey": "second.txt",
22-
"PublicRead": true
21+
"ObjectKey": "second.txt"
2322
},
2423
"UpdateReplacePolicy": "Delete",
2524
"DeletionPolicy": "Delete"
@@ -131,7 +130,7 @@
131130
]
132131
},
133132
"Handler": "index.onEvent",
134-
"Runtime": "nodejs10.x"
133+
"Runtime": "nodejs12.x"
135134
},
136135
"DependsOn": [
137136
"comamazonawscdkcustomresourcess3fileproviders3fileoneventServiceRoleDefaultPolicy10D24725",

packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class TestStack extends Stack {
1616
bucket,
1717
objectKey: 'second.txt',
1818
contents: 'Hello, world, 1980!',
19-
public: true,
2019
});
2120

2221
const file2 = new S3File(this, 'file2', {

packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class S3FileProvider extends CoreConstruct {
8282
this.provider = new cr.Provider(this, 's3file-provider', {
8383
onEventHandler: new lambda.Function(this, 's3file-on-event', {
8484
code: lambda.Code.fromAsset(path.join(__dirname, 's3-file-handler')),
85-
runtime: lambda.Runtime.NODEJS_10_X,
85+
runtime: lambda.Runtime.NODEJS_12_X,
8686
handler: 'index.onEvent',
8787
initialPolicy: [
8888
new iam.PolicyStatement({

0 commit comments

Comments
 (0)