Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_changes for specific nested arguments #17608

Closed
danhart opened this issue Mar 16, 2018 · 2 comments
Closed

ignore_changes for specific nested arguments #17608

danhart opened this issue Mar 16, 2018 · 2 comments

Comments

@danhart
Copy link

danhart commented Mar 16, 2018

I have a cloudfront distribution configuration like so:

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 origin_path. However ignore_changes = ["origin.0.origin_path"] does not work, and terraform still retains control of this argument. I am successfully able to set ignore_changes = ["origin"], however this ignores the whole of the origin argument and all nested arguments.

Is there a way I can just ignore specifically origin_path? I've looked at these issues:

But haven't been able to find a solution that works.

I am running terraform_0.11.3_linux_amd64.

@ghost
Copy link

ghost commented Mar 16, 2018

This issue has been automatically migrated to hashicorp/terraform-provider-aws#3819 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#3819.

@ghost
Copy link

ghost commented Apr 4, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants