Skip to content

Commit

Permalink
update prod example
Browse files Browse the repository at this point in the history
  • Loading branch information
Riqardos committed Jan 29, 2024
1 parent 8815e62 commit d918070
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion examples/production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ The code in this example shows how to use the module with production configurati

## Resources

No resources.
| Name | Type |
|------|------|
| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |

## Inputs

Expand Down
8 changes: 6 additions & 2 deletions examples/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ locals {
availability_zones = ["eu-central-1a", "eu-central-1b", "eu-central-1c"]
}

data "aws_route53_zone" "this" {
name = "appmixer.co"
}

module "appmixer_module" {
source = "../../"

name = local.name
namespace = local.namespace
environment = local.environment

root_dns_name = "ecs.appmixer.co"
zone_id = "XXX"
root_dns_name = "ecs-prod.appmixer.co"
zone_id = data.aws_route53_zone.this.zone_id

vpc_config = {
ipv4_primary_cidr_block = "10.0.0.0/16"
Expand Down
4 changes: 2 additions & 2 deletions route53.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ resource "aws_acm_certificate" "alb" {

resource "aws_route53_record" "cert_alb" {
for_each = {
for dvo in try(aws_acm_certificate.alb[0].domain_validation_options, []) : dvo.domain_name => {
for dvo in local.acm_certificate_enabled ? aws_acm_certificate.alb[0].domain_validation_options : [] : dvo.domain_name => {
name = dvo.resource_record_name
record = dvo.resource_record_value
type = dvo.resource_record_type
} if local.acm_certificate_enabled
}
}

allow_overwrite = true
Expand Down

0 comments on commit d918070

Please sign in to comment.