https://pulumi.com logo
Title
m

miniature-musician-31262

02/01/2023, 10:25 PM
Seeing an error I haven’t seen before when I attempt to deploy a CDK stack:
Diagnostics:
  pulumi:pulumi:Stack (pulumi-cdk-dev):
    error: Error: invocation of aws-native:index:getSsmParameterString returned an error: operation error SSM: GetParameter, https response error StatusCode: 400, RequestID: 8601c689-efde-477c-abc1-fa178badb77f, ParameterNotFound:
Could this be because the AWS account I’m using hasn’t been bootstrapped for CDK? I don’t think it has, so wondering if that’s what this might be about.
Yeah, that was it — needed to be bootstrapped, specifically with the “v2” template.
q

quaint-hydrogen-7228

02/02/2023, 7:41 AM
You mean AWS CDK v2.x? CDK bootstrap has its own versioning, which is at v8, v9 or something like that nowadays.
m

miniature-musician-31262

02/02/2023, 3:58 PM
Yep, I meant the template that gets used with CDK v2, but I didn’t realize the templates themselves had independent versioning. Do CDK users normally interact with that version number, or do they rely on their CDK version to manage it? My understanding from the AWS docs is that there are basically two versions, “legacy” (CDK v1.x) and “modern” (v2.x), and that
cdk bootstrap
handles everything based the CLI version.
q

quaint-hydrogen-7228

02/03/2023, 1:47 PM
DIfferent versions of the CDK, and not just 1.x or 2.x, require different minimal version of the bootstrap. The version of the bootstrap setup is stored in a parameter store value, and Cloudformation templates generated by AWS CDK has a rule that checks if this value is high enough. In the generated Cloudformation for a stack you will find a section like this one (usually at the end):
Parameters:
  BootstrapVersion:
    Type: AWS::SSM::Parameter::Value<String>
    Default: /cdk-bootstrap/hnb659fds/version
    Description: Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]
Rules:
  CheckBootstrapVersion:
    Assertions:
      - Assert:
          Fn::Not:
            - Fn::Contains:
                - - "1"
                  - "2"
                  - "3"
                  - "4"
                  - "5"
                - Ref: BootstrapVersion
        AssertDescription: CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.