From 5ac2cb4e115445ed0c50841de3267c50b93a3cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=97=84hollsteinm=E2=96=BA?= Date: Wed, 21 Oct 2020 15:33:00 -0500 Subject: [PATCH] Include actual region from event for embedded link Glad to have come across this template. However, for the notification portion of a failed pipeline, the region was hardcoded to us-east-1. Considering the template has Ref calls to the AWS Region, I would assume this is not desired behavior. According to https://docs.amazonaws.cn/en_us/AmazonCloudWatch/latest/events/EventTypes.html#codepipeline_event_type we can grab the region for the pipeline and include it in the embedded url. --- samples/ec2/pipeline.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/ec2/pipeline.yml b/samples/ec2/pipeline.yml index a4d990b..5030687 100644 --- a/samples/ec2/pipeline.yml +++ b/samples/ec2/pipeline.yml @@ -80,9 +80,10 @@ Resources: Ref: "MySNSTopic" Id: "PipelineNotificationTopic" InputTransformer: - InputTemplate: '"The Pipeline has failed. Go to https://console.aws.amazon.com/codepipeline/home?region=us-east-1#/view/" ' + InputTemplate: '"The Pipeline has failed. Go to https://console.aws.amazon.com/codepipeline/home?region=#/view/" ' InputPathsMap: pipeline: "$.detail.pipeline" + region: "$.region" ArtifactBucket: Type: AWS::S3::Bucket DeletionPolicy: Delete