Feature flags are a way to modify the deployment behavior of an AWS SDK deployment. These are potentially breaking, so use with caution. These feature flags are stored in the context of the CDK as key-value pairs.
Here we are setting a feature flag to tell the CDK to always use a unique launch template name. This is useful when requiring imdsv2 for an EC2 instance.
Without this feature flag enabled, you are likely to get an error similar to this:
To add this feature flag to the
cdk.json file when using projen we must modify the
This will add the necessary context to the
cdk.json file and enable the
uniqueImdsv2TemplateName feature flag.
For a complete list of available feature flags available: https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/FEATURE_FLAGS.md