热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ignore_changesforspecificnestedarguments

Thisissuewasoriginallyopenedbyashashicorp/terraform#17608.Itwasmigratedh

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

1
origin_path

. 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

1
origin

argument and all nested arguments.

Is there a way I can just ignore specifically

1
origin_path

? 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!


   



推荐阅读
author-avatar
yyyyyyyyyyyyy燁
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有