Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(pipelines): Allow using S3 Event Notifications as pipeline trigger. #26894

Open
2 tasks
SantiRaposo opened this issue Aug 26, 2023 · 2 comments
Open
2 tasks
Labels
@aws-cdk/pipelines CDK Pipelines library effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@SantiRaposo
Copy link

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

@SantiRaposo SantiRaposo added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 26, 2023
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Aug 26, 2023
@pahud
Copy link
Contributor

pahud commented Aug 28, 2023

Makes sense for me. And this is the recommended configuration according to the document.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 28, 2023
@tgmedia-nz
Copy link

same here - please prioritise :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants