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

Allow for default cloudfront TTLs #1472

Closed
icco opened this issue Aug 22, 2017 · 5 comments · Fixed by #3571
Closed

Allow for default cloudfront TTLs #1472

icco opened this issue Aug 22, 2017 · 5 comments · Fixed by #3571
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Milestone

Comments

@icco
Copy link

icco commented Aug 22, 2017

Terraform Version

Terraform v0.10.2

Affected Resource(s)

  • cloudfront_distrobution

Terraform Configuration Files

resource "aws_cloudfront_distribution" "test" {
  origin {
    domain_name = "https://google.com"
    origin_id   = "google"
  }

  enabled         = true
  is_ipv6_enabled = true

  aliases = ["mysite.example.com", "yoursite.example.com"]

  default_cache_behavior {
    allowed_methods  = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
    cached_methods   = ["GET", "HEAD"]
    target_origin_id = "google"

    forwarded_values {
      query_string = false

      cookies {
        forward = "none"
      }
    }

    viewer_protocol_policy = "allow-all"
  }

  viewer_certificate {
    cloudfront_default_certificate = true
  }

  restrictions {
    geo_restriction {
      restriction_type = "none"
    }
  }
}

Expected Behavior

terraform validate returns nothing.

Actual Behavior

$ terraform validate
There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  * aws_cloudfront_distribution.test: "default_cache_behavior.0.default_ttl": required field is not set
  * aws_cloudfront_distribution.test: "default_cache_behavior.0.max_ttl": required field is not set
  * aws_cloudfront_distribution.test: "default_cache_behavior.0.min_ttl": required field is not set

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform validate

Important Factoids

This is more of a feature request, but cloudfront seems to not require these values anymore.

References

@radeksimko radeksimko added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 23, 2017
@radeksimko radeksimko added the service/cloudfront Issues and PRs that pertain to the cloudfront service. label Jan 28, 2018
@bflad
Copy link
Member

bflad commented Feb 28, 2018

For cross-reference this is the same request as #1994

@bflad
Copy link
Member

bflad commented Feb 28, 2018

A pull request to make these attributes optional can be found here: #3571

@bflad bflad added this to the v1.11.0 milestone Mar 6, 2018
@bflad
Copy link
Member

bflad commented Mar 6, 2018

Support to make all 3 TTL arguments optional has been merged into master and will be released in v1.11.0 of the AWS provider, likely at the end of the week. Please note they are default_ttl (1 day), max_ttl (365 days), and min_ttl (0 days) to match the behavior of the API and console.

@bflad
Copy link
Member

bflad commented Mar 9, 2018

This has been released in version 1.11.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 7, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
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.
Projects
None yet
3 participants