-
Notifications
You must be signed in to change notification settings - Fork 4k
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(events-targets): add taskTags and propagateTags support #19583
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this part of the existing tags system?
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
…#23838) This adds the ability to pass a tagList and the propagateTags flag to EC2 and Fargate ECS tasks triggered by an event. Users can leverage either or both of these attributes to apply tags an ECS task that's triggered through an Event. Both of these attributes are defined in the EcsParameters for a Rule https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-ecsparameters.html. This closes #9823. This is a non-breaking change. These new fields are added as optional with default values such that it won't impact existing stacks. Also note that these are two separate fields: a user can pass either or both but they're not dependent on each other since they have different uses. `propagateTags` will copy tags from the task definition, while `tagList` provides an explicit set of tags to be applied to the task but that are not on the task definition. In either case, these tags are separate from the tags on the EventBridge bus or Rule. I did see that there was previously a PR opened for this in the past which was closed for staleness (#19583). There was a comment on there asking if this could be added to the existing tag system (#19583 (review)). I'm not sure if that would make sense in this case since the resource being created at deploy-time by CloudFormation isn't the resource being tagged. The event rule itself is instead being given the flag to pass along tags onto the Task that it's creating at some time in the future when the schedule triggers.I did see that there was previously a PR opened for this in the past which was closed for staleness (#19583). There was a comment on there asking if this could be added to the existing tag system (#19583 (review)). I'm not sure if that would make sense in this case since the resource being created at deploy-time by CloudFormation isn't the resource being tagged. The event rule itself is instead being given the flag to pass along tags onto the Task that it's creating at some time in the future when the schedule triggers. ---- ### All Submissions: * [x ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [x ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Amazon.CDK.Lib](https://togithub.com/aws/aws-cdk) | nuget | minor | `2.75.1` -> `2.76.0` | --- ### Release Notes <details> <summary>aws/aws-cdk</summary> ### [`v2.76.0`](https://togithub.com/aws/aws-cdk/releases/tag/v2.76.0) ##### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES - **servicecatalogappregistry:** this change will deprecated **associateStack** and **associateAttributeGroup** in Application Construct. The user who are using these two method need to update to use alternative method. For associateStack, the alternative method is **associateApplicationWithStack** For associateAttributeGroup, the alternative method is **AttributeGroup.associateWith** The user who are using these two method need to update to use alternative method. For associateStack, the alternative method is **associateApplicationWithStack** For associateAttributeGroup, the alternative method is **AttributeGroup.associateWith** Purpose of this PR: we need to remove deprecated resource before we moving into stable version The method that we remove is: associateStack and associateAttributeGroup CHANGES: 1. in lib/application.ts, we remove these two methods and update their corresponding interface 2. in test/ application.test.ts & test/integ.application.ts, we update application.test.ts and integ.application.ts to remove these two methods' related test *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* ##### Features - **cli-lib:** add missing deploy options ([#​25042](https://togithub.com/aws/aws-cdk/issues/25042)) ([ac40aed](https://togithub.com/aws/aws-cdk/commit/ac40aed6f79129d6793c663dcb81bb983e21f123)) - **codebuild:** adds support for standard (7.0) image ([#​25136](https://togithub.com/aws/aws-cdk/issues/25136)) ([4eb5e99](https://togithub.com/aws/aws-cdk/commit/4eb5e99ef94fba1c1a643e159acd9e39f61ac7f7)), closes [#​25124](https://togithub.com/aws/aws-cdk/issues/25124) - **core:** add rule IDs to the analytics string ([#​25084](https://togithub.com/aws/aws-cdk/issues/25084)) ([0c1e885](https://togithub.com/aws/aws-cdk/commit/0c1e885b9d56718e21fde5c838b6a755a4c81235)) - **ec2:** add new latest amazon linux machine images ([#​25083](https://togithub.com/aws/aws-cdk/issues/25083)) ([01fd89a](https://togithub.com/aws/aws-cdk/commit/01fd89a660710b27cd42e07a838a9a548e4f106e)), closes [#​21011](https://togithub.com/aws/aws-cdk/issues/21011) [#​24873](https://togithub.com/aws/aws-cdk/issues/24873) [#​23523](https://togithub.com/aws/aws-cdk/issues/23523) - **events-targets:** Add tagging for ECS tasks triggered by an event ([#​23838](https://togithub.com/aws/aws-cdk/issues/23838)) ([e3bc59a](https://togithub.com/aws/aws-cdk/commit/e3bc59a7ca8fc282051d97123f4d5a8bdd660db7)), closes [/github.com/aws/aws-cdk/pull/19583#pullrequestreview-936428722](https://togithub.com/aws//github.com/aws/aws-cdk/pull/19583/issues/pullrequestreview-936428722) [/github.com/aws/aws-cdk/pull/19583#pullrequestreview-936428722](https://togithub.com/aws//github.com/aws/aws-cdk/pull/19583/issues/pullrequestreview-936428722) - **kms:** add required aliasname prefix to aliasnames with tokens ([#​25116](https://togithub.com/aws/aws-cdk/issues/25116)) ([1b18a19](https://togithub.com/aws/aws-cdk/commit/1b18a192fab79c6f65cb9c554a7473e36aa67297)), closes [#​25033](https://togithub.com/aws/aws-cdk/issues/25033) - **rds:** Support SQL Server for RDS proxy ([#​25102](https://togithub.com/aws/aws-cdk/issues/25102)) ([2ea3e45](https://togithub.com/aws/aws-cdk/commit/2ea3e455712e175a914fd9362ce26137a75f4fc7)), closes [#​22164](https://togithub.com/aws/aws-cdk/issues/22164) [/github.com/aws/aws-cdk/issues/22164#issuecomment-1297767306](https://togithub.com/aws//github.com/aws/aws-cdk/issues/22164/issues/issuecomment-1297767306) ##### Bug Fixes - **assertions:** nested stacks inside non-root stages don't resolve t… ([#​25006](https://togithub.com/aws/aws-cdk/issues/25006)) ([2d4a60d](https://togithub.com/aws/aws-cdk/commit/2d4a60dee7892041786482ac001e858511ac0b40)), closes [#​24004](https://togithub.com/aws/aws-cdk/issues/24004) - **aws-cdk-lib:** compiled .js files are no longer being minified ([#​25160](https://togithub.com/aws/aws-cdk/issues/25160)) ([b53727f](https://togithub.com/aws/aws-cdk/commit/b53727fccdb41eb7f95bb6b867f5295722cb085f)) - **batch:** `jobQueueName` returns ARN instead of name ([#​25093](https://togithub.com/aws/aws-cdk/issues/25093)) ([a344507](https://togithub.com/aws/aws-cdk/commit/a34450771f908057f5a194c6bb3bb9694ce1682c)), closes [#​23018](https://togithub.com/aws/aws-cdk/issues/23018) - **cloudwatch:** correct CompositeAlarm.fromCompositeAlarmName ARN format ([#​24604](https://togithub.com/aws/aws-cdk/issues/24604)) ([3bf6adb](https://togithub.com/aws/aws-cdk/commit/3bf6adb48a96c89455017fc0aeba97a1fe118542)), closes [#​24594](https://togithub.com/aws/aws-cdk/issues/24594) - **core:** Duration.parse() doesn't parse milliseconds ([#​25010](https://togithub.com/aws/aws-cdk/issues/25010)) ([8ca4c09](https://togithub.com/aws/aws-cdk/commit/8ca4c09817d03a094ac395f9ad1adace931f74b4)), closes [#​24971](https://togithub.com/aws/aws-cdk/issues/24971) - **core:** pull alpine image from ecr public ([#​25179](https://togithub.com/aws/aws-cdk/issues/25179)) ([6d906f8](https://togithub.com/aws/aws-cdk/commit/6d906f8f99d3adc38f3dd15390bd3118701f2f81)), closes [#​24969](https://togithub.com/aws/aws-cdk/issues/24969) - **ecs:** allow passing execution role to imported TaskDefinitions ([#​24987](https://togithub.com/aws/aws-cdk/issues/24987)) ([0d156a8](https://togithub.com/aws/aws-cdk/commit/0d156a810a7a049e03f2d84582f12b7a231dea2e)), closes [#​24984](https://togithub.com/aws/aws-cdk/issues/24984) [#​24984](https://togithub.com/aws/aws-cdk/issues/24984) - **kinesis:** remove StreamModeDetails in template when not specified ([#​24994](https://togithub.com/aws/aws-cdk/issues/24994)) ([787f38a](https://togithub.com/aws/aws-cdk/commit/787f38acf687f854cc77b9b258f0de8ad27520b0)), closes [#​21829](https://togithub.com/aws/aws-cdk/issues/21829) - stack account id throws error if not a string ([#​25134](https://togithub.com/aws/aws-cdk/issues/25134)) ([d9468c5](https://togithub.com/aws/aws-cdk/commit/d9468c5ce5e73bf2d987e0427b04c767e008bca0)) - **servicecatalogappregistry:** Remove deprecated resource in Application Construct ([#​25095](https://togithub.com/aws/aws-cdk/issues/25095)) ([9222f21](https://togithub.com/aws/aws-cdk/commit/9222f217aa5f199dd88addc9d0dee0f3f900b5a2)) *** #### Alpha modules (2.76.0-alpha.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/cythral/brighid-discord-adapter). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41NC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNTQuMCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Amazon.CDK.Lib](https://togithub.com/aws/aws-cdk) | nuget | minor | `2.75.1` -> `2.76.0` | --- ### Release Notes <details> <summary>aws/aws-cdk</summary> ### [`v2.76.0`](https://togithub.com/aws/aws-cdk/releases/tag/v2.76.0) ##### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES - **servicecatalogappregistry:** this change will deprecated **associateStack** and **associateAttributeGroup** in Application Construct. The user who are using these two method need to update to use alternative method. For associateStack, the alternative method is **associateApplicationWithStack** For associateAttributeGroup, the alternative method is **AttributeGroup.associateWith** The user who are using these two method need to update to use alternative method. For associateStack, the alternative method is **associateApplicationWithStack** For associateAttributeGroup, the alternative method is **AttributeGroup.associateWith** Purpose of this PR: we need to remove deprecated resource before we moving into stable version The method that we remove is: associateStack and associateAttributeGroup CHANGES: 1. in lib/application.ts, we remove these two methods and update their corresponding interface 2. in test/ application.test.ts & test/integ.application.ts, we update application.test.ts and integ.application.ts to remove these two methods' related test *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* ##### Features - **cli-lib:** add missing deploy options ([#​25042](https://togithub.com/aws/aws-cdk/issues/25042)) ([ac40aed](https://togithub.com/aws/aws-cdk/commit/ac40aed6f79129d6793c663dcb81bb983e21f123)) - **codebuild:** adds support for standard (7.0) image ([#​25136](https://togithub.com/aws/aws-cdk/issues/25136)) ([4eb5e99](https://togithub.com/aws/aws-cdk/commit/4eb5e99ef94fba1c1a643e159acd9e39f61ac7f7)), closes [#​25124](https://togithub.com/aws/aws-cdk/issues/25124) - **core:** add rule IDs to the analytics string ([#​25084](https://togithub.com/aws/aws-cdk/issues/25084)) ([0c1e885](https://togithub.com/aws/aws-cdk/commit/0c1e885b9d56718e21fde5c838b6a755a4c81235)) - **ec2:** add new latest amazon linux machine images ([#​25083](https://togithub.com/aws/aws-cdk/issues/25083)) ([01fd89a](https://togithub.com/aws/aws-cdk/commit/01fd89a660710b27cd42e07a838a9a548e4f106e)), closes [#​21011](https://togithub.com/aws/aws-cdk/issues/21011) [#​24873](https://togithub.com/aws/aws-cdk/issues/24873) [#​23523](https://togithub.com/aws/aws-cdk/issues/23523) - **events-targets:** Add tagging for ECS tasks triggered by an event ([#​23838](https://togithub.com/aws/aws-cdk/issues/23838)) ([e3bc59a](https://togithub.com/aws/aws-cdk/commit/e3bc59a7ca8fc282051d97123f4d5a8bdd660db7)), closes [/github.com/aws/aws-cdk/pull/19583#pullrequestreview-936428722](https://togithub.com/aws//github.com/aws/aws-cdk/pull/19583/issues/pullrequestreview-936428722) [/github.com/aws/aws-cdk/pull/19583#pullrequestreview-936428722](https://togithub.com/aws//github.com/aws/aws-cdk/pull/19583/issues/pullrequestreview-936428722) - **kms:** add required aliasname prefix to aliasnames with tokens ([#​25116](https://togithub.com/aws/aws-cdk/issues/25116)) ([1b18a19](https://togithub.com/aws/aws-cdk/commit/1b18a192fab79c6f65cb9c554a7473e36aa67297)), closes [#​25033](https://togithub.com/aws/aws-cdk/issues/25033) - **rds:** Support SQL Server for RDS proxy ([#​25102](https://togithub.com/aws/aws-cdk/issues/25102)) ([2ea3e45](https://togithub.com/aws/aws-cdk/commit/2ea3e455712e175a914fd9362ce26137a75f4fc7)), closes [#​22164](https://togithub.com/aws/aws-cdk/issues/22164) [/github.com/aws/aws-cdk/issues/22164#issuecomment-1297767306](https://togithub.com/aws//github.com/aws/aws-cdk/issues/22164/issues/issuecomment-1297767306) ##### Bug Fixes - **assertions:** nested stacks inside non-root stages don't resolve t… ([#​25006](https://togithub.com/aws/aws-cdk/issues/25006)) ([2d4a60d](https://togithub.com/aws/aws-cdk/commit/2d4a60dee7892041786482ac001e858511ac0b40)), closes [#​24004](https://togithub.com/aws/aws-cdk/issues/24004) - **aws-cdk-lib:** compiled .js files are no longer being minified ([#​25160](https://togithub.com/aws/aws-cdk/issues/25160)) ([b53727f](https://togithub.com/aws/aws-cdk/commit/b53727fccdb41eb7f95bb6b867f5295722cb085f)) - **batch:** `jobQueueName` returns ARN instead of name ([#​25093](https://togithub.com/aws/aws-cdk/issues/25093)) ([a344507](https://togithub.com/aws/aws-cdk/commit/a34450771f908057f5a194c6bb3bb9694ce1682c)), closes [#​23018](https://togithub.com/aws/aws-cdk/issues/23018) - **cloudwatch:** correct CompositeAlarm.fromCompositeAlarmName ARN format ([#​24604](https://togithub.com/aws/aws-cdk/issues/24604)) ([3bf6adb](https://togithub.com/aws/aws-cdk/commit/3bf6adb48a96c89455017fc0aeba97a1fe118542)), closes [#​24594](https://togithub.com/aws/aws-cdk/issues/24594) - **core:** Duration.parse() doesn't parse milliseconds ([#​25010](https://togithub.com/aws/aws-cdk/issues/25010)) ([8ca4c09](https://togithub.com/aws/aws-cdk/commit/8ca4c09817d03a094ac395f9ad1adace931f74b4)), closes [#​24971](https://togithub.com/aws/aws-cdk/issues/24971) - **core:** pull alpine image from ecr public ([#​25179](https://togithub.com/aws/aws-cdk/issues/25179)) ([6d906f8](https://togithub.com/aws/aws-cdk/commit/6d906f8f99d3adc38f3dd15390bd3118701f2f81)), closes [#​24969](https://togithub.com/aws/aws-cdk/issues/24969) - **ecs:** allow passing execution role to imported TaskDefinitions ([#​24987](https://togithub.com/aws/aws-cdk/issues/24987)) ([0d156a8](https://togithub.com/aws/aws-cdk/commit/0d156a810a7a049e03f2d84582f12b7a231dea2e)), closes [#​24984](https://togithub.com/aws/aws-cdk/issues/24984) [#​24984](https://togithub.com/aws/aws-cdk/issues/24984) - **kinesis:** remove StreamModeDetails in template when not specified ([#​24994](https://togithub.com/aws/aws-cdk/issues/24994)) ([787f38a](https://togithub.com/aws/aws-cdk/commit/787f38acf687f854cc77b9b258f0de8ad27520b0)), closes [#​21829](https://togithub.com/aws/aws-cdk/issues/21829) - stack account id throws error if not a string ([#​25134](https://togithub.com/aws/aws-cdk/issues/25134)) ([d9468c5](https://togithub.com/aws/aws-cdk/commit/d9468c5ce5e73bf2d987e0427b04c767e008bca0)) - **servicecatalogappregistry:** Remove deprecated resource in Application Construct ([#​25095](https://togithub.com/aws/aws-cdk/issues/25095)) ([9222f21](https://togithub.com/aws/aws-cdk/commit/9222f217aa5f199dd88addc9d0dee0f3f900b5a2)) *** #### Alpha modules (2.76.0-alpha.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/cythral/brighid-commands). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41NC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNTQuMCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Add CDK support for
TagList
andPropagateTags
Cloudformation properties to be able to utilize tags when deploying Fargate scheduled tasks.Closes #9823
All Submissions:
Adding new Unconventional Dependencies:
New Features
cdk-integ
to deploy the infrastructure and generate the snapshot (i.e.cdk-integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license