https://pulumi.com logo
#pulumi-cdk
Title
# pulumi-cdk
m

mammoth-diamond-90308

06/01/2022, 9:41 AM
just trying to test a bit this pulumi-cdk thing and I’m facing the following error:
Copy code
$ pulumi up
Previewing update (pulumi-cdk-poc):
     Type                              Name                            Plan       Info
 +   pulumi:pulumi:Stack               pulumi-cdk-poc-pulumi-cdk-poc   create     1 error
 +   └─ cdk:index:Stack                teststack                       create
 +      └─ cdk:construct:TestStack     teststack/teststack             create
 +         └─ cdk:construct:Bucket     teststack/teststack/TestBucket  create
 +            └─ aws-native:s3:Bucket  testbucket560b80bc              create

Diagnostics:
  pulumi:pulumi:Stack (pulumi-cdk-poc-pulumi-cdk-poc):
    error: Error: invocation of aws-native:index:getSsmParameterString returned an error: operation error SSM: GetParameter, https response error StatusCode: 400, RequestID: e2426943-44df-4bbf-b45f-05854c386a05, ParameterNotFound:
        at Object.callback (/Users/neovasili/workspace/lab/pulumi-cdk-poc/node_modules/@pulumi/runtime/invoke.ts:162:33)
        at Object.onReceiveStatus (/Users/neovasili/workspace/lab/pulumi-cdk-poc/node_modules/@grpc/grpc-js/src/client.ts:338:26)
        at Object.onReceiveStatus (/Users/neovasili/workspace/lab/pulumi-cdk-poc/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
        at Object.onReceiveStatus (/Users/neovasili/workspace/lab/pulumi-cdk-poc/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
        at /Users/neovasili/workspace/lab/pulumi-cdk-poc/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
        at processTicksAndRejections (node:internal/process/task_queues:78:11)
steps followed: • create new pulumi typescript project • install
@pulumi/cdk
dependency • install
aws-cdk-lib
dependency • added small chunk of code to create S3 bucket (next message) •
pulumi preview
or
pulumi up
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as pulumicdk from "@pulumi/cdk";
import * as s3 from "aws-cdk-lib/aws-s3";

class TestStack extends pulumicdk.Stack {
    bucketName: pulumi.Output<string>;

    constructor(id: string, options?: pulumicdk.StackOptions) {
        super(id, options);

        const testBucket = new s3.Bucket(this, "TestBucket", {
            bucketName: "juan-pulumi-cdk-test-bucket",
        });
        this.bucketName = this.asOutput(testBucket.bucketName);

        this.synth();
    }
}

const stack = new TestStack("teststack");
export const url = stack.bucketName;
tried --verbose flag without better results
s

sparse-park-68967

06/01/2022, 6:06 PM
You do need to bootstrap your environment first: https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html
m

mammoth-diamond-90308

06/01/2022, 6:15 PM
thanks for the answer that helps a lot! I was pointing to an already bootstrapped AWS account where we are using CDK v1 so I guess that is asking for v2 bootstrapping, do you know if I can use v1?
s

sparse-park-68967

06/01/2022, 6:18 PM
As in use the v1 bootstrap? I am not sure how compatible they are? For the most bit we have only tried with v2
m

mammoth-diamond-90308

06/01/2022, 6:21 PM
yep, that was my question, because I,ve already checked that bootstrap of v2 breaks bootstrap of v1 in the same account/region
but with your answer I can continue testing it even if I need to do it in a different region or account 😄
I will share any related finding afterwards
s

sparse-park-68967

06/01/2022, 6:25 PM
Thank you!
q

quaint-hydrogen-7228

06/12/2022, 4:05 PM
There are different versions of the bootstrap in AWS CDK. If you have used CDK v1 bootstrap without the feature flag to set the "new CDK bootstrap" there are probably some issues. Also, different releases of CDK may have dependencies towards certain bootstrap versions. The CDK bootstrap sets an SSM parameter which version the bootstrap is, and regular AWS CDK deployments have a check in the generated CloudFormation which version is required.
❤️ 2
5 Views