Skip to content

(Property Injection): (Track when it is used) #34806

Open
@pcheungamz

Description

@pcheungamz

Describe the feature

We would like to track Cloudformation templates that use the Blueprint Property Injection feature.

In the applyInjectors function (before this line https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/prop-injectors-helpers.ts#L22), I would like to add the following code to update the Stack's metadata to show that Blueprint Property Injection took place.

const stack = Stack.of(scope);
stack.addMetadata('@amzn/aws-cdk-lib-blueprint', 'Y');

Use Case

This will prefix the Cloudformation Template with:

"Metadata": {
    "@amzn/aws-cdk-lib-blueprint": "Y"
  },

This will allow us to track CFN templates that use Blueprint property injection.

Proposed Solution

Add these two lines in applyInjectors.

const stack = Stack.of(scope);
stack.addMetadata('@amzn/aws-cdk-lib-blueprint', 'Y');

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS CDK Library version (aws-cdk-lib)

aws-cdk-lib@2.201.0

AWS CDK CLI version

2.1018.1 (build cb71364)

Environment details (OS name and version, etc.)

Amazon Linux 2 x86_64 5.10 Kernel

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cloudformationRelated to AWS CloudFormationfeature-requestA feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions