Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/schubergphilis/terraform-aws-mcaf-certificate

Terraform module to manage certificates in AWS Certificate Manager
https://github.com/schubergphilis/terraform-aws-mcaf-certificate

aws terraform terraform-module

Last synced: about 1 month ago
JSON representation

Terraform module to manage certificates in AWS Certificate Manager

Awesome Lists containing this project

README

        

# terraform-aws-mcaf-certificate

Terraform module to manage certificates in AWS Certificate Manager.

## Usage

### DNS validation with Route 53

This module supports creating validation records in zones hosted in the same account as the certificate and for zones hosted in a different account. To support this use case, an additional provider needs to be passed to the module as shown below.

#### Creating a certificate using a local Route 53 zone for validation

```hcl
provider "aws" {}

data "aws_route53_zone" "selected" {
name = "myzone.com."
}

module "certificate" {
source = "schubergphilis/mcaf-certificate/aws"

providers = { aws.route53 = aws }

common_name = "www.myzone.com"
zone_id = data.aws_route53_zone.selected.zone_id
}
```

#### Creating a certificate using a remote Route 53 zone for validation

```hcl
provider "aws" {}

provider "aws" {
alias = "route53"
// Configuration for the remote account
// ...
}

data "aws_route53_zone" "selected" {
name = "myzone.com."
}

module "certificate" {
source = "schubergphilis/mcaf-certificate/aws"

providers = { aws.route53 = aws.route53 }

common_name = "www.myzone.com"
zone_id = data.aws_route53_zone.selected.zone_id
}
```

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.7 |
| [aws](#requirement\_aws) | ~> 5.0 |

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | ~> 5.0 |
| [aws.route53](#provider\_aws.route53) | ~> 5.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_acm_certificate.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate) | resource |
| [aws_route53_record.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [common\_name](#input\_common\_name) | Certificate common name | `string` | n/a | yes |
| [zone\_id](#input\_zone\_id) | Route53 Zone ID to create validation records in | `string` | n/a | yes |
| [subject\_alternative\_names](#input\_subject\_alternative\_names) | List of Subject Alternative Names (SANs) to include in the certificate | `list(string)` | `null` | no |
| [tags](#input\_tags) | Map of tags to add to resources | `map(string)` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| [arn](#output\_arn) | Certificate ARN |
| [domain\_name](#output\_domain\_name) | Domain name for which the certificate is issued |
| [id](#output\_id) | Certificate ID |
| [not\_after](#output\_not\_after) | Expiration date and time of the certificate |
| [not\_before](#output\_not\_before) | Start of the validity period of the certificate |
| [status](#output\_status) | Status of the certificate |

## License

**Copyright:** Schuberg Philis

```text
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```