Skip to content

Commit

Permalink
add chef aws tags (#8750)
Browse files Browse the repository at this point in the history
* add chef aws tags

Signed-off-by: Vivek Shankar <[email protected]>

* cluster ctl deps add in automate deploymnt

Signed-off-by: Vivek Shankar <[email protected]>

---------

Signed-off-by: Vivek Shankar <[email protected]>
  • Loading branch information
vivekshankar1 authored Jan 23, 2025
1 parent 13c4546 commit 3d63d89
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/automate-backend-deployment/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pkg_deps=(
core/rsync/3.2.3/20240107034222
core/terraform1/1.5.7/20240106055300
core/busybox-static/1.34.1/20240105230035
chef/automate-ha-cluster-ctl/0.1.0/20250109090656
chef/automate-ha-cluster-ctl
)
#core/aws-cli ( core/aws-cli/1.21.11/20231020110846 core/aws-cli/1.21.11/20220817123642 )
# core/openssl11 ( core/openssl11/1.1.1w/20231020105352 core/openssl11/1.1.1k/20220311131131 )
Expand Down
9 changes: 9 additions & 0 deletions components/automate-cli/cmd/chef-automate/genA2haRbTmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,14 @@ aws do
### 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 }}"})
### 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 }}
end
`
7 changes: 7 additions & 0 deletions components/automate-cli/cmd/chef-automate/initConfigHa.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ type ConfigToml struct {
XProject string `toml:"X-Project"`
XProduction string `toml:"X-Production"`
XCustomer string `toml:"X-Customer"`
XEphemeral string `toml:"ephemeral"`
XTeam string `toml:"team"`
XOwner string `toml:"owner"`
XApplication string `toml:"application"`
XSolutions string `toml:"solutions"`
XName string `toml:"Name"`
XExpiration string `toml:"expiration"`
AwsAutomateRoute53Prefix string `toml:"aws_automate_route53_prefix"`
AwsChefServerRoute53Prefix string `toml:"aws_chef_server_route53_prefix"`
AwsRoute53HostedZone string `toml:"aws_route53_hosted_zone"`
Expand Down
9 changes: 8 additions & 1 deletion components/automate-cluster-ctl/lib/cluster/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,14 @@ def self.restore_deploy_symlink(path)
{
"X-Contact" => configuration[:contact],
"X-Dept" => configuration[:dept],
"X-Project" => configuration[:project]
"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],
}
end
end
Expand Down

0 comments on commit 3d63d89

Please sign in to comment.