-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Describe the feature
Currently, the S3 triggers that CDK Pipelines support are described here:
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.S3Trigger.html
However, a simpler way to enable eventbridge notifications for an S3 bucket exists as a bucket level setting:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html
However when using S3Trigger.EVENTS
the generated event pattern is:
{
"detail-type": ["AWS API Call via CloudTrail"],
"source": ["aws.s3"],
"detail": {
"requestParameters": {
"bucketName": ["<bucket-name>"],
"key": ["<buckt-key>"]
},
"resources": {
"ARN": ["<object-arn>"]
},
"eventName": ["CompleteMultipartUpload", "CopyObject", "PutObject"]
}
}
Which does not match with the event generated by the S3 integration.
Use Case
Allow using event-triggered pipes (which AWS recommends https://docs.aws.amazon.com/codepipeline/latest/userguide/update-change-detection.html#update-change-detection-S3-event) without having to provision a CloudTrail trail.
Proposed Solution
Another enum value that generates an event pattern similar to the following:
{
"source": [
"aws.s3"
],
"detailType": [
"Object Created",
"Object Restore Completed"
],
"detail": {
"bucket": {
"name": "<bucket-name>"
},
"object": {
"key": "<object-key>"
}
}
}
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.93.0
Environment details (OS name and version, etc.)
macOS 13.5.1