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: tag resources with RFDK meta-data #74

Merged
merged 3 commits into from
Aug 21, 2020

Conversation

jusiskin
Copy link
Contributor

@jusiskin jusiskin commented Aug 20, 2020

Change

Add meta-data tags to CloudFormation resources deployed by the following RFDK constructs:

  • MongoDbInstance
  • HealthMonitor
  • Repository
  • RenderQueue
  • UsageBasedLicensing
  • WorkerFleet

The tag used is named aws-rfdk and it is tagged using the following template:

<RFDK_VERSION>:<CONSTRUCT_CLASS_NAME>

This was generalized into the tagConstruct(construct) function in packages/aws-rfdk/lib/core/lib/runtime-info.ts, which is called in the constructors of each construct listed above.

Testing

  • Wrote a general-purpose utility function testConstructTags(args) in packages/aws-rfdk/lib/core/test/tag-helpers.ts, that can be called from a test module to generate tests for tagging. It ensures that a specified number of each given CloudFormation resource type (e.g. AWS::AutoScaling::AutoScalingGroup) has the expected tag.
  • Added tests using the testConstructTag() function to each of the above-listed construct's test suites.
  • Build the python package and wrote a test app that uses the Repository construct. Synthesized the app with cdk synth and confirmed the resources were tagged as expected

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

@ddneilson ddneilson self-requested a review August 20, 2020 21:21
Copy link
Contributor

@ddneilson ddneilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thanks Josh!

@horsmand horsmand self-requested a review August 21, 2020 20:10
@horsmand horsmand merged commit 6b2ce6d into mainline Aug 21, 2020
@horsmand horsmand deleted the usiskin/tags_per_construct branch August 21, 2020 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants