Menu

AWS CDK: Context

Mar 15, 2022

The problem

How can I pass custom parameters to synthesize templates?

The solution

cdk.json has a context section that allows us to add custom parameters

{
  "context": {
    "custom": "parameter"
  }
}

The way we access that context is through the app node:

from aws_cdk import core

app = core.App()
app.node.try_get_context("custom")

Related tags:

Site menu

Back to top