0

I have a Stage in CodePipeline that deploys CloudFormation templates to generate environments on the fly to perform integration testing. I would like to erase those environment if the integration tests fail but I do not know how to approach the issue. I was thinking on adding a CloudWatch event to trigger a lambda but then I have the constraint of the 5 minutes timeout for the lambda.

darthfather
  • 377
  • 3
  • 12

1 Answers1

1

I was thinking on adding a CloudWatch event to trigger a lambda but then I have the constraint of the 5 minutes timeout for the lambda.

This is the approach I'd recommend. CodePipeline emits CloudWatch events including when an action fails: https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html

Regarding the 5 minute timeout, this shouldn't be a problem given the CloudFormation DeleteStack API will return straight away even though it will take CloudFormation a few minutes to actually delete the stack.

TimB
  • 1,457
  • 8
  • 10