You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-2
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,32 @@ module "acm" {
25
25
}
26
26
```
27
27
28
+
## Usage with external DNS validation (e.g. CloudFlare)
29
+
30
+
```hcl
31
+
module "acm" {
32
+
source = "terraform-aws-modules/acm/aws"
33
+
version = "~> 3.0"
34
+
35
+
domain_name = "weekly.tf"
36
+
zone_id = "b7d259641bf30b89887c943ffc9d2138"
37
+
38
+
subject_alternative_names = [
39
+
"*.weekly.tf",
40
+
]
41
+
42
+
create_route53_records = false
43
+
validation_record_fqdns = [
44
+
"_689571ee9a5f9ec307c512c5d851e25a.weekly.tf",
45
+
]
46
+
47
+
tags = {
48
+
Name = "weekly.tf"
49
+
}
50
+
}
51
+
52
+
```
53
+
28
54
## [Usage with CloudFront](https://aws.amazon.com/premiumsupport/knowledge-center/install-ssl-cloudfront/)
29
55
30
56
```hcl
@@ -56,6 +82,7 @@ module "acm" {
56
82
## Examples
57
83
58
84
-[Complete example with DNS validation (recommended)](https://github.com/terraform-aws-modules/terraform-aws-acm/tree/master/examples/complete-dns-validation)
85
+
-[Complete example with DNS validation via external DNS provider (CloudFlare)](https://github.com/terraform-aws-modules/terraform-aws-acm/tree/master/examples/complete-dns-validation-with-cloudflare)
59
86
-[Complete example with EMAIL validation](https://github.com/terraform-aws-modules/terraform-aws-acm/tree/master/examples/complete-email-validation)
| <aname="input_certificate_transparency_logging_preference"></a> [certificate\_transparency\_logging\_preference](#input\_certificate\_transparency\_logging\_preference)| Specifies whether certificate details should be added to a certificate transparency log |`bool`|`true`| no |
121
148
| <aname="input_create_certificate"></a> [create\_certificate](#input\_create\_certificate)| Whether to create ACM certificate |`bool`|`true`| no |
149
+
| <aname="input_create_route53_records"></a> [create\_route53\_records](#input\_create\_route53\_records)| When validation is set to DNS, define whether to create the DNS records internally via Route53 or externally using any DNS provider |`bool`|`true`| no |
122
150
| <aname="input_dns_ttl"></a> [dns\_ttl](#input\_dns\_ttl)| The TTL of DNS recursive resolvers to cache information about this record. |`number`|`60`| no |
123
151
| <aname="input_domain_name"></a> [domain\_name](#input\_domain\_name)| A domain name for which the certificate should be issued |`string`|`""`| no |
124
152
| <aname="input_subject_alternative_names"></a> [subject\_alternative\_names](#input\_subject\_alternative\_names)| A list of domains that should be SANs in the issued certificate |`list(string)`|`[]`| no |
125
153
| <aname="input_tags"></a> [tags](#input\_tags)| A mapping of tags to assign to the resource |`map(string)`|`{}`| no |
126
154
| <aname="input_validate_certificate"></a> [validate\_certificate](#input\_validate\_certificate)| Whether to validate certificate by creating Route53 record |`bool`|`true`| no |
127
155
| <aname="input_validation_allow_overwrite_records"></a> [validation\_allow\_overwrite\_records](#input\_validation\_allow\_overwrite\_records)| Whether to allow overwrite of Route53 records |`bool`|`true`| no |
128
156
| <aname="input_validation_method"></a> [validation\_method](#input\_validation\_method)| Which method to use for validation. DNS or EMAIL are valid, NONE can be used for certificates that were imported into ACM and then into Terraform. |`string`|`"DNS"`| no |
157
+
| <aname="input_validation_record_fqdns"></a> [validation\_record\_fqdns](#input\_validation\_record\_fqdns)| When validation is set to DNS and the DNS validation records are set externally, provide the fqdns for the validation |`list(string)`|`[]`| no |
129
158
| <aname="input_wait_for_validation"></a> [wait\_for\_validation](#input\_wait\_for\_validation)| Whether to wait for the validation to complete |`bool`|`true`| no |
130
-
| <aname="input_zone_id"></a> [zone\_id](#input\_zone\_id)| The ID of the hosted zone to contain this record. |`string`|`""`| no |
159
+
| <aname="input_zone_id"></a> [zone\_id](#input\_zone\_id)| The ID of the hosted zone to contain this record. Required when validating via Route53 |`string`|`""`| no |
# Complete ACM example with external CloudFlare DNS validation
2
+
3
+
Configuration in this directory creates an ACM certificate (valid for the domain name and wildcard) while the DNS validation is done via an external DNS provider.
4
+
5
+
For this example CloudFlare DNS is used but any DNS provider could be used instead.
6
+
7
+
This is a complete example which fits most of scenarios.
8
+
9
+
## Usage
10
+
11
+
To run this example you need to execute:
12
+
13
+
```bash
14
+
$ terraform init
15
+
$ terraform plan
16
+
$ terraform apply
17
+
```
18
+
19
+
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.
20
+
21
+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|[cloudflare_zone.this](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/data-sources/zone)| data source |
48
+
49
+
## Inputs
50
+
51
+
No inputs.
52
+
53
+
## Outputs
54
+
55
+
| Name | Description |
56
+
|------|-------------|
57
+
| <aname="output_acm_certificate_arn"></a> [acm\_certificate\_arn](#output\_acm\_certificate\_arn)| The ARN of the certificate |
58
+
| <aname="output_acm_certificate_domain_validation_options"></a> [acm\_certificate\_domain\_validation\_options](#output\_acm\_certificate\_domain\_validation\_options)| A list of attributes to feed into other resources to complete certificate validation. Can have more than one element, e.g. if SANs are defined. Only set if DNS-validation was used. |
59
+
| <aname="output_acm_certificate_validation_emails"></a> [acm\_certificate\_validation\_emails](#output\_acm\_certificate\_validation\_emails)| A list of addresses that received a validation E-Mail. Only set if EMAIL-validation was used. |
60
+
| <aname="output_distinct_domain_names"></a> [distinct\_domain\_names](#output\_distinct\_domain\_names)| List of distinct domains names used for the validation. |
61
+
| <aname="output_validation_domains"></a> [validation\_domains](#output\_validation\_domains)| List of distinct domain validation options. This is useful if subject alternative names contain wildcards. |
62
+
| <aname="output_validation_route53_record_fqdns"></a> [validation\_route53\_record\_fqdns](#output\_validation\_route53\_record\_fqdns)| List of FQDNs built using the zone domain and name. |
description="A list of attributes to feed into other resources to complete certificate validation. Can have more than one element, e.g. if SANs are defined. Only set if DNS-validation was used."
description="Which method to use for validation. DNS or EMAIL are valid, NONE can be used for certificates that were imported into ACM and then into Terraform."
0 commit comments