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

feat: Allow validating the certificate with CloudFlare #97

Conversation

simonweil
Copy link

@simonweil simonweil commented Dec 9, 2021

Description

Added support for validating the domain with CloudFlare in addition to route53

Motivation and Context

We use CloudFlare as DNS and the automatic validation is not currently supported

Breaking Changes

None

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

Will be filled if the change is acceptable by the maintainer

@simonweil
Copy link
Author

simonweil commented Dec 9, 2021

Hi @antonbabenko
Would you accept such a change to support other DNS providers, in my case CloudFlare?

I know the change is still not ready for merge, the following will be completed assuming the direction is acceptable:

  • Add backwards compatibility for DNS as validation method
  • Fix variable validation to accept all allowed values
  • Add required tests

If you will not accept I'll keep my fork and use it for my needs, but I assume there are more consumers for other DNS providers.

@antonbabenko
Copy link
Member

Hi @simonweil !

Thanks for opening this PR and asking before finalizing it.

We should not make this module dependant on the Cloudflare provider (it is not possible to include the provider conditionally in Terraform).

Instead, I propose to make changes in the PR to:

  1. Revert to use DNS validation method as before (backward compatibility is important here).
  2. Add another variable for create_route53_records with default = true.
  3. Add another variable for validation_record_fqdns which will have to be set by Cloudflare users.
  4. Show in a separate example external DNS records management:
  • Cloudflare and Route53 (sometimes people want to manage records outside of this module): call module "acm" and resource "cloudflare_record" "validation" together, for eg.
  1. Update README pointing to a new example.

@simonweil
Copy link
Author

OK, will try it and update

@simonweil
Copy link
Author

@antonbabenko This actually seems to work!

@simonweil
Copy link
Author

Added the example and link from the README.md.

I think that the only thing missing is updating the readme in the example and the main one.
Any thing else to change/fix?
How should I update the readme? is it automatic?

@simonweil simonweil marked this pull request as ready for review December 12, 2021 20:58
@antonbabenko
Copy link
Member

Looks pretty good. I will review&test it during the week.

@simonweil simonweil force-pushed the feature/add-cloudflare-dns-support branch from 1d75702 to 135d53f Compare December 14, 2021 12:26
@simonweil
Copy link
Author

As far as I know, all is good now.
Please review and tell me if there is anything left to do/fix.

Also should I squash the 3 commits?

@antonbabenko antonbabenko changed the title feat: allow validating the certificate with CloudFlare feat: Allow validating the certificate with CloudFlare Dec 15, 2021
@simonweil simonweil force-pushed the feature/add-cloudflare-dns-support branch from 2f506ce to 3d5f01f Compare December 16, 2021 13:47
@simonweil
Copy link
Author

Docs should be fixed now

@antonbabenko
Copy link
Member

Thank you @simonweil !

I have just finished it in #101 and released version 3.3.0.

@simonweil
Copy link
Author

Thank you @antonbabenko!

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants