Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): enable additional metadata collection (under feature flag) #32827

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GavinZZ
Copy link
Contributor

@GavinZZ GavinZZ commented Jan 10, 2025

Issue # (if applicable)

Closes #.

Reason for this change

Expand the scope of usage data collected by the AWS CDK to better inform CDK development and improve communication for security concerns and emerging issues. Currently, for those that opt in, the CDK collects usage data on your CDK version and which L2 constructs you use. For more information on current CDK behavior, see Version Reporting.

This proposal expands the scope of usage data collection to include the following from L2 constructs in CDK applications:

  • Property keys - Collect which property keys you use from the L2 constructs in your app. This includes property keys nested in dictionary objects.
  • Property values of Boolean and enum types - Collect property key values of only Boolean and enum types. All other types, such as string values or construct references will be redacted.
  • Method name, keys, and property values of Boolean and ENUM types - When you use an L2 construct method, we will collect the method name, property keys, and property values of of Boolean and enum types

Description of changes

Update CDK synthesis code to additionally handle resource metadata.

On feature flag set to true, synthesis will not only inject Metadata usage like version and construct name, it will additionally look for any construct/method/feature flag metadata injected during resource creation.

Note that this PR is only part one so we will have follow up PRs to add metadata injection during resource creation.

On feature flag set to false, it should be the same as before.

Describe any new or updated permissions being added

N/A

Description of how you validated changes

New unit tests added.
New integration tests added.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@GavinZZ GavinZZ requested a review from a team as a code owner January 10, 2025 00:29
@github-actions github-actions bot added the p2 label Jan 10, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team January 10, 2025 00:29
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 10, 2025
@GavinZZ GavinZZ changed the base branch from yuanhaoz/feat/metadata-collection to main January 10, 2025 00:49
@GavinZZ GavinZZ added the pr/do-not-merge This PR should not be merged at this time. label Jan 10, 2025
@GavinZZ
Copy link
Contributor Author

GavinZZ commented Jan 10, 2025

Temporarily change the target branch to main to trigger integration tests.

Note that adding import statements and this.node.addMetadata(...) statement to Resources' constructor will be in separate PR.
Currently, this will redact ENUM values as well. We do want to keep ENUM values un-redacted, but this will come as a future change.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ae763b0
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2 pr/do-not-merge This PR should not be merged at this time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants