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

how to support multiple parent zones #14

Open
rajcheval opened this issue Jul 20, 2018 · 3 comments
Open

how to support multiple parent zones #14

rajcheval opened this issue Jul 20, 2018 · 3 comments
Labels
help wanted Extra attention is needed question

Comments

@rajcheval
Copy link
Contributor

We are hosting 5 different sites in AWS.
All of them are behind the same ALB.
We want to put CDN in front of all these sites.

When I was creating CDN using your module I specified aliases for all the sites.
aliases = ["int.site1.com","intblog.site2.com","intcksup.site3.com"]

parent_zone = "site1.com"

I noticed that it created DNS records for each of the aliases in one parent domain.
I am trying to figure out a way to create DNS records for site2.com and site3.com parent zones.
Only thing I can come up with is to use Terraform aws_route53_record to create DNS records for site2.com and site3.com. Even if I do this this module will create dns records all three aliases in parent zone for site1.

Is there a way to prevent this module from creating any DNS records for sites specified in aliases?
I am ok if it only creates CDN and expects us to create all the DNS records on our own.

It does not make sense for it to create DNS records like:
intblog.site2.com.site1.com
intcksup.site3.com.site1.com

Thanks

@osterman
Copy link
Member

@rajcheval I see a couple ways we could solve this.

  1. Add an enabled flag to https://github.com/cloudposse/terraform-aws-route53-alias/, and then expose that flag (e.g. dns_aliases_enabled) in this module. Then you could setup the DNS aliases outside of this module how ever you want.
  2. Invoke this module once for every parent zone. Basically, create a distribution for each site. This requires no code changes in our modules.

@rajcheval
Copy link
Contributor Author

@osterman I like option 1 better. Since creating DNS records is tightly coupled with Cloud Front distribution creation it will cause an outage in an existing site. This is because cloudfront creation takes 15-20 minutes. I tested created CDN using just 1 alias. It was in our test environment. My site went down because a DNS record was created. Once CDN was fully enabled site came back up.

Let me know if you agree or if I am missing anything.

As long as there is no additional cost for creating many different distributions instead of 1 I would have been fine with separate distribution for each domain as long as there was no outage.

@osterman
Copy link
Member

@rajcheval You're right about how provisioning one will cause the outage with option (2).

If you want to submit a PR to add the enabled flags to the respective modules, we'll accept them!

Also, feel free to join our slack team to reach out to us directly: https://slack.cloudposse.com

@osterman osterman added the help wanted Extra attention is needed label Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question
Projects
None yet
Development

No branches or pull requests

2 participants