When using the built-in yamlencode function to provide the YAML document for the CodeBuild project buildspec, updating the content of this document in the configuration should update the buildspec in AWS after a standard plan & apply.
Actual Behavior
The YAML document for the buildspec in AWS is not updated after a standard plan & apply.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
variable codebuild-service-role-arn {
type = string
}
variable codeartifact-repository {
type = string
}
variable codeartifact-domain {
type = string
}
variable codeartifact-domain-owner {
type = string
}
variable codebuild-environment-image-uri {
type = string
}
resource aws_codebuild_project _ {
name = "..."
service_role = var.codebuild-service-role-arn
source {
buildspec = yamlencode({
version = "0.2"
phases = {
build = {
commands = [
"command1",
"command2"
]
}
}
})
type = "BITBUCKET"
location = "..."
}
environment {
compute_type = "BUILD_GENERAL1_SMALL"
image = var.codebuild-environment-image-uri
image_pull_credentials_type = "SERVICE_ROLE"
type = "LINUX_CONTAINER"
}
artifacts {
type = "NO_ARTIFACTS"
}
}
Steps to Reproduce
Replace the redacted content of the configuration file above with usable values
Create the resource with a standard plan & apply
Change the commands field of the buildspec, perhaps adding or removing commands but any change here will suffice.
Run another standard plan & apply
Observe that the YAML document in AWS remains unchanged for this resource
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.9.7
AWS Provider Version
5.72.0
Affected Resource(s)
aws_codebuild_project
Expected Behavior
When using the built-in
yamlencode
function to provide the YAML document for the CodeBuild project buildspec, updating the content of this document in the configuration should update the buildspec in AWS after a standard plan & apply.Actual Behavior
The YAML document for the buildspec in AWS is not updated after a standard plan & apply.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
commands
field of the buildspec, perhaps adding or removing commands but any change here will suffice.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None