Skip to content

(aws-events): EventPattern support for wildcard filters #28462

@tyyzqmf

Description

@tyyzqmf

Describe the feature

As this whats-new: Amazon EventBridge announces support for wildcard filters in rules

Use Case

We can set event pattern in web console:

{
  "detail-type": ["Step Functions Execution Status Change"],
  "resources": [{
    "wildcard": "arn:aws:states:us-east-1:111122223333:execution:xxx:yyy*"
  }],
  "source": ["aws.states"]
}

But can not create this rule by CDK:

const ruleState = new Rule(this, 'ListenStateStatusChange', {
      description: 'Rule for listen SFN state machine status change',
      eventPattern: {
        source: ['aws.states'],
        detailType: ['Step Functions Execution Status Change'],
        resources: [`{ "wildcard": "arn:${Aws.PARTITION}:states:${Aws.REGION}:${Aws.ACCOUNT_ID}:execution:xxx:yyy*" }`],
      },
    });

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.81.0

Environment details (OS name and version, etc.)

linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-eventsRelated to CloudWatch Eventseffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions