Tags not applied to `AWS::Events::Rule`
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.

Environment
Using CDK 1.15.0
This is :bug: Bug Report
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?
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 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!
Is this issue still not fixed?
Any update on this
Any updates on this?
Any update?
I believe this is the related issue in the CloudFormation roadmap.
Any update on this? 🙂
Any update or workaround 🙏 ?
+1 Any updates?
Is this on the roadmap for cloudformation coverage?
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)
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)
any update?
+1
+1
+1
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!
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?