Update CodeCommit source for Pipelines to be event-driven rather than polling
Ask
Today, the CodeCommit source for CodePipeline pipelines default to a polling behavior with copilot pipeline init (rather than event-driven and push).
Initially, only polling was supported. Events are now the default and recommended way to start your pipeline when there’s a code change. https://docs.aws.amazon.com/codepipeline/latest/userguide/update-change-detection.html#update-change-detection-cli-codecommit
Copilot should instead switch over to the more reactive and frugal option of event-driven triggers.
CodePipeline provides a nice step-by-step walkthrough of the changes that needs to be made as well: https://docs.aws.amazon.com/codepipeline/latest/userguide/update-change-detection.html#update-change-detection-cfn
Original request
https://gitter.im/aws/copilot-cli?at=63d06167c2911455433397a0
I'm bringing up the topic again :)
Please, this one is really needed.
After letting copilot deploy the pipelines, we setup the pipelines for events, but every time we do a copilot pipeline deploy to update them (for example, after adding a job), the pipeline is setup for polling again but the event rule in event bridge is not removed, so we suffer of duplicated executions of pipelines constantly.
Given that eventing for pipelines is the recommendation from AWS, this should be made into copilot since it's supposed to encode all current best practices from AWS.