Skip to content

Commit

Permalink
add dummy vpc
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jul 30, 2024
1 parent 999d79e commit 0d67317
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions dns_zones.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,30 @@ provider "aws" {
# dummy vpc, so we can associate the zone to this account
#---
data "aws_vpc" "dummy_vpc" {
count = !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
depends_on = [aws_vpc.vpc]
count = !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
filter {
name = "tag:Name"
values = ["vpc0-dummy"]
}
filter {
name = "tag:eks-cluster-name"
values = [var.cluster_name]
}
}

## Dummy VPC
resource "aws_vpc" "vpc" {
cidr_block = "192.168.0.0/24"
enable_dns_support = false
enable_dns_hostnames = false
tags = merge(
var.tags,
{ "Name" = "vpc0-dummy" },
)
}


resource "aws_route53_zone" "cluster_domain" {
name = local.cluster_domain_name
comment = local.cluster_domain_description
Expand All @@ -58,7 +75,6 @@ resource "aws_route53_zone" "cluster_domain" {
}

tags = merge(
local.base_tags,
var.tags,
{ "Name" = local.cluster_domain_name },
)
Expand Down

0 comments on commit 0d67317

Please sign in to comment.