Closed jrobison-sb closed 10 months ago
Voting for Prioritization
Volunteering to Work on This Issue
My workaround until this gets fixed is to just ignore_changes
on this attribute:
lifecycle {
ignore_changes = [
queued_timeout # https://github.com/hashicorp/terraform-provider-aws/issues/34376
]
}
I did some testing in the AWS Console and see that if you set Compute to Lambda, you don't see the Queued timeout option. I included two screenshots below for illustration.
Subsequently, I looked at what's returned by the AWS API in the TF debug log, and I can see that the queuedTimeoutInMinutes
attribute is simply absent. The Terraform code in turn converts the missing attribute value to 0 during type conversion, resulting in a 0 being stored in the final TF state.
TBH I am not sure how to best interpret the AWS Project data type contract. queuedTimeoutInMinutes
is not required, but it has a valid value range of 5 - 480. Either way, this is not documented very well on AWS' part.
I'd need someone more experienced to comment on how to best handle this in the provider code. Knowing the observed behavior on queuedTimeoutInMinutes
being absent, should we assume that this value should be set to nil
(and allow nil
value) when the runtime is Lambda?
2023-11-13T23:31:06.829-0500 [DEBUG] provider.terraform-provider-aws: HTTP Response Received: aws.region=us-west-2 http.response.header.x_amzn_requestid=439541b3-81ea-49e4-a6c0-173cebd0269c tf_req_id=ab769b1d-cc20-37c3-8bcc-68f4e4edfe82 tf_resource_type=aws_codebuild_project http.status_code=200 rpc.service=CodeBuild rpc.system=aws-api tf_rpc=ApplyResourceChange http.duration=449 http.response.body="{"project":{"arn":"arn:aws:codebuild:us-west-2:xxxxxxxxxxxx:project/DEV-2865-terraform-aws-codebuild-project","artifacts":{"overrideArtifactName":false,"type":"NO_ARTIFACTS"},"badge":{"badgeEnabled":false},"cache":{"type":"NO_CACHE"},"created":1.699936084006E9,"description":"DEV-2865-terraform-aws-codebuild-project","encryptionKey":"arn:aws:kms:us-west-2:xxxxxxxxxxxx:alias/aws/s3","environment":{"computeType":"BUILD_LAMBDA_1GB","environmentVariables":[],"image":"aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.11","imagePullCredentialsType":"CODEBUILD","privilegedMode":false,"type":"ARM_LAMBDA_CONTAINER"},"lastModified":1.699936212497E9,"logsConfig":{"cloudWatchLogs":{"status":"ENABLED"},"s3Logs":{"encryptionDisabled":false,"status":"DISABLED"}},"name":"DEV-2865-terraform-aws-codebuild-project","projectVisibility":"PRIVATE","serviceRole":"arn:aws:iam::xxxxxxxxxxxx:role/service-role/codebuild-test-service-role","source":{"buildspec":"\"env\":\n \"shell\": \"bash\"\n\"phases\":\n \"post_build\":\n \"commands\":\n - \"echo hello\"\n\"version\": \"0.2\"\n","gitCloneDepth":0,"insecureSsl":false,"type":"NO_SOURCE"},"tags":[{"key":"Name","value":"DEV-2865-terraform-aws-codebuild-project"}],"timeoutInMinutes":15},"webhookDeletedStatus":"no_webhook"}
with provider 5.26.0 we receive the following Error message when trying to apply with a Lambda compute platform
creating CodeBuild project: InvalidInputException: Cannot specify queuedTimeoutInMinutes for lambda compute
relevant part of the plan:
+ resource "aws_codebuild_project" "this" {
+ arn = (known after apply)
+ badge_enabled = false
+ badge_url = (known after apply)
+ build_timeout = 60
+ description = (known after apply)
+ encryption_key = (known after apply)
+ id = (known after apply)
+ name = "test"
+ project_visibility = "PRIVATE"
+ public_project_alias = (known after apply)
+ queued_timeout = 5
+ service_role = "redacted"
+ artifacts {
+ encryption_disabled = false
+ override_artifact_name = false
+ type = "CODEPIPELINE"
}
+ environment {
+ compute_type = "BUILD_LAMBDA_1GB"
+ image = "aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.11"
+ image_pull_credentials_type = "CODEBUILD"
+ privileged_mode = false
+ type = "ARM_LAMBDA_CONTAINER"
This functionality has been released in v5.32.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. Thank you!
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Core Version
1.6.1
AWS Provider Version
5.25.0
Affected Resource(s)
Expected Behavior
The
queued_timeout
attribute should never become set to an unsupported value, even when using Lambda as the underlying compute.Actual Behavior
The
queued_timeout
attribute does become set to an unsupported value, when using Lambda as the underlying compute.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
See the
Steps to Reproduce
section.Steps to Reproduce
queued_timeout
, like this:terraform apply
to apply the above resource. This will apply successfully.terraform plan
and see that there are no outstanding diffs.terraform apply
to lock in the above change. This will apply successfully.Run
terraform plan
and see that it now reports a diff onqueued_timeout
, which isn't even set in the HCL:Plan: 0 to add, 1 to change, 0 to destroy.
Error: expected queued_timeout to be in the range (5 - 480), got 0