File tree Expand file tree Collapse file tree 4 files changed +36
-7
lines changed Expand file tree Collapse file tree 4 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -284,8 +284,17 @@ cardano-testnet isNg *ARGS:
284284cf STACKNAME :
285285 #!/ usr/ bin/ env nu
286286 mkdir cloudFormation
287+ let secretName = (nix eval --raw ' .#cardano-parts.cluster.infra.generic.costCenter' )
288+ let costCenter = (
289+ just sops-decrypt-binary secrets/ tf/ cluster.tfvars
290+ | lines
291+ | where { |it| $it =~ $secretName }
292+ | parse $" ($secretName) = \" {secret}\" "
293+ | get 0. secret
294+ | to text
295+ )
287296 nix eval --json ' .#cloudFormation.{{ STACKNAME}} ' | from json | save --force ' cloudFormation/{{ STACKNAME}} .json'
288- rain deploy --debug --termination-protection --yes ./ cloudFormation/ {{ STACKNAME}} .json
297+ rain deploy --debug --params costCenter=($costCenter) --termination-protection ./ cloudFormation/ {{ STACKNAME}} .json
289298
290299# Prep dbsync for delegation analysis
291300dbsync-prep ENV HOST ACCTS = " 501":
Original file line number Diff line number Diff line change @@ -12,23 +12,45 @@ with lib; {
1212 Key = n ;
1313 Value = v ;
1414 } ) {
15- inherit ( config . flake . cardano-parts . cluster . infra . generic ) organization tribe function repo ;
16- environment = "generic" ;
15+ inherit
16+ ( config . flake . cardano-parts . cluster . infra . generic )
17+ environment
18+ function
19+ organization
20+ owner
21+ project
22+ repo
23+ tribe
24+ ;
1725 } )
1826 ++ [
1927 {
2028 Key = "Name" ;
2129 Value = name ;
2230 }
31+ {
32+ Key = "costCenter" ;
33+ Value = {
34+ Ref = "costCenter" ;
35+ } ;
36+ }
2337 ] ;
2438 in {
2539 AWSTemplateFormatVersion = "2010-09-09" ;
2640 Description = "Terraform state handling" ;
2741
42+ # The costCenter parameter will be passed to the configuration via a secrets file.
43+ # For details, see the just recipe: cf
44+ Parameters = {
45+ costCenter = {
46+ Type = "String" ;
47+ Description = "The costCenter tag" ;
48+ } ;
49+ } ;
50+
2851 # Resources here will be created in the AWS_REGION and AWS_PROFILE from your
2952 # environment variables.
3053 # Execute this using: `just cf terraformState`
31-
3254 Resources = {
3355 kmsKey = {
3456 Type = "AWS::KMS::Key" ;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ with flake.lib; {
3838 environment = "testnets" ;
3939 project = "cardano-playground" ;
4040
41- # This is the tf var secrets name
41+ # This is the tf var secrets name located in secrets/tf/cluster.tfvars
4242 costCenter = "tag_costCenter" ;
4343
4444 # These options must remain true for the playground cluster as ip info is required
Original file line number Diff line number Diff line change 77} : let
88 inherit ( config . flake ) nixosModules nixosConfigurations ;
99 inherit ( config . flake . cardano-parts . cluster . infra . aws ) domain ;
10-
11- cfgGeneric = config . flake . cardano-parts . cluster . infra . generic ;
1210in
1311 with builtins ;
1412 with lib ; {
You can’t perform that action at this time.
0 commit comments