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

chore: Add third example for multi-provider #147

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions examples/complete-dns-validation/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,58 @@ module "route53_records_only" {

acm_certificate_domain_validation_options = module.acm_only.acm_certificate_domain_validation_options
}

################################################################
# Example 3:
# Use separate providers for ACM and Route53 with for_each
#
# 1. Clone this module into a local module
# 2. Modify configuration_aliases for your aws provider:
#
# configuration_aliases = [aws.acm, aws.dns]
#
# 3. Modify resources in the module to use either the acm or dns provider
# 4. Pass in your domains/zones/altnames as a list(object) to for_each
# 5. Call the module with your respective providers like below
################################################################
#
# locals {
# domains_zones = [
# {
# domain = "example1.com",
# zone_id = "AAAAAAAAAAAAAA",
# subject_alt_names = [
# "*.example1.com"
# ]
# },
# {
# domain = "example2.com",
# zone_id = "BBBBBBBBBBBBBB",
# subject_alt_names = [
# "sub.example2.com"
# ]
# },
# ]
# }
#
# module "acm" {
# source = "path/to/local/module"
# for_each = local.domain_zones
#
# providers = {
# aws.acm = aws.acm_provider
# aws.dns = aws.dns_provider
# }
#
# domain_name = each.value.domain
# zone_id = each.value.zone_id
#
# subject_alternative_names = each.value.subject_alt_names
#
# validation_method = "DNS"
# wait_for_validation = true
#
# tags = {
# Name = each.value.domain
# }
# }
Loading