Skip to content

Commit

Permalink
Better example objects links and bootstrapping (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
krutisfood authored Apr 5, 2022
1 parent fad9b66 commit abc903d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions docs/examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ module "peterdotcloud_vpc" {
module "peterdotcloud_website" {
source = "TechToSpeech/serverless-static-wordpress/aws"
version = "0.1.2"
main_vpc_id = "vpc-e121c09b"
subnet_ids = ["subnet-04b97235", "subnet-08fb235", "subnet-04b97734"]
main_vpc_id = module.peterdotcloud_vpc.main_vpc_id
subnet_ids = tolist(module.peterdotcloud_vpc.subnet_ids)
aws_account_id = data.aws_caller_identity.current.account_id

# site_name will be used to prepend resource names - use no spaces or special characters
site_name = local.site_name
site_domain = local.site_domain
wordpress_subdomain = "wordpress"
hosted_zone_id = "Z00437553UWAVIRHANGCN"
hosted_zone_id = aws_route53_zone.apex.id
s3_region = local.aws_region
slack_webhook = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
ecs_cpu = 1024
Expand All @@ -47,7 +47,7 @@ module "docker_pullpush" {
aws_account_id = data.aws_caller_identity.current.account_id
aws_region = local.aws_region
docker_source = "wordpress:php7.4-apache"
aws_profile = "peterdotcloud"
aws_profile = local.profile
ecr_repo_name = module.peterdotcloud_website.wordpress_ecr_repository
ecr_repo_tag = "base"
depends_on = [module.peterdotcloud_website]
Expand Down Expand Up @@ -80,7 +80,7 @@ resource "null_resource" "update_nameservers" {
nameservers = aws_route53_zone.apex.id
}
provisioner "local-exec" {
command = "aws route53domains update-domain-nameservers --region us-east-1 --domain-name ${local.site_domain} --nameservers Name=${aws_route53_zone.apex.name_servers.0} Name=${aws_route53_zone.apex.name_servers.1} Name=${aws_route53_zone.apex.name_servers.2} Name=${aws_route53_zone.apex.name_servers.3} --profile peterdotcloud"
command = "aws route53domains update-domain-nameservers --region us-east-1 --domain-name ${local.site_domain} --nameservers Name=${aws_route53_zone.apex.name_servers.0} Name=${aws_route53_zone.apex.name_servers.1} Name=${aws_route53_zone.apex.name_servers.2} Name=${aws_route53_zone.apex.name_servers.3} --profile ${local.profile}"
}
depends_on = [aws_route53_zone.apex]
}
8 changes: 4 additions & 4 deletions docs/examples/vpc_setup/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ resource "aws_route_table" "main_private" {
}

resource "aws_route_table_association" "main_subnets_public" {
count = length(data.aws_subnet_ids.main_public.ids)
subnet_id = tolist(data.aws_subnet_ids.main_public.ids)[count.index]
count = length(data.aws_subnet_ids.main_public) > 0 ? length(data.aws_subnet_ids.main_public) : 0
subnet_id = element(aws_subnet.main_public.*.id, count.index)
route_table_id = aws_route_table.main_public.id
}

resource "aws_route_table_association" "main_subnets_private" {
count = length(data.aws_subnet_ids.main_private.ids)
subnet_id = tolist(data.aws_subnet_ids.main_private.ids)[count.index]
count = length(data.aws_subnet_ids.main_private) > 0 ? length(data.aws_subnet_ids.main_private) : 0
subnet_id = element(aws_subnet.main_private.*.id, count.index)
route_table_id = aws_route_table.main_private.id
}

Expand Down

0 comments on commit abc903d

Please sign in to comment.