Skip to content

Commit cd16be6

Browse files
authored
Merge pull request #119 from trussworks/tags_input
Add an input for the caller to set the tags on the created ACM resource
2 parents ff2f592 + fc1c8f4 commit cd16be6

File tree

5 files changed

+41
-24
lines changed

5 files changed

+41
-24
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
- auth:
55
password: $DOCKER_PASSWORD
66
username: $DOCKER_USERNAME
7-
image: trussworks/circleci:efb1042e31538677779971798e0912390f699e72
7+
image: trussworks/circleci:b0e222f15769ec9d0bb8e4c637fab0d01c8636b0
88
steps:
99
- checkout
1010
- restore_cache:

.pre-commit-config.yaml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
repos:
2-
- repo: git://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.3.0
45
hooks:
56
- id: check-json
67
- id: check-merge-conflict
@@ -11,19 +12,19 @@ repos:
1112
- --autofix
1213
- id: trailing-whitespace
1314

14-
- repo: git://github.com/igorshubovych/markdownlint-cli
15-
rev: v0.26.0
15+
- repo: https://github.com/igorshubovych/markdownlint-cli
16+
rev: v0.31.1
1617
hooks:
1718
- id: markdownlint
1819

19-
- repo: git://github.com/antonbabenko/pre-commit-terraform
20-
rev: v1.45.0
20+
- repo: https://github.com/antonbabenko/pre-commit-terraform
21+
rev: v1.72.1
2122
hooks:
2223
- id: terraform_docs
2324
- id: terraform_fmt
2425

25-
- repo: git://github.com/golangci/golangci-lint
26-
rev: v1.33.0
26+
- repo: https://github.com/golangci/golangci-lint
27+
rev: v1.46.2
2728
hooks:
2829
- id: golangci-lint
2930
args: [--timeout=3m]

README.md

+25-10
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,46 @@ module "acm_cert" {
3232

3333
| Name | Version |
3434
|------|---------|
35-
| terraform | >= 0.13.0 |
36-
| aws | >= 3.0 |
35+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
36+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
3737

3838
## Providers
3939

4040
| Name | Version |
4141
|------|---------|
42-
| aws | >= 3.0 |
42+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
43+
44+
## Modules
45+
46+
No modules.
47+
48+
## Resources
49+
50+
| Name | Type |
51+
|------|------|
52+
| [aws_acm_certificate.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate) | resource |
53+
| [aws_acm_certificate_validation.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate_validation) | resource |
54+
| [aws_lb_listener_certificate.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_certificate) | resource |
55+
| [aws_route53_record.caa](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
56+
| [aws_route53_record.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
57+
| [aws_route53_zone.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
4358

4459
## Inputs
4560

4661
| Name | Description | Type | Default | Required |
4762
|------|-------------|------|---------|:--------:|
48-
| alb\_listener\_arn | (Optional) Associate ACM certificate to and ALB listener. | `string` | `""` | no |
49-
| caa\_records | Add CAA records to route53. | `list(string)` | `[]` | no |
50-
| domain\_name | Domain name to associate with the ACM certificate. | `string` | n/a | yes |
51-
| environment | Environment tag. e.g. prod | `string` | n/a | yes |
52-
| zone\_name | The Route53 zone name for which the certificate should be verified and issued. | `string` | n/a | yes |
63+
| <a name="input_alb_listener_arn"></a> [alb\_listener\_arn](#input\_alb\_listener\_arn) | (Optional) Associate ACM certificate to and ALB listener. | `string` | `""` | no |
64+
| <a name="input_caa_records"></a> [caa\_records](#input\_caa\_records) | Add CAA records to route53. | `list(string)` | `[]` | no |
65+
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | Domain name to associate with the ACM certificate. | `string` | n/a | yes |
66+
| <a name="input_environment"></a> [environment](#input\_environment) | Environment tag. e.g. prod | `string` | n/a | yes |
67+
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to be attached to the ACM certificate. | `map(string)` | `{}` | no |
68+
| <a name="input_zone_name"></a> [zone\_name](#input\_zone\_name) | The Route53 zone name for which the certificate should be verified and issued. | `string` | n/a | yes |
5369

5470
## Outputs
5571

5672
| Name | Description |
5773
|------|-------------|
58-
| acm\_arn | The ARN of the validated ACM certificate. |
59-
74+
| <a name="output_acm_arn"></a> [acm\_arn](#output\_acm\_arn) | The ARN of the validated ACM certificate. |
6075
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
6176

6277
## Developer Setup

main.tf

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ resource "aws_acm_certificate" "main" {
66
domain_name = var.domain_name
77
validation_method = "DNS"
88

9-
tags = {
10-
Name = var.domain_name
11-
Environment = var.environment
12-
Automation = "Terraform"
13-
}
9+
tags = var.tags
1410

1511
lifecycle {
1612
create_before_destroy = true

variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ variable "caa_records" {
2525
default = []
2626
}
2727

28+
variable "tags" {
29+
description = "Tags to be attached to the ACM certificate."
30+
type = map(string)
31+
default = {}
32+
}

0 commit comments

Comments
 (0)