Update hcl2upgrade command to update env calls + tests (#10244)
This commit is contained in:
parent
1a08bf8ce9
commit
f44e912072
|
@ -322,7 +322,7 @@ func transposeTemplatingCalls(s []byte) []byte {
|
|||
return fmt.Sprintf("${var.%s}", in)
|
||||
},
|
||||
"env": func(in string) string {
|
||||
return fmt.Sprintf("${var.%s}", in)
|
||||
return fmt.Sprintf("${env(%q)}", in)
|
||||
},
|
||||
"build": func(a string) string {
|
||||
return fmt.Sprintf("${build.%s}", a)
|
||||
|
|
|
@ -30,6 +30,11 @@ variable "aws_region" {
|
|||
type = string
|
||||
}
|
||||
|
||||
variable "aws_secondary_region" {
|
||||
type = string
|
||||
default = "${env("AWS_DEFAULT_REGION")}"
|
||||
}
|
||||
|
||||
variable "aws_secret_key" {
|
||||
type = string
|
||||
default = ""
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"variables": {
|
||||
"secret_account": "🤷",
|
||||
"aws_region": null,
|
||||
"aws_secondary_region": "{{ env `AWS_DEFAULT_REGION` }}",
|
||||
"aws_secret_key": "",
|
||||
"aws_access_key": ""
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue