I am using Terraform to provision AWS CodeBuild. In the environment section, I have configured the following:
environment {
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/standard:3.0"
type = "LINUX_CONTAINER"
image_pull_credentials_type = "CODEBUILD"
environment_variable {
name = "SOME_KEY1"
value = "SOME_VALUE1"
}
environment_variable {
name = "SOME_KEY2"
value = "SOME_VALUE2"
}
}
I have more than 20 environment variables to configure in my Codebuild Project.
Is it possible to create a list and define a single environment_variable parameter to configure all environment variables?
dynamicblocks in Terraform 0.12+ to do this if you had a map of environment variables or a list of maps.