Skip to content

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

Open
@raphael-riel

Description

@raphael-riel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-eventsRelated to CloudWatch Eventseffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.needs-cfnThis issue is waiting on changes to CloudFormation before it can be addressed.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions