Terraform and AWS Provider Version
Terraform v1.15.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v6.43.0
Affected Resource(s) or Data Source(s)
aws_cloudfront_multitenant_distribution
Expected Behavior
If a user removes (or sets to null) the response_completion_timeout for a origin from HCL, after a previous apply set it to a non-null value, the next plan should show the attribute being cleared and the next apply should disable it.
Actual Behavior
Once response_completion_timeout has been written to state, removing it from HCL does nothing. The only way to disable the timeout is to manually do it via the API, outside terraform.
Computed: true causes Terraform to use the value from the AWS API when the config is null, which hides the user's intent to disable the timeout. The CloudFront API does not return ResponseCompletionTimeout in GetDistributionConfig when the field is not in effect, so there is no AWS-side default to "compute".
Relevant Error/Panic Output
n/a
Sample Terraform Configuration
Click to expand configuration
provider "aws" {
region = "us-east-1"
}
data "aws_cloudfront_cache_policy" "caching_optimized" {
name = "Managed-CachingOptimized"
}
resource "aws_cloudfront_multitenant_distribution" "example" {
comment = "example multi-tenant distribution"
enabled = false
origin {
domain_name = "example.com"
id = "example-origin"
custom_origin_config {
http_port = 80
https_port = 443
origin_protocol_policy = "https-only"
origin_ssl_protocols = ["TLSv1.2"]
}
response_completion_timeout = 30 # remove this line on the second plan
}
default_cache_behavior {
target_origin_id = "example-origin"
viewer_protocol_policy = "redirect-to-https"
cache_policy_id = data.aws_cloudfront_cache_policy.caching_optimized.id
allowed_methods {
items = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
cached_methods = ["GET", "HEAD"]
}
}
restrictions {
geo_restriction {
restriction_type = "none"
}
}
tenant_config {}
viewer_certificate {
cloudfront_default_certificate = true
}
tags = {
Name = "example"
}
}
Steps to Reproduce
- Apply the configuration with
response_completion_timeout = 30
- Remove the
response_completion_timeout line (or set the value to null)
- Run
terraform plan
- Observe "No changes" instead of the expected diff that would clear the timeout
Debug Logging
n/a
GenAI / LLM Assisted Development
n/a
Important Facts and References
API Reference: https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_Origin.html#cloudfront-Type-Origin-ResponseCompletionTimeout
Would you like to implement a fix?
Yes
Terraform and AWS Provider Version
Affected Resource(s) or Data Source(s)
aws_cloudfront_multitenant_distributionExpected Behavior
If a user removes (or sets to
null) theresponse_completion_timeoutfor a origin from HCL, after a previous apply set it to a non-null value, the next plan should show the attribute being cleared and the next apply should disable it.Actual Behavior
Once
response_completion_timeouthas been written to state, removing it from HCL does nothing. The only way to disable the timeout is to manually do it via the API, outside terraform.Computed: truecauses Terraform to use the value from the AWS API when the config isnull, which hides the user's intent to disable the timeout. The CloudFront API does not returnResponseCompletionTimeoutinGetDistributionConfigwhen the field is not in effect, so there is no AWS-side default to "compute".Relevant Error/Panic Output
n/a
Sample Terraform Configuration
Click to expand configuration
Steps to Reproduce
response_completion_timeout = 30response_completion_timeoutline (or set the value tonull)terraform planDebug Logging
n/a
GenAI / LLM Assisted Development
n/a
Important Facts and References
API Reference: https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_Origin.html#cloudfront-Type-Origin-ResponseCompletionTimeout
Would you like to implement a fix?
Yes