Skip to content

Commit

Permalink
fix(cli): bootstrapping qualifier length not validated (#10121)
Browse files Browse the repository at this point in the history
The qualifier has a quite restricted length. Validate the length (and
character set) of the qualifier that the user supplies.

Fixes #9255.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr committed Sep 2, 2020
1 parent 5c9e6f6 commit e069263
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Parameters:
Description: An identifier to distinguish multiple bootstrap stacks in the same environment
Default: hnb659fds
Type: String
# "cdk-(qualifier)-image-publishing-role-(account)-(region)" needs to be <= 64 chars
# account = 12, region <= 14, 10 chars for qualifier and 28 for rest of role name
AllowedPattern: "[A-Za-z0-9_-]{1,10}"
ConstraintDescription: Qualifier must be an alphanumeric identifier of at most 10 characters
PublicAccessBlockConfiguration:
Description: Whether or not to enable S3 Staging Bucket Public Access Block Configuration
Default: 'true'
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { integTest } from './test-helpers';

jest.setTimeout(600_000);

const QUALIFIER = randomString();
const QUALIFIER = randomString().substr(0, 10);

beforeAll(async () => {
await prepareAppFixture();
Expand Down

0 comments on commit e069263

Please sign in to comment.