Hi there,
I am creating simple param store module something like this:
resource "aws_ssm_parameter" "secret" {
for_each = var.parameters_name_value
name = each.key
description = each.key
type = "SecureString"
value = each.value
tags = {
ManagedBy = "Terraform"
}
}
variable "parameters_name_value" {
description = "Declare parameter name as key, and parameter value as a value"
default = {
"parameter1" = <<EOT
test=2
test=3
EOT
"parameter2" = <<EOT
test=2
test=3
EOT
}
}
Like this the module is working as expected but I don’t have idea how to refactor this code in order to use -var-file=something.tfvars to apply different params and values for different environments.
Do you have any suggestions on how to use tfvars with this configuration instead of default values.
Thank you very much in advance!