From 903aed23acf43c6e590d8fb482bc660b03c4a5ad Mon Sep 17 00:00:00 2001 From: TAKANO Mitsuhiro Date: Thu, 22 Feb 2024 17:19:53 +0900 Subject: [PATCH] Use CloudFront properly --- cloudfront.tf | 2 +- fargate.tf | 26 +++++++------------------- route53.tf | 1 - 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/cloudfront.tf b/cloudfront.tf index 030a87b..d242ea0 100644 --- a/cloudfront.tf +++ b/cloudfront.tf @@ -13,7 +13,7 @@ module "acm" { resource "aws_cloudfront_distribution" "this" { origin { - domain_name = var.public_alb_domain + domain_name = module.alb.lb_dns_name origin_id = "alb" custom_origin_config { diff --git a/fargate.tf b/fargate.tf index 1f03e89..44497ba 100644 --- a/fargate.tf +++ b/fargate.tf @@ -134,11 +134,11 @@ resource "aws_security_group" "wordpress" { } resource "aws_ecs_service" "this" { - name = "${var.prefix}-${var.environment}" - cluster = aws_ecs_cluster.this.id - task_definition = aws_ecs_task_definition.this.arn - desired_count = var.desired_count - launch_type = "FARGATE" + name = "${var.prefix}-${var.environment}" + cluster = aws_ecs_cluster.this.id + task_definition = aws_ecs_task_definition.this.arn + desired_count = var.desired_count + launch_type = "FARGATE" network_configuration { security_groups = [aws_security_group.alb.id, aws_security_group.db.id, aws_security_group.efs.id] subnets = module.vpc.private_subnets @@ -167,11 +167,11 @@ resource "aws_ecs_task_definition" "this" { memory = var.task_memory runtime_platform { - cpu_architecture = "ARM64" # Indicate Graviton2 processor architecture + cpu_architecture = "ARM64" # Indicate Graviton2 processor architecture operating_system_family = "LINUX" } - container_definitions = <