From f53b29f4c7fb38aec48858d5dce38227f6cfe075 Mon Sep 17 00:00:00 2001 From: Aaron Walker Date: Thu, 5 Mar 2020 18:36:55 +0100 Subject: [PATCH] pass DnsDomain into sub component --- fargate-v2.cfhighlander.rb | 4 +++- spec/simple_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fargate-v2.cfhighlander.rb b/fargate-v2.cfhighlander.rb index 6c6b8f7..61d229c 100644 --- a/fargate-v2.cfhighlander.rb +++ b/fargate-v2.cfhighlander.rb @@ -26,6 +26,8 @@ end #Pass the all the config from the parent component to the inlined component - Component template: 'ecs-task@secrets', name: "#{component_name.gsub('-','').gsub('_','')}Task", render: Inline, config: @config + Component template: 'ecs-task@secrets', name: "#{component_name.gsub('-','').gsub('_','')}Task", render: Inline, config: @config do + parameter name: 'DnsDomain', value: Ref('DnsDomain') + end end \ No newline at end of file diff --git a/spec/simple_spec.rb b/spec/simple_spec.rb index 9c55b8e..331f896 100644 --- a/spec/simple_spec.rb +++ b/spec/simple_spec.rb @@ -47,7 +47,7 @@ it 'has property Tags' do expect(properties["Tags"]).to eq([ - {"Key"=>"Name", "Value"=>"fargatev2"}, + {"Key"=>"Name", "Value"=>"fargatev2Task"}, {"Key"=>"Environment", "Value"=>{"Ref"=>"EnvironmentName"}}, {"Key"=>"EnvironmentType", "Value"=>{"Ref"=>"EnvironmentType"}}]) end @@ -196,7 +196,7 @@ it 'has component_name as part of the export' do expect(outputs['EcsTaskArn']).to eq({ - "Export"=>{"Name"=>{"Fn::Sub"=>"${EnvironmentName}-fargatev2-EcsTaskArn"}}, + "Export"=>{"Name"=>{"Fn::Sub"=>"${EnvironmentName}-fargatev2Task-EcsTaskArn"}}, "Value"=>{"Ref"=>"Task"} }) end