From 3fc9475d9d7ab5045547c99bc94c8adb0f8e8303 Mon Sep 17 00:00:00 2001 From: Vivek Shankar Date: Tue, 28 Jan 2025 18:03:19 +0530 Subject: [PATCH 1/2] added tags for provisioned instances Signed-off-by: Vivek Shankar --- components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go b/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go index baa66c59e0a..b400f018f42 100644 --- a/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go +++ b/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go @@ -303,7 +303,7 @@ aws do {{ if .Aws.Config.XCustomer }} customer "{{ .Aws.Config.XCustomer }}" {{ else }} customer "{{ .Aws.Config.XCustomer }}" {{ end }} ### DEPRECATED: AWS Tag: Production flag - set true for production environment {{ if .Aws.Config.XProduction }} production "{{ .Aws.Config.XProduction }}" {{ else }} production "{{ .Aws.Config.XProduction }}" {{ end }} - tags({"X-Contact"=>"{{ .Aws.Config.XContact }}", "X-Dept"=>"{{ .Aws.Config.XDept }}", "X-Project"=>"{{ .Aws.Config.XProject }}", "X-Customer"=>"{{ .Aws.Config.XCustomer }}", "X-Production"=>"{{ .Aws.Config.XProduction }}"}) + tags({"X-Contact"=>"{{ .Aws.Config.XContact }}", "X-Dept"=>"{{ .Aws.Config.XDept }}", "X-Project"=>"{{ .Aws.Config.XProject }}", "X-Customer"=>"{{ .Aws.Config.XCustomer }}", "X-Production"=>"{{ .Aws.Config.XProduction }}", "ephemeral"=>"{{ .Aws.Config.XEphemeral }}", "team"=>"{{ .Aws.Config.XTeam }}", "owner"=>"{{ .Aws.Config.XOwner }}", "application"=>"{{ .Aws.Config.XApplication }}", "solutions"=>"{{ .Aws.Config.XSolutions }}, "expiration"=>"{{ .Aws.Config.XExpiration }}"}) ### DEPRECATED: Below tags are used for CHEF AWS infrastructure tagging {{ if .Aws.Config.XEphemeral }} ephemeral "{{ .Aws.Config.XEphemeral }}" {{ else }} # ephemeral "{{ .Aws.Config.XEphemeral }}" {{ end }} From 077cdccf48d889ad296b2ddcfa8520d08d92caee Mon Sep 17 00:00:00 2001 From: Vivek Shankar Date: Wed, 29 Jan 2025 16:24:17 +0530 Subject: [PATCH 2/2] remove tags not needed Signed-off-by: Vivek Shankar --- .../automate-cli/cmd/chef-automate/genA2haRbTmpl.go | 11 +---------- components/automate-cluster-ctl/lib/cluster/config.rb | 9 +-------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go b/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go index b400f018f42..91a20547aef 100644 --- a/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go +++ b/components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go @@ -303,15 +303,6 @@ aws do {{ if .Aws.Config.XCustomer }} customer "{{ .Aws.Config.XCustomer }}" {{ else }} customer "{{ .Aws.Config.XCustomer }}" {{ end }} ### DEPRECATED: AWS Tag: Production flag - set true for production environment {{ if .Aws.Config.XProduction }} production "{{ .Aws.Config.XProduction }}" {{ else }} production "{{ .Aws.Config.XProduction }}" {{ end }} - tags({"X-Contact"=>"{{ .Aws.Config.XContact }}", "X-Dept"=>"{{ .Aws.Config.XDept }}", "X-Project"=>"{{ .Aws.Config.XProject }}", "X-Customer"=>"{{ .Aws.Config.XCustomer }}", "X-Production"=>"{{ .Aws.Config.XProduction }}", "ephemeral"=>"{{ .Aws.Config.XEphemeral }}", "team"=>"{{ .Aws.Config.XTeam }}", "owner"=>"{{ .Aws.Config.XOwner }}", "application"=>"{{ .Aws.Config.XApplication }}", "solutions"=>"{{ .Aws.Config.XSolutions }}, "expiration"=>"{{ .Aws.Config.XExpiration }}"}) - - ### DEPRECATED: Below tags are used for CHEF AWS infrastructure tagging - {{ if .Aws.Config.XEphemeral }} ephemeral "{{ .Aws.Config.XEphemeral }}" {{ else }} # ephemeral "{{ .Aws.Config.XEphemeral }}" {{ end }} - {{ if .Aws.Config.XTeam }} team "{{ .Aws.Config.XTeam }}" {{ else }} # team "{{ .Aws.Config.XTeam }}" {{ end }} - {{ if .Aws.Config.XOwner }} owner "{{ .Aws.Config.XOwner }}" {{ else }} # owner "{{ .Aws.Config.XOwner }}" {{ end }} - {{ if .Aws.Config.XApplication }} application "{{ .Aws.Config.XApplication }}" {{ else }} # application "{{ .Aws.Config.XApplication }}" {{ end }} - {{ if .Aws.Config.XSolutions }} solutions "{{ .Aws.Config.XSolutions }}" {{ else }} # solutions "{{ .Aws.Config.XSolutions }}" {{ end }} - {{ if .Aws.Config.XName }} Name "{{ .Aws.Config.XName }}" {{ else }} # Name "{{ .Aws.Config.XName }}" {{ end }} - {{ if .Aws.Config.XExpiration }} expiration "{{ .Aws.Config.XExpiration }}" {{ else }} # expiration "{{ .Aws.Config.XExpiration }}" {{ end }} + tags({"X-Contact"=>"{{ .Aws.Config.XContact }}", "X-Dept"=>"{{ .Aws.Config.XDept }}", "X-Project"=>"{{ .Aws.Config.XProject }}", "X-Customer"=>"{{ .Aws.Config.XCustomer }}", "X-Production"=>"{{ .Aws.Config.XProduction }}", "ephemeral"=>"{{ .Aws.Config.XEphemeral }}", "team"=>"{{ .Aws.Config.XTeam }}", "owner"=>"{{ .Aws.Config.XOwner }}", "application"=>"{{ .Aws.Config.XApplication }}", "solutions"=>"{{ .Aws.Config.XSolutions }}", "expiration"=>"{{ .Aws.Config.XExpiration }}"}) end ` diff --git a/components/automate-cluster-ctl/lib/cluster/config.rb b/components/automate-cluster-ctl/lib/cluster/config.rb index 7e412a1de1b..4e8df015b9e 100644 --- a/components/automate-cluster-ctl/lib/cluster/config.rb +++ b/components/automate-cluster-ctl/lib/cluster/config.rb @@ -210,14 +210,7 @@ def self.restore_deploy_symlink(path) { "X-Contact" => configuration[:contact], "X-Dept" => configuration[:dept], - "X-Project" => configuration[:project], - "ephemeral" => configuration[:ephemeral], - "team" => configuration[:team], - "owner" => configuration[:owner], - "application" => configuration[:application], - "solutions" => configuration[:solutions], - "Name" => configuration[:Name], - "expiration" => configuration[:expiration], + "X-Project" => configuration[:project] } end end