Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Added Readme and gitignore.
  • Loading branch information
DJKaswa committed Aug 4, 2021
commit 90c681a8773f13fed252a14d995da8521037b454
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# .tfvars files
# *.tfvars

*.pem
**/plans

.idea
.DS_Store
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# Terraform Customer Infrastructure Template
```
# Variables definition
variable "acm_domain_name" {
description = "Certificate name prefix trailed by hosted zone name"
type = list(string)
}

variable "hosted_zone_name" {
description = "Route53 hosted zone name"
type = string
}

acm_domain_name = ["engineering", "sales"]
hosted_zone_name = "example.com"
```
```
data "aws_route53_zone" "hosted_zone_id" {
name = var.hosted_zone_name
private_zone = false
}
```
```
# Module call
module "new_record_and_certificate" {
source = "github.com/StratusGrid/terraform-aws-acm-certificate-creation"

for_each = toset(var.acm_domain_name)
acm_domain_name = "${each.key}.${var.hosted_zone_name}"
zone_id = data.aws_route53_zone.hosted_zone_id.zone_id

input_tags = {
"Name" = "${each.key}.${var.hosted_zone_name}"
}
}
```
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_acm_certificate" "acm_module_certificate" {
}
}

# Route53 record creation
# Route53 domain record validation
resource "aws_route53_record" "domain_validation_record" {
for_each = {
for dvo in aws_acm_certificate.acm_module_certificate.domain_validation_options : dvo.domain_name => {
Expand Down