Skip to content
Discussion options

You must be logged in to vote

@github-actions proposed-answer

How do I create a new StringParameter and reference it in another construct in the same cdk deploy call?

Expose the StringParameter as a property of your construct. Pass this property into your second construct through the construct props

Since these are within the same stack, you have no need (and don't want) to import anything, and can instead directly reference the construct

    this.stringParameter = new ssm.StringParameter(this, 'my-first-param-construct', {
      stringValue: 'hello,
      parameterName: 'my-first-param',
      description: 'test',
    });

---

    export class MyStack extends Stack {
      const first = new MyFirstConstruct(this, '…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@github-actions
Comment options

Answer selected by dev-samples
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants