Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Update the example to show the complete steps to take to instantiate …
…the module.
  • Loading branch information
DJKaswa committed Jul 7, 2022
commit fd1ee636ac101f3bd9dde99019122a689ba676f1
25 changes: 23 additions & 2 deletions examples/example1.tfnot
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
# Variables definition
variable "acm_certificate_name" {
description = "Certificate name prefix which will be trailed by the hosted-zone name"
type = list(string)
}

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

acm_certificate_name = ["engineering", "sales"]
hosted_zone_name = "example.com"

# Data resource retrieving the provided hosted-zone's ID
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_certificate_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}"
}
Expand Down