Skip to content

Commit

Permalink
Add dependencies between ECS service, network interface filter and Cl…
Browse files Browse the repository at this point in the history
…oudflare DNS
  • Loading branch information
klejejs committed Sep 27, 2024
1 parent 7150297 commit 5395e46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions stun_server/region/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ data "cloudflare_zone" "dns_zone" {
}

resource "cloudflare_record" "instance_dns" {
zone_id = data.cloudflare_zone.dns_zone.id
name = join("-", ["stun", data.aws_region.current.name])
content = data.aws_network_interface.stun_server_interface.association[0].public_ip
type = "A"
proxied = true
zone_id = data.cloudflare_zone.dns_zone.id
name = join("-", ["stun", data.aws_region.current.name])
content = data.aws_network_interface.stun_server_interface.association[0].public_ip
type = "A"
proxied = true
depends_on = [data.aws_network_interface.stun_server_interface]
}
1 change: 1 addition & 0 deletions stun_server/region/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ data "aws_network_interface" "stun_server_interface" {
name = "tag:aws:ecs:serviceName"
values = [aws_ecs_service.stun-server.name]
}
depends_on = [aws_ecs_service.stun-server]
}

0 comments on commit 5395e46

Please sign in to comment.