The value SECRETS_MANAGER should be a valid value for the type field of an environment_variable for an aws_codebuild_project.
aws_codebuild_projectenvironment_variableresource "aws_codebuild_project" "this" {
name = "my-name"
description = "my description"
service_role = "${var.role_arn}"
build_timeout = "60"
artifacts {
type = "NO_ARTIFACTS"
}
environment {
compute_type = "t3.medium"
image = "${var.image}"
type = "LINUX_CONTAINER"
environment_variable {
name = "SOME_KEY1"
value = "secret:my-secret-key"
type = "SECRETS_MANAGER"
}
}
source {
type = "GITHUB"
location = "${var.source_repository_url}"
}
}
A recent update to codebuild has deprecated the method we were using to pull secrets as environment variables via our build spec. We found a solution was to manually add the environment variables in the aws console and specify the Secrets Manager as their type. Of course with this method, when re running terraform for our codebuild we remove these environment variables and have to re add them manually. This Issue would solve our problem.
Support this has been merged and will release with version 2.62.0 of the Terraform AWS Provider, later this week. 👍
This has been released in version 2.62.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
Support this has been merged and will release with version 2.62.0 of the Terraform AWS Provider, later this week. 👍