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

aws_cloudfront_distribution shouldn't require restrictions key #167

Closed
hashibot opened this issue Jun 13, 2017 · 2 comments
Closed

aws_cloudfront_distribution shouldn't require restrictions key #167

hashibot opened this issue Jun 13, 2017 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudfront Issues and PRs that pertain to the cloudfront service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@hashibot
Copy link

This issue was originally opened by @cweagans as hashicorp/terraform#6721. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

v0.6.15

Affected Resource(s)

  • aws_cloudfront_distribution

Terraform Configuration Files

resource "aws_cloudfront_distribution" "sitename_cloudfront" {
  origin {
    domain_name = "${aws_s3_bucket.bucket_id.website_endpoint}"
    origin_id = "${aws_s3_bucket.bucket_id.id}"
  }

  enabled = true
  default_root_object = "index.html"

  aliases = [
    "domain1.com",
    "domain2.com"
  ]

  default_cache_behavior {
    allowed_methods = ["GET", "HEAD", "OPTIONS"]
    cached_methods = ["GET", "HEAD", "OPTIONS"]
    target_origin_id = "${aws_s3_bucket.bucket_id.id}"

    forwarded_values {
      query_string = false
      cookies {
        forward = "none"
      }
    }

    viewer_protocol_policy = "redirect-to-https"
    min_ttl = 0
    default_ttl = 3600
    max_ttl = 86400
  }

  # Use only edge servers in USA and EU.
  price_class = "PriceClass_100"

  viewer_certificate {
    acm_certificate_arn = "[mycert]"
    minimum_protocol_version = "TLSv1"
    ssl_support_method = "sni-only"
  }

}

Expected Behavior

The cloudfront distribution should have been created with no restrictions (geo or otherwise).

Actual Behavior

Errors:

  * aws_cloudfront_distribution.sitename_cloudfront: "restrictions": required field is not set

Important Factoids

If the restrictions key isn't set, perhaps just considering this the default would work:

  restrictions {
    geo_restriction {
      restriction_type = "none"
    }
  }
@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@radeksimko radeksimko added the service/cloudfront Issues and PRs that pertain to the cloudfront service. label Jan 25, 2018
dpmerron-ltd added a commit to dpmerron-ltd/terraform-provider-aws that referenced this issue Feb 14, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed bug Addresses a defect in current functionality. labels Feb 26, 2019
@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Feb 15, 2021
@ghost
Copy link

ghost commented Apr 20, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudfront Issues and PRs that pertain to the cloudfront service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

3 participants