let's assume i have a map like this:
variable "test_parameters" {
type = map
default = {
"A" = "subnet-73e35d3e",
"B" = "subnet-7e00d503",
"C" = "subnet-d9d446b2",
}
}
What is the terraform-code
Many thanks for help ;)
You can store it as json, and then get json back.
resource "aws_ssm_parameter" "foo" {
name = "myparam"
type = "String"
value = jsonencode(var.test_parameters)
}
To read it:
data "aws_ssm_parameter" "foo" {
name = "myparam"
}
# to use
locals {
myparam_values = jsondecode(data.aws_ssm_parameter.foo.value)
}