aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

CDK Golang v2.0.0: get Unable to fetch parameters [/cdk-bootstrap/hnb659fds/version] error even when qualifier is provided

Open zackwwu opened this issue 4 years ago • 2 comments

General Issue

the qualifier is not applied during deployment

The Question

Hi, I tried to upgrade the cdk version to v2.0.0, and i bootstrapped my cloud environment with a qualifier v2, In my app i created a default synthesizer with the following config:

	stack := awscdk.NewStack(app, aws.String("stackName"), &awscdk.StackProps{
		Env: &awscdk.Environment{
			Region: aws.String("us-east-1"),
		},
		Synthesizer: awscdk.NewDefaultStackSynthesizer(&awscdk.DefaultStackSynthesizerProps{
			Qualifier:                         aws.String("v2"),
			BootstrapStackVersionSsmParameter: aws.String("/cdk-bootstrap/v2/version"),
		}),
	})

i can see that in the output cloudfront template:

  "Parameters": {
    "BootstrapVersion": {
      "Type": "AWS::SSM::Parameter::Value<String>",
      "Default": "/cdk-bootstrap/v2/version",
      "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
    }
  },

but as i deploy my app, i get Unable to fetch parameters [/cdk-bootstrap/hnb659fds/version] error. Looks like the cdk is still using the default qualifier.

CDK CLI Version

2.0.0 (build 4b6ce31)

Framework Version

No response

Node.js Version

No response

OS

macOS

Language

Go

Language Version

No response

Other information

No response

zackwwu avatar Dec 08 '21 04:12 zackwwu

I found the reason, by default previous-parameters' option is true, because the in the last deployment i was using v1, the cdk is still using parameters of last deployment, explicitly set --previous-parameters false` should fix the problem

zackwwu avatar Dec 08 '21 05:12 zackwwu

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Dec 08 '21 05:12 github-actions[bot]