From e99f3fde93a712aeb7c954eb2ed71dc67ae9d81d Mon Sep 17 00:00:00 2001 From: Lohgan Nash Date: Tue, 19 Nov 2019 15:01:56 +1100 Subject: [PATCH] Export service name (#40) * Fix for having multiple links * Fix array insertion * Insert was invalid, push instead: * Add test * Various refactoring & fixes around passing in arrays to taskdef parameters * Add export for servicename * Move output to end of file --- ecs-service.cfndsl.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ecs-service.cfndsl.rb b/ecs-service.cfndsl.rb index 10365a4..b3e357f 100644 --- a/ecs-service.cfndsl.rb +++ b/ecs-service.cfndsl.rb @@ -1,5 +1,7 @@ CloudFormation do + export = defined?(export_name) ? export_name : component_name + awsvpc_enabled = false if defined?(network_mode) && network_mode == 'awsvpc' awsvpc_enabled = true @@ -555,4 +557,9 @@ end + Output("ServiceName") { + Value(FnGetAtt(:Service, :Name)) + Export FnSub("${EnvironmentName}-#{export}-ServiceName") + } + end