Terraform-provider-aws: aws_cloudfront_distribution shows changes to origin block on every plan

Created on 16 Oct 2019  路  2Comments  路  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.10

  • provider.archive v1.3.0
  • provider.aws v2.32.0

Affected Resource(s)

  • aws_cloudfront_distribution

Terraform Configuration Files

resource "aws_cloudfront_distribution" "assets_distribution" {
  origin {
    domain_name = "${var.bucket_domain_name}"
    origin_path = "${var.bucket_path}"
    origin_id = "${var.domain_names[0]}-origin"
    s3_origin_config {
      origin_access_identity = "${var.origin_access_identity}"
    }
  }
...

Expected Behavior

After apply, there should not be a change on subsequent plans.

Actual Behavior

On every subsequent run, the plan shows:

      + origin {
          + domain_name = "XXXXX.s3.amazonaws.com"
          + origin_id   = "YYYYY-origin"

          + s3_origin_config {}
        }
      - origin {
          - domain_name = "XXXXX.s3.amazonaws.com" -> null
          - origin_id   = "YYYYY-origin" -> null
        }

It appears that the s3 origin access identity is still set correctly, even though it is not listed in the plan.

Steps to Reproduce

  1. terraform plan
  2. terraform apply
needs-triage serviccloudfront

Most helpful comment

I'm getting this too. It's actually making the change, too, it's not just a NO-OP

We recently went from 0.11 to 0.12, and thats when it started happening. Highly frustrating.

All 2 comments

I'm getting this too. It's actually making the change, too, it's not just a NO-OP

We recently went from 0.11 to 0.12, and thats when it started happening. Highly frustrating.

Confirmed this happens with 0.12.13 and 2.33.0. Tried ordering the origins the same as they are in the console - nope.

Was this page helpful?
0 / 5 - 0 ratings