aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

docs for propertyOverrides are not up-to-date in 0.22.0 ("findChild" moved to "node.findChild")

Open cybergoof opened this issue 7 years ago • 2 comments

I'm attempting to set the blockPublicAcl, ignorePublicAcl, etc in my s3 bucket in 0.22.0. However, fileChild is no longer available. I'm unsure how to get the base resource CfnBucket from an s3 object.

        this.bucket = new s3.Bucket(this, name, {
            versioned: true,
            encryption: s3.BucketEncryption.S3Managed,
            publicReadAccess: false,
        });
        const bucketResource = this.bucket.findChild('Resource') as CfnBucket;
        bucketResource.propertyOverrides.publicAccessBlockConfiguration = {
            blockPublicAcls: true,
            ignorePublicAcls :true,
            blockPublicPolicy:true,
            restrictPublicBuckets:true
        }

cybergoof avatar Jan 12 '19 02:01 cybergoof

construct.findChild was moved to construct.node.findChild. We should update our docs to reflect this of course. Thanks for reporting.

eladb avatar Jan 12 '19 07:01 eladb

I rooted out three refs in the "Accessing the AWS CloudFormation Layer" topic. I'll rebuild the docs later today.

Doug-AWS avatar Jan 15 '19 19:01 Doug-AWS