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

Tags not applied to AWS::Events::Rule #4907

Open
raphael-riel opened this issue Nov 7, 2019 · 31 comments
Open

Tags not applied to AWS::Events::Rule #4907

raphael-riel opened this issue Nov 7, 2019 · 31 comments
Labels
@aws-cdk/aws-events Related to CloudWatch Events effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p1

Comments

@raphael-riel
Copy link
Contributor

Tag not applied to AWS::Events::Rule Ressource.

Reproduction Steps

With following Stack:

import cdk = require('@aws-cdk/core');
import events = require("@aws-cdk/aws-events");

export class CdkIssueEventsRuleTagsStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const rule = new events.Rule(this, "ScheduleRule", {
      schedule: events.Schedule.rate(cdk.Duration.hours(12)),
      targets: []
    });

    cdk.Tag.add(rule, "MyTag", "ThatValue");
  }
}

Synthesized template is:

Resources:
  ScheduleRuleDA5BD877:
    Type: AWS::Events::Rule
    Properties:
      ScheduleExpression: rate(12 hours)
      State: ENABLED
    Metadata:
      aws:cdk:path: CdkIssueEventsRuleTagsStack/ScheduleRule/Resource
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      Modules: aws-cdk=1.15.0,@aws-cdk/aws-events=1.15.0,@aws-cdk/core=1.15.0,@aws-cdk/cx-api=1.15.0,jsii-runtime=node.js/v12.12.0
    Condition: CDKMetadataAvailable

[...]

In console, the Tags are available.
image

Environment

Using CDK 1.15.0


This is 🐛 Bug Report

@raphael-riel raphael-riel added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2019
@raphael-riel
Copy link
Contributor Author

While writing the report, I've seen that it seems to be CloudFormation that doesn't support Tags for this kind of Ressource.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html

Should a Ressource that doesn't support Tags emit some sort of WARN or raises when we try to apply Tags to it?

@SomayaB SomayaB added the @aws-cdk/aws-events Related to CloudWatch Events label Nov 8, 2019
@rix0rrr rix0rrr added needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. package/cfn Related to the CFN layer (L1) and removed needs-triage This issue or PR still needs to be triaged. labels Nov 11, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 11, 2019

Because we assign tags recursively to all constructs in a scope it really doesn't make much sense to warn for constructs that don't support it. You would get a deluge of warnings if you apply tags at a high level.

We will have to wait for CloudFormation support.

@rix0rrr rix0rrr added the p2 label Nov 11, 2019
@raphael-riel
Copy link
Contributor Author

@rix0rrr I totally agree!

In my specific case, I explicitly attempt to add the Tag on the invalid Construct; it's in no way recursive.
Could a quick-win be to somehow only check at the initial cdk.Tag.add() invocation?

Or could there be two add, one public for the explicit call, and one internal for recursive calls?
This way the Constructs classes could get a proper ITaggeable type and benefit from compile-time checking ?

Cause in the end, there's always be some stuff not supported in CloudFormation, and reflecting those in my IDE while coding (IntelliSense) would greatly help! (The main reason I love so much working with the CDK!)

What do you think of the proposal/brainstorm above?

Thanks!

@SomayaB SomayaB added bug This issue is a bug. and removed bug This issue is a bug. package/cfn Related to the CFN layer (L1) labels Nov 15, 2019
@rix0rrr rix0rrr added the effort/small Small work item – less than a day of effort label Jan 23, 2020
@SomayaB SomayaB added feature-request A feature should be added or improved. and removed p2 labels Jun 22, 2020
@SomayaB SomayaB assigned shivlaks and unassigned rix0rrr Aug 20, 2020
@NGL321 NGL321 assigned rix0rrr and unassigned shivlaks Jan 25, 2021
@yogeshdass
Copy link

Is this issue still not fixed?

@mickog
Copy link

mickog commented Mar 4, 2021

Any update on this

@piotrmoszkowicz
Copy link
Contributor

Any updates on this?

@MichalOsadowski
Copy link

Any update?

@DaWyz
Copy link
Contributor

DaWyz commented Mar 20, 2021

I believe this is the related issue in the CloudFormation roadmap.

@rupertevill
Copy link

Any update on this? 🙂

@tsaluszewski
Copy link

Any update or workaround 🙏 ?

@nikitacr7
Copy link

+1 Any updates?

@coreylane
Copy link

Is this on the roadmap for cloudformation coverage?

@cristianrat
Copy link

cristianrat commented Oct 19, 2021

what a joke
because of these kinds of issues we're actively working towards getting rid of cdk and replacing it
(unresolved issues, after 2 years. Issues are generally expected, how you resolve them (or not at all) makes the difference)

@cristianrat
Copy link

and to be productive, my work around is to use boto3 to tag (very quick and simple, if you are on the python flavour of cdk)

@argenstijn
Copy link

any update?

@craigsands
Copy link

+1

2 similar comments
@eliasbedmar
Copy link

+1

@tma-dathi
Copy link

+1

@peterwoodworth
Copy link
Contributor

peterwoodworth commented Jun 21, 2022

We increase priority based on reactions to the original post - not comments. Please don't clutter discussion with +1 comments

Additionally, there's nothing CDK can do about this as mentioned in the first reply. We have to wait for CloudFormation support in the linked issue. Please give a thumbs up and comment in that issue instead, and this will be automatically fixed in CDK once fixed in CloudFormation.

Thanks!

@OmriSama
Copy link

Not a CDK user, but like @raphael-riel said this is an issue in CloudFormation as well. Is there a "matching" issue for this somewhere in CloudFormation as well?

@peterwoodworth
Copy link
Contributor

@OmriSama I linked it in my previous comment

@sellers
Copy link

sellers commented Nov 8, 2022

While writing the report, I've seen that it seems to be CloudFormation that doesn't support Tags for this kind of Ressource. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html

Should a Ressource that doesn't support Tags emit some sort of WARN or raises when we try to apply Tags to it?

But this page says it does support Tag, am I missing something?   

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-tag.html

@peterwoodworth
Copy link
Contributor

@sellers There needs to be a property Tags on the CloudFormation resource, like here https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html#cfn-ec2-vpc-tags

The Tag type you linked for the Rule seems to be unused - I see no properties take a Tag as a type

@sellers
Copy link

sellers commented Nov 9, 2022

@sellers There needs to be a property Tags on the CloudFormation resource, like here https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html#cfn-ec2-vpc-tags

The Tag type you linked for the Rule seems to be unused - I see no properties take a Tag as a type

I am afraid that is also invalid  .  It appears the documentation has a note "  Important

Currently, tags are only available when using ECS with EventBridge."

Encountered unsupported property Tags

@peterwoodworth
Copy link
Contributor

@sellers My point was that you can see that the CloudFormation Rule resource that you linked has no Tags property, hence why this is not supported by CDK or CloudFormation

@daknhh
Copy link

daknhh commented Jan 19, 2024

still not working in 2.122.0 (build 7e77e02):
cdk.Tags.of(eventRule).add(tag.key, tag.value); results in no tags on eventrule

@MichaelAnckaert
Copy link

Latest version (2.132.1 build 9df7dd3) does not support tagging yet.

@khushail khushail added the p2 label Jul 31, 2024
@github-actions github-actions bot added p1 and removed p2 labels Aug 4, 2024
Copy link

github-actions bot commented Aug 4, 2024

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.

@arvindsuriyaa
Copy link

Any work arounds yet??

@yowaraj
Copy link

yowaraj commented Feb 18, 2025

Any updates on this please. Its been a long time this issue was raised and no solution yet!

@pahud
Copy link
Contributor

pahud commented Feb 20, 2025

CDK won't support that before CloudFormation has the support.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html

Please help the cloudformation team prioritize it by having an issue in https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues and add 👍 there. As soon as CFN has the support, CDK should immediate support that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events Related to CloudWatch Events effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p1
Projects
None yet
Development

No branches or pull requests