Is there any way to convert a string into a map object?
I am setting up an was_elastic_beanstalk_environment in a module and I would like to be able to pass environment variables into the module to be applied to the environment. I can't find any way to add multiple setting values from variables in the module.
Ideally, I would like to be able to do this:
In the module:
resource "aws_elastic_beanstalk_environment" "myEnv"{
<....SNIP....>
setting {
namespace = "aws:elasticbeanstalk:environment"
name = "EnvironmentType"
value = "SingleInstance"
}
setting = ["${var.envSetting}"]
}
variable "envSettings"{ }
In the calling code:
module "myMod" {
envSetting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "FOO"
value = "theVal"
}
envSetting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "BAR"
value = "anotherVal"
}
Obviously that isn't supported. I've tried to find a way to create multiple setting variables from a single string, or to create an array of maps from a string that would be accepted by the setting variable, and have not had any luck. Anyone have an idea on how to make this work?