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

s3_origin_config is a required field for aws_cloudfront_distribution #6422

Closed
joshuaspence opened this issue Apr 29, 2016 · 3 comments · Fixed by #6487
Closed

s3_origin_config is a required field for aws_cloudfront_distribution #6422

joshuaspence opened this issue Apr 29, 2016 · 3 comments · Fixed by #6487

Comments

@joshuaspence
Copy link
Contributor

I have the following Terraform configuration:

resource "aws_cloudfront_distribution" "test" {
  origin {
    domain_name = "${aws_s3_bucket.test.bucket}.s3.amazonaws.com"
    origin_id   = "S3"
  }

  enabled = true
  comment = "Managed by Terraform"

  default_cache_behavior {
    allowed_methods  = ["GET", "HEAD"]
    cached_methods   = ["GET", "HEAD"]
    target_origin_id = "S3"

    forwarded_values {
      query_string = false

      cookies {
        forward = "none"
      }
    }

    viewer_protocol_policy = "allow-all"
    min_ttl                = 0
    default_ttl            = 86400
    max_ttl                = 31536000
  }

  price_class = "PriceClass_All"

  restrictions {
    geo_restriction {
      restriction_type = "none"
    }
  }

  viewer_certificate {
    cloudfront_default_certificate = true
  }
}

Running terraform apply returns an error from the AWS API:

* aws_cloudfront_distribution.test: IllegalUpdate: The specified origin server does not exist or is not valid.
    status code: 400, request id: 3dd6a09c-0e2a-11e6-b095-2928ab975404

It seems that in order to fix the error I need to add this:

    s3_origin_config {
      origin_access_identity = ""
    }

This requirement should be documented at the very least.

@joshuaspence joshuaspence changed the title s3_origin_config is a required field s3_origin_config is a required field for aws_cloudfront_distribution Apr 29, 2016
@catsby
Copy link
Contributor

catsby commented May 4, 2016

Hey @joshuaspence – for S3 origins, it seems we "need" an S3 origin config... even if it's empty :/

I've opened #6487 to address this

@catsby
Copy link
Contributor

catsby commented May 5, 2016

Merged #6487

@ghost
Copy link

ghost commented Apr 26, 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 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants