awslabs / aws-service-catalog-factory

This is a framework where you define a Service Catalog portfolio, products and versions using YAML. For versions of your products you specify where the source code for them can be found and the framework publishes the portfolio, products and versions in every* AWS Region after validating, linting and testing them.
Apache License 2.0
136 stars 44 forks source link

Eventbridge Rules are not created for non-polling CodeCommit Sources #351

Open peteawood opened 1 year ago

peteawood commented 1 year ago

Steps to reproduce

  1. With version 0.101.1, create a new CodeCommit repo containing any simple product defined in YAML.
  2. Update Factory to reference the new product adding a version with a source referencing the new CodeCommit repo with Polling either explicitly set to False or omitted to take False as the default

Expected results

  1. Factory runs and creates a new pipeline for the product with the source change detection options set to Amazon CloudWatch Events.
  2. A CloudWatch Events/EventBridge rule is created automatically to trigger the newly created pipeline for the new product

Actual results

Number 1 happens correctly but number 2 does not. Taking a look at the cfn stack created for the pipeline also shows no sign of an EventBridge rule in the Resources tab nor in the template itself.

Possible cause

The switch from Luigi to Waluigi in 0.89.0 appears to have changed the source of the template for new Product Pipelines. Previously it was a Jinja2 template (permalink) which explicitly included an EventBridge Rule to trigger the pipeline.

The replacement appears to be pipeline_template_builder which only adds the Pipeline and individual stages to the template. There doesn't seem to be any reference to an EventBridge rule.

Would an acceptable solution be to update the SourceTemplateMixin class to add EventBridge rules for versions/sources where required? Or alternatively a separate TriggerTemplateMixIn class which does the same job?