-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-eventsRelated to CloudWatch EventsRelated to CloudWatch EventsbugThis issue is a bug.This issue is a bug.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.
Description
While using the aws_events.EventPattern class, cdk output as JSON, for detail_type renders detailType instead of detail-type, which cause the pattern to not match the real payload received from EventBridge.
Reproduction Steps
Create the following event pattern
event_pattern = aws_events.EventPattern(
account=[core.Aws.ACCOUNT_ID],
detail={
'Status': ['Failed', 'TimedOut', 'Cancelled']
},
region='eu-central-1',
source=['aws.ssm'],
detail_type=['EC2 Automation Execution Status-change Notification']
)
When issuing a CDK synth, the output eventPattern looks like this :
"EventPattern": {
"account": [
{
"Ref": "AWS::AccountId"
}
],
"detail": {
"Status": [
"Failed",
"TimedOut",
"Cancelled"
]
},
"detailType": [
"EC2 Automation Execution Status-change Notification"
],
"region": [
"eu-central-1"
],
"source": [
"aws.ssm"
]
}
What did you expect to happen?
detailType object should be rendered as detail-type instead.
Environment
- **CDK CLI Version :1.122.0 **
- **Node.js Version: v14.15.5 **
- **OS :Ubuntu 18.04 LTS **
- **Language (Version): Python 3.8.10 **
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-eventsRelated to CloudWatch EventsRelated to CloudWatch EventsbugThis issue is a bug.This issue is a bug.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.