作者:yyyyyyyyyyyyy燁 | 来源:互联网 | 2023-08-19 11:46
This issue was originally opened by as hashicorp/terraform#17608. It was migrated here as a result of the provider split. The original body of the issue is below.
I have a cloudfront distribution configuration like so:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| tf
resource "aws_cloudfront_distribution" "CodesTable" {
origin {
domain_name = "${var.builds_bucket}"
origin_id = "s3-builds-bucket"
origin_path = "/ss-codes/1374"
custom_origin_config {
http_port = 80
https_port = 443
origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
origin_protocol_policy = "http-only"
}
}
enabled = true
is_ipv6_enabled = true
default_root_object = "index.html"
default_cache_behavior {
allowed_methods = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
target_origin_id = "s3-builds-bucket"
cached_methods = ["GET", "HEAD"]
forwarded_values {
query_string = false
COOKIEs {
forward = "none"
}
}
viewer_protocol_policy = "allow-all"
}
price_class = "PriceClass_100"
restrictions {
geo_restriction {
restriction_type = "none"
}
}
lifecycle {
ignore_changes = ["origin.0.origin_path"]
}
} |
I'm trying to just ignore changes to the first/only origin's
. However
1
| ignore_changes = ["origin.0.origin_path"] |
does not work, and terraform still retains control of this argument. I am successfully able to set
1
| ignore_changes = ["origin"] |
, however this ignores the whole of the
argument and all nested arguments.
Is there a way I can just ignore specifically
? I've looked at these issues:
- https://github.com/terraform-providers/terraform-provider-vsphere/issues/290
- https://github.com/hashicorp/terraform/issues/5666
But haven't been able to find a solution that works.
I am running terraform_0.11.3_linux_amd64.
该提问来源于开源项目:terraform-providers/terraform-provider-aws
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!