From 0a0f185fe95cdffa62a61b314613c1d99bf96eed Mon Sep 17 00:00:00 2001 From: Jongwoo Han Date: Sat, 31 May 2025 18:15:15 +0900 Subject: [PATCH] fix: Add amazon provided dns to ecs instances --- Modules/Networking/main.tf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Modules/Networking/main.tf b/Modules/Networking/main.tf index fe173b2..0ff4caf 100644 --- a/Modules/Networking/main.tf +++ b/Modules/Networking/main.tf @@ -55,3 +55,17 @@ resource "aws_route_table_association" "public_route_table_assoc" { subnet_id = aws_subnet.public_subnets[count.index].id route_table_id = aws_route_table.public_route_table.id } + +resource "aws_vpc_dhcp_options" "dhcp_options" { + domain_name = "ec2.internal" + domain_name_servers = ["AmazonProvidedDNS"] + + tags = { + Name = "dutymate-dhcp-options" + } +} + +resource "aws_vpc_dhcp_options_association" "dhcp_options_assoc" { + vpc_id = aws_vpc.vpc.id + dhcp_options_id = aws_vpc_dhcp_options.dhcp_options.id +}