resource "aws_ssm_parameter" "foo" {
name = "foo"
type = "String"
value = var.nickname != "" ? var.nickname : var.fullname
}
$ tf apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_ssm_parameter.foo will be created
+ resource "aws_ssm_parameter" "foo" {
+ arn = (known after apply)
+ data_type = (known after apply)
+ id = (known after apply)
+ key_id = (known after apply)
+ name = "foo"
+ tier = "Standard"
+ type = "String"
+ value = (sensitive value)
+ version = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_ssm_parameter.foo: Creating...
aws_ssm_parameter.foo: Creation complete after 4s [id=foo]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
worked for for me with an ssm parameter value:
It woks in a resource section and in a output section but it does not work if try to set an input variable this way.
correct. this is a work around for similar functionality