Skip to content

Prevent tg from inheriting tags from previous tgs #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions fargate-v2.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@

targetgroups.each do |targetgroup|
if targetgroup.has_key?('rules')

attributes = []

targetgroup['attributes'].each do |key,value|
attributes << { Key: key, Value: value }
end if targetgroup.has_key?('attributes')

tg_tags = Marshal.load(Marshal.dump(fargate_tags))
targetgroup['tags'].each do |key,value|
fargate_tags << { Key: key, Value: value }
end if targetgroup.has_key?('tags')
tg_tags << { Key: key, Value: value }
end if

ElasticLoadBalancingV2_TargetGroup(targetgroup['resource_name']) do
## Required
Expand All @@ -101,7 +101,7 @@
TargetType targetgroup['type'] if targetgroup.has_key?('type')
TargetGroupAttributes attributes if attributes.any?

Tags fargate_tags if fargate_tags.any?
Tags tg_tags
end

targetgroup['rules'].each_with_index do |rule, index|
Expand Down Expand Up @@ -230,7 +230,7 @@
TaskDefinition "Ref" => "Task" #Hack to work referencing child component resource
HealthCheckGracePeriodSeconds health_check_grace_period unless health_check_grace_period.nil?
LaunchType "FARGATE"
Tags fargate_tags if fargate_tags.any?
Tags fargate_tags
PropagateTags 'SERVICE'

if service_loadbalancer.any?
Expand Down Expand Up @@ -259,4 +259,4 @@



end
end
Loading