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

core: Typo and bad command guidance for rebootstrap #31963

Open
1 task
perpil opened this issue Oct 31, 2024 · 1 comment
Open
1 task

core: Typo and bad command guidance for rebootstrap #31963

perpil opened this issue Oct 31, 2024 · 1 comment
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@perpil
Copy link
Contributor

perpil commented Oct 31, 2024

Describe the bug

With CDK 3.364, there is a slight typo runing should be running and an incorrect bootstrap command suggested. Instead of a comma between the different account/region pairs in the bootstrap command, it should be a space. i.e.
cdk bootstrap aws://<redactedAccount>/us-east-1,aws://<redactedAccount>/us-west-2 should be cdk bootstrap aws://<redactedAccount>/us-east-1 aws://<redactedAccount>/us-west-2

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

Correct spelling and suggested command to rebootstrap can be copy and pasted.

Current Behavior

31885	(cli): Bootstrap stack outdated

	Overview: The bootstrap stack in aws://<redactedAccount>/us-east-1,aws://<redactedAccount>/us-west-2 is outdated.
	          We recommend at least version 21, distributed with CDK CLI
	          2.149.0 or higher. Please rebootstrap your environment by
	          runing 'cdk bootstrap aws://<redactedAccount>/us-east-1,aws://<redactedAccount>/us-west-2'

	Affected versions: bootstrap: <21

	More information at: https://github.com/aws/aws-cdk/issues/31885

Running this command results in:

❯ cdk bootstrap aws:///us-east-1,aws:///us-west-2
Expected environment name in format 'aws:///', got: aws:///us-east-1,aws:///us-west-2

Reproduction Steps

This is an error in the text. To repro, attempt to deploy a stack that was bootstrapped with a version prior to 2.149

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.164.1 (build bb9275c)

Framework Version

No response

Node.js Version

20.13.1

OS

MacOS Sonoma 14.6.1

Language

TypeScript

Language Version

No response

Other information

Related to the fix in: #31885

@perpil perpil added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 31, 2024
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Oct 31, 2024
@ashishdhingra ashishdhingra self-assigned this Oct 31, 2024
@ashishdhingra ashishdhingra added p2 needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 31, 2024
@ashishdhingra
Copy link
Contributor

Although, I'm unable to make notice appear when after bootstrapping CDK environment for region with CDK CLI version 2.145.0 (this has /cdk-bootstrap/hnb659fds/version SSM parameter with value 20), I do see a typo in notices.json. The mentioned notice with typo (runing should be running) is defined as below:

    {
      "title": "(cli): Bootstrap stack outdated",
      "issueNumber": 31885,
      "overview": "The bootstrap stack in {resolve:ENVIRONMENTS} is outdated. We recommend at least version 21, distributed with CDK CLI 2.149.0 or higher. Please rebootstrap your environment by runing 'cdk bootstrap {resolve:ENVIRONMENTS}'",
      "components": [
        {
          "name": "bootstrap",
          "version": "<21"
        }
      ],
      "schemaVersion": "1"
    }

Regarding, environments being displayed, the notice uses {resolve:ENVIRONMENTS}, which is a dynamic value resolved during CLI execution. {resolve:ENVIRONMENTS} would be resolved as comma separated list of values, e.g., aws://1234567890/us-east-1,aws://1234567890/us-east-2.

I'm able to confirm that running cdk bootstrap aws://<<ACCOUNT-ID>>/us-west-1,aws://<<ACCOUNT-ID>>/us-west-2 gives error Expected environment name in format 'aws://<account>/<region>', got: aws://<<ACCOUNT-ID>>/us-west-1,aws://<<ACCOUNT-ID>>/us-west-2. Using space character instead of comma, e.g. ``cdk bootstrap aws://<>/us-west-1 aws://<>/us-west-2`, works fine:

⏳  Bootstrapping environment aws://<<ACCOUNT-ID>>/us-west-1...
 ⏳  Bootstrapping environment aws://<<ACCOUNT-ID>>/us-west-2...
Trusted accounts for deployment: (none)
Trusted accounts for lookup: (none)
Using default execution policy of 'arn:aws:iam::aws:policy/AdministratorAccess'. Pass '--cloudformation-execution-policies' to customize.
Trusted accounts for deployment: (none)
Trusted accounts for lookup: (none)
Using default execution policy of 'arn:aws:iam::aws:policy/AdministratorAccess'. Pass '--cloudformation-execution-policies' to customize.
CDKToolkit: creating CloudFormation changeset...
CDKToolkit: creating CloudFormation changeset...
CDKToolkit | 0/10 | 3:29:09 PM | UPDATE_IN_PROGRESS   | AWS::CloudFormation::Stack | CDKToolkit User Initiated
CDKToolkit | 0/10 | 3:29:11 PM | UPDATE_IN_PROGRESS   | AWS::SSM::Parameter     | CdkBootstrapVersion
CDKToolkit | 0/10 | 3:29:11 PM | UPDATE_IN_PROGRESS   | AWS::IAM::Role          | FilePublishingRole
CDKToolkit | 0/10 | 3:29:12 PM | UPDATE_IN_PROGRESS   | AWS::IAM::Role          | LookupRole
CDKToolkit | 0/10 | 3:29:12 PM | UPDATE_IN_PROGRESS   | AWS::IAM::Role          | ImagePublishingRole
...

@ashishdhingra ashishdhingra added effort/small Small work item – less than a day of effort and removed needs-reproduction This issue needs reproduction. labels Oct 31, 2024
@ashishdhingra ashishdhingra removed their assignment Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants