-
Notifications
You must be signed in to change notification settings - Fork 4k
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(secretsmanager): rotation function name can exceed 64 chars #7896
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0757125
fix(secretsmanager): rotation function name exceeds 64 chars
jogold 189b203
Merge branch 'master' into rotation-fn-name-length
jogold 79bdb65
real-synth
137a32a
extract "real synth" to a separate file
8bdf8c5
Merge remote-tracking branch 'origin/master' into benisrae/stage-cons…
rix0rrr 43630e0
Making the synthesis file a little nicer
rix0rrr 853b46a
Merge branch 'master' into benisrae/stage-construct-2
b811afd
Update allowed-breaking-changes.txt
431490c
touch ups
420e6c9
update stack `env` description
8a8951a
assembly name validation & more tests
94cc827
rename "embedded" to "nested" and move outdir resolution to app
711d861
hoist runtimeInfo collection to assembly
2bb8e62
update cx schema
7715885
remove "experimental" annotation from Assembly
603c608
chore(cli): fix "iam diff" integration test (#8421)
9e7b54a
Merge branch 'master' into rotation-fn-name-length
jogold 2b0ea5c
Merge branch 'master' into rotation-fn-name-length
jogold 028281d
Merge branch 'master' into rotation-fn-name-length
jogold 84460d2
fix conflict
jogold 0a97ab0
last conflict
jogold c4b9d8d
Merge branch 'master' into rotation-fn-name-length
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -291,4 +291,68 @@ export = { | |||||
|
||||||
test.done(); | ||||||
}, | ||||||
|
||||||
'rotation function name does not exceed 64 chars'(test: Test) { | ||||||
// GIVEN | ||||||
const stack = new cdk.Stack(); | ||||||
const vpc = new ec2.Vpc(stack, 'VPC'); | ||||||
const secret = new secretsmanager.Secret(stack, 'Secret'); | ||||||
const target = new ec2.Connections({ | ||||||
defaultPort: ec2.Port.tcp(3306), | ||||||
securityGroups: [new ec2.SecurityGroup(stack, 'SecurityGroup', { vpc })], | ||||||
}); | ||||||
|
||||||
// WHEN | ||||||
const id = 'SecretRotation'.repeat(5); | ||||||
new secretsmanager.SecretRotation(stack, id, { | ||||||
application: secretsmanager.SecretRotationApplication.MYSQL_ROTATION_SINGLE_USER, | ||||||
secret, | ||||||
target, | ||||||
vpc, | ||||||
}); | ||||||
|
||||||
// THEN | ||||||
expect(stack).to(haveResource('AWS::Serverless::Application', { | ||||||
Parameters: { | ||||||
endpoint: { | ||||||
'Fn::Join': [ | ||||||
'', | ||||||
[ | ||||||
'https://secretsmanager.', | ||||||
{ | ||||||
Ref: 'AWS::Region', | ||||||
}, | ||||||
'.', | ||||||
{ | ||||||
Ref: 'AWS::URLSuffix', | ||||||
}, | ||||||
], | ||||||
], | ||||||
}, | ||||||
functionName: 'RotationSecretRotationSecretRotationSecretRotationSecretRotation', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I know the symmetry is pleasing, but it also makes it unnecessarily difficult to figure out how the name is generated. |
||||||
vpcSecurityGroupIds: { | ||||||
'Fn::GetAtt': [ | ||||||
'SecretRotationSecretRotationSecretRotationSecretRotationSecretRotationSecurityGroupBFCB171A', | ||||||
'GroupId', | ||||||
], | ||||||
}, | ||||||
vpcSubnetIds: { | ||||||
'Fn::Join': [ | ||||||
'', | ||||||
[ | ||||||
{ | ||||||
Ref: 'VPCPrivateSubnet1Subnet8BCA10E0', | ||||||
}, | ||||||
',', | ||||||
{ | ||||||
Ref: 'VPCPrivateSubnet2SubnetCFCDAA7A', | ||||||
}, | ||||||
], | ||||||
], | ||||||
}, | ||||||
}, | ||||||
})); | ||||||
|
||||||
test.done(); | ||||||
}, | ||||||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if something in
@aws-cdk/core
wouldn't be useful for such cases:There are several places in the code where an id derived from unique id is truncated.
Or is this in
constructs
now?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more general solution would be nice... and this is blocking me today. :(