Skip to content

Commit 1fa399e

Browse files
authored
fix(s3): InventoryConfiguration[].Id exceeds maximum size allowed by the PutBucketInventoryConfiguration API (#27794)
Truncate the inventory-id to 64 characters, such that it conforms to the S3 PutBucketInventoryConfiguration API. Also remove non-allowed characters. Closes #27793. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent b63c78f commit 1fa399e

11 files changed

+641
-1
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket.inventory.js.snapshot/aws-cdk-bucket-inventory.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"Resources": {
3+
"InventoryBucketA869B8CB": {
4+
"Type": "AWS::S3::Bucket",
5+
"UpdateReplacePolicy": "Retain",
6+
"DeletionPolicy": "Retain"
7+
},
8+
"InventoryBucketPolicyEDF94353": {
9+
"Type": "AWS::S3::BucketPolicy",
10+
"Properties": {
11+
"Bucket": {
12+
"Ref": "InventoryBucketA869B8CB"
13+
},
14+
"PolicyDocument": {
15+
"Statement": [
16+
{
17+
"Action": "s3:PutObject",
18+
"Condition": {
19+
"ArnLike": {
20+
"aws:SourceArn": {
21+
"Fn::GetAtt": [
22+
"AVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongNodeIdName525AF55D",
23+
"Arn"
24+
]
25+
}
26+
}
27+
},
28+
"Effect": "Allow",
29+
"Principal": {
30+
"Service": "s3.amazonaws.com"
31+
},
32+
"Resource": [
33+
{
34+
"Fn::GetAtt": [
35+
"InventoryBucketA869B8CB",
36+
"Arn"
37+
]
38+
},
39+
{
40+
"Fn::Join": [
41+
"",
42+
[
43+
{
44+
"Fn::GetAtt": [
45+
"InventoryBucketA869B8CB",
46+
"Arn"
47+
]
48+
},
49+
"/*"
50+
]
51+
]
52+
}
53+
]
54+
}
55+
],
56+
"Version": "2012-10-17"
57+
}
58+
}
59+
},
60+
"AVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongNodeIdName525AF55D": {
61+
"Type": "AWS::S3::Bucket",
62+
"Properties": {
63+
"InventoryConfigurations": [
64+
{
65+
"Destination": {
66+
"BucketArn": {
67+
"Fn::GetAtt": [
68+
"InventoryBucketA869B8CB",
69+
"Arn"
70+
]
71+
},
72+
"Format": "CSV"
73+
},
74+
"Enabled": true,
75+
"Id": "VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongNodeIdNameInventory0",
76+
"IncludedObjectVersions": "All",
77+
"ScheduleFrequency": "Weekly"
78+
}
79+
]
80+
},
81+
"UpdateReplacePolicy": "Retain",
82+
"DeletionPolicy": "Retain"
83+
}
84+
},
85+
"Parameters": {
86+
"BootstrapVersion": {
87+
"Type": "AWS::SSM::Parameter::Value<String>",
88+
"Default": "/cdk-bootstrap/hnb659fds/version",
89+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
90+
}
91+
},
92+
"Rules": {
93+
"CheckBootstrapVersion": {
94+
"Assertions": [
95+
{
96+
"Assert": {
97+
"Fn::Not": [
98+
{
99+
"Fn::Contains": [
100+
[
101+
"1",
102+
"2",
103+
"3",
104+
"4",
105+
"5"
106+
],
107+
{
108+
"Ref": "BootstrapVersion"
109+
}
110+
]
111+
}
112+
]
113+
},
114+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
115+
}
116+
]
117+
}
118+
}
119+
}

packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket.inventory.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket.inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket.inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket.inventory.js.snapshot/integ.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket.inventory.js.snapshot/manifest.json

Lines changed: 125 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)