Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass site_prefix to CloudFront module #66

Open
wants to merge 2 commits into
base: release/0.2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module "cloudfront" {
source = "./modules/cloudfront"
site_name = var.site_name
site_domain = var.site_domain
site_prefix = var.site_prefix
cloudfront_ssl = aws_acm_certificate.wordpress_site.arn
cloudfront_aliases = var.cloudfront_aliases
providers = {
Expand Down