telia-oss / terraform-aws-static-site

Terraform module for creating a static site using S3 and Cloudfront
MIT License
4 stars 12 forks source link

Support having the site on the root domain of the hosted zone #4

Closed holyjak closed 5 years ago

holyjak commented 5 years ago

I want to create a static site for http://engineering.telia.no . I have a hosted zone for engineering.telia.no but do not control the parent zone (telia.no). This is currently not supported:


  source      = "../../"
  name_prefix = "engineering-site"
  domain_name = "engineering.telia.no"
  host_name = ""
  zone_id     = "<zone id of engineering.telia.no>"
}```

### Desired inputs

Ideally, you would not need the `domain_name` since you know the `zone_id`, it should be possible, I guess, to find that out from the zone info (assuming it is the top-level A record). `host_name` should perhaps default to "", i.e. to creating the site at the root domain. Is "www" still in these days? Or perhaps make `host_name` the complete host name (engineering.telia.no in this case, www.engineering.telia.no in the "common" case) - that way you can compare with the zone info to verify the user got the root domain name right :)
colincoleman commented 5 years ago

I believe that this was addressed in the latest commit and release parameters domain_name and zone_id have been replaced with hosted_zone_name and site_name parameters to enable you to host the site at the top of a hosted zone.

mikael-lindstrom commented 5 years ago

Agreed, closing this issue. @holyjak please reopen if it does not solve your problem 👍