Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(s3): clarifying blockPublicAccess behavior with v2 #33668

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ class TestStack extends Stack {

const bucket = new s3.Bucket(this, 'Bucket', {
publicReadAccess: true,
blockPublicAccess: {
blockPublicAccessV2: {
blockPublicPolicy: false,
blockPublicAcls: false,
ignorePublicAcls: false,
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ const stack = new cdk.Stack(app, 'aws-ecs-integ');

// S3 bucket to host envfile without public access
const bucket = new s3.Bucket(stack, 'Bucket', {
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
blockPublicAccessV2: s3.BlockPublicAccessV2.BLOCK_ALL,
removalPolicy: cdk.RemovalPolicy.DESTROY,
autoDeleteObjects: true,
});
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ const stack = new cdk.Stack(app, 'aws-ecs-task-definition-container-credentialsp

const bucket = new s3.Bucket(stack, 'bucket', {
encryption: s3.BucketEncryption.S3_MANAGED,
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
blockPublicAccessV2: s3.BlockPublicAccessV2.BLOCK_ALL,
removalPolicy: cdk.RemovalPolicy.DESTROY,
enforceSSL: true,
});
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ class ExtendedLB extends elbv2.ApplicationLoadBalancer {
super(scope, id, props);

const accessLogsBucket = new s3.Bucket(this, 'ALBAccessLogsBucket', {
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
blockPublicAccessV2: s3.BlockPublicAccessV2.BLOCK_ALL,
encryption: s3.BucketEncryption.S3_MANAGED,
versioned: true,
serverAccessLogsPrefix: 'selflog/',
@@ -21,7 +21,7 @@ class ExtendedLB extends elbv2.ApplicationLoadBalancer {
this.logAccessLogs(accessLogsBucket);

const connectionLogsBucket = new s3.Bucket(this, 'ALBConnectionLogsBucket', {
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
blockPublicAccessV2: s3.BlockPublicAccessV2.BLOCK_ALL,
encryption: s3.BucketEncryption.S3_MANAGED,
versioned: true,
serverAccessLogsPrefix: 'selflog/',

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"Resources": {
"deprecatedBlockAcl87AAB8DE": {
"Type": "AWS::S3::Bucket",
"Properties": {
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"IgnorePublicAcls": true
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"deprecatedBlock27E0F9B2": {
"Type": "AWS::S3::Bucket",
"Properties": {
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": false
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"newBlockAclA8214FCC": {
"Type": "AWS::S3::Bucket",
"Properties": {
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"BlockPublicPolicy": false,
"IgnorePublicAcls": true,
"RestrictPublicBuckets": false
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"newBlockEE5E5E1C": {
"Type": "AWS::S3::Bucket",
"Properties": {
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": false,
"BlockPublicPolicy": true,
"IgnorePublicAcls": true,
"RestrictPublicBuckets": true
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Oops, something went wrong.
Loading
Oops, something went wrong.