Skip to content

Commit

Permalink
Merge pull request #1 from dflook/improve_registry
Browse files Browse the repository at this point in the history
Improve display on terraform registry
  • Loading branch information
dflook authored Feb 26, 2022
2 parents c4052ad + 767f252 commit c672387
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# aws-acm-certificate Terraform Module
# dflook/acm-certificate/aws Terraform Module

This module creates an ACM issued DNS validated certificate.
It supports automatically creating the required validation records where the zone is hosted by Route53.

The [validation submodule](modules/validation) can be used with this resource to create the validation records in a Route53 Hosted Zone in another AWS account.
The [validation submodule](https://registry.terraform.io/modules/dflook/acm-certificate/aws/latest/submodules/validation) can be used with this resource to create the validation records in a Route53 Hosted Zone in another AWS account.

This module can also be used to create certificates that include names that can't have their validation records automatically created.

Expand Down Expand Up @@ -69,7 +69,7 @@ The `domain_validation_options` attribute could also be used to create validatio

## Examples

See the full [examples](examples/) for more.
See the full [examples](https://github.com/dflook/terraform-aws-acm-certificate/tree/main/examples) for more.

### A single name

Expand Down Expand Up @@ -119,7 +119,7 @@ module "certificate" {
This creates a certificate that includes a name that belongs to a Hosted Zone in another AWS account.
The additional name must be in the `names` input variable with the zone id set to `null`, which prevents the module from trying to create the validation record itself.

You can use the `validation` submodule to create the validation records in the other account by passing in an aws provider configured for the correct account.
You can use the [validation submodule](https://registry.terraform.io/modules/dflook/acm-certificate/aws/latest/submodules/validation) to create the validation records in the other account by passing in an aws provider configured for the correct account.

```hcl
module "my_cert" {
Expand Down
30 changes: 30 additions & 0 deletions examples/external_names/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
This is an example of creating a certificate that contains names in zones hosted by different providers.

```hcl
provider "aws" {}
provider "google" {}
data "aws_route53_zone" "example_com" {
name = "example.com."
}
module "my_cert" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"abc.example.com" : data.aws_route53_zone.example_com.zone_id
"xyz.example.org" : null
}
}
resource "google_dns_record_set" "certificate_validate_second_zone" {
for_each = module.my_cert.certificate.domain_validation_options
managed_zone = "example-org"
name = each.value.name
type = each.value.type
ttl = 60
rrdatas = [each.value.record]
}
```
47 changes: 47 additions & 0 deletions examples/multiple_aws_accounts/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
This is an example of creating a certificate that contains names for Route53 Hosted Zones in different AWS accounts.

```hcl
provider "aws" {
profile = "account-1"
region = "eu-west-1"
}
provider "aws" {
alias = "account-2"
profile = "account-2"
region = "eu-west-1"
}
data "aws_route53_zone" "example_com" {
name = "example.com."
}
data "aws_route53_zone" "example_org" {
provider = aws.account-2
name = "example.org."
}
module "certificate" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"abc.example.com" : data.aws_route53_zone.example_com.zone_id
"xyz.example.org" : null
}
}
module "certificate_validate_second_zone" {
source = "dflook/acm-certificate/aws//modules/validation"
version = "1.0.0"
providers = {
aws = aws.account-2
}
certificate = module.certificate.certificate
names = {
"xyz.example.org" : data.aws_route53_zone.example_org.zone_id
}
}
```
24 changes: 24 additions & 0 deletions examples/non_automated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,27 @@ Perhaps the DNS zone is controlled by a third party.

The `wait_for_issuance` input variable is set to `false` so the certificate resource is created and the ARN made available through the `arn` output before the certificate is issued.
The `domain_validation_options` output contains the validation records that still need to be created for the certificate to be issued.

```hcl
provider "aws" {}
data "aws_route53_zone" "example_com" {
name = "example.com."
}
module "my_cert" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"abc.example.com" : data.aws_route53_zone.example_com.zone_id
"xyz.example.com" : null
}
wait_for_validation = false
}
output "domain_validation_options" {
value = module.my_cert.certificate.domain_validation_options
}
```
76 changes: 76 additions & 0 deletions examples/simple/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,77 @@
These examples demonstrate simple usage of this module.

```hcl
provider "aws" {}
data "aws_route53_zone" "example_com" {
name = "example.com."
}
data "aws_route53_zone" "example_org" {
name = "example.org."
}
module "certificate" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"hello.example.com" : data.aws_route53_zone.example_com.zone_id
}
}
module "tags" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"world.example.com" : data.aws_route53_zone.example_com.zone_id
}
tags = {
"Example" : "tags"
}
}
module "multiple_names" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"abc.example.com" : data.aws_route53_zone.example_com.zone_id
"xyz.example.com" : data.aws_route53_zone.example_com.zone_id
}
}
module "explicit_common_name" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
common_name = "yuiop.example.com"
names = {
"qwert.example.com" : data.aws_route53_zone.example_com.zone_id
"yuiop.example.com" : data.aws_route53_zone.example_com.zone_id
}
}
module "multiple_zones" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"foo.example.com" : data.aws_route53_zone.example_com.zone_id
"bar.example.org" : data.aws_route53_zone.example_org.zone_id
}
}
module "wildcard" {
source = "dflook/acm-certificate/aws"
version = "1.0.0"
names = {
"example.com" : data.aws_route53_zone.example_com.zone_id
"*.example.com" : data.aws_route53_zone.example_com.zone_id
}
}
```
6 changes: 3 additions & 3 deletions modules/validation/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# aws-acm-certificate/validation_records Terraform Module
# dflook/acm-certificate/aws//modules/validation Terraform Module

This module creates ACM validation records in Route53 hosted zones.
This should be used when the ACM certificate is in a different account to the Route53 Hosted Zone.
Expand All @@ -19,8 +19,8 @@ The hosted zone ids to create validation records in. The keys of the map are the
- Type: aws_acm_certificate
- Required

The certificate resource to validate. Should be the `certificate` output from the aws-acm-certificate module.
The certificate resource to validate. Should be the `certificate` output from the [dflook/acm-certificate/aws](../../) module.

## Examples

See the [acm-certificate](../../) module for examples.
See the [dflook/acm-certificate/aws](../../) module for examples.

0 comments on commit c672387

Please sign in to comment.