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
The user explicitly set values for one of these origin attributes:
connection_attempts
connection_timeout
custom_origin_config.origin_keepalive_timeout
custom_origin_config.origin_read_timeout
and the provider preserves that value across applies, without generating a diff on each plan.
Actual Behavior
The user explicitly set values for one of these origin attributes:
connection_attempts
connection_timeout
custom_origin_config.origin_keepalive_timeout
custom_origin_config.origin_read_timeout
and running a plan after each apply shows a "flip-flopping" configuration between the schema-level default value and the user-set value.
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"]
origin_read_timeout = 120 # any non-default value (30)
}
}
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 any non-default value for one of the origin attributes that has schema-level defaults
- Run a new plan/apply
- Observe the perpetual plan diff after every apply
Debug Logging
n/a
GenAI / LLM Assisted Development
n/a
Important Facts and References
This is likely related to:
and the bug was introduced for this resource when origin blocks were (rightfully) converted from List to Set.
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
The user explicitly set values for one of these
originattributes:connection_attemptsconnection_timeoutcustom_origin_config.origin_keepalive_timeoutcustom_origin_config.origin_read_timeoutand the provider preserves that value across applies, without generating a diff on each plan.
Actual Behavior
The user explicitly set values for one of these
originattributes:connection_attemptsconnection_timeoutcustom_origin_config.origin_keepalive_timeoutcustom_origin_config.origin_read_timeoutand running a plan after each apply shows a "flip-flopping" configuration between the schema-level default value and the user-set value.
Relevant Error/Panic Output
n/a
Sample Terraform Configuration
Click to expand configuration
Steps to Reproduce
Debug Logging
n/a
GenAI / LLM Assisted Development
n/a
Important Facts and References
This is likely related to:
and the bug was introduced for this resource when
originblocks were (rightfully) converted from List to Set.Would you like to implement a fix?
Yes