-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# In the test we provision the network and IAM resources using the environment | ||
# module, we then lookup the relevant config here! | ||
# This is in order to simulate launching a cluster in an existing VPC! | ||
|
||
locals { | ||
availability_zones = toset(["us-east-1a", "us-east-1b", "us-east-1c"]) | ||
vpc_config = { | ||
vpc_id = data.aws_vpc.network.id | ||
public_subnet_ids = { for subnet in data.aws_subnet.public : subnet.availability_zone => subnet.id } | ||
private_subnet_ids = { for subnet in data.aws_subnet.private : subnet.availability_zone => subnet.id } | ||
} | ||
|
||
iam_config = { | ||
service_role = "eksServiceRole-${var.cluster_name}" | ||
node_role = "EKSNode-${var.cluster_name}" | ||
admin_role = "EKSAdmin-${var.cluster_name}" | ||
} | ||
} | ||
|
||
data "aws_vpc" "network" { | ||
tags = { | ||
Name = var.cluster_name | ||
} | ||
} | ||
|
||
data "aws_subnet" "public" { | ||
for_each = local.availability_zones | ||
|
||
availability_zone = each.value | ||
vpc_id = data.aws_vpc.network.id | ||
tags = { | ||
Name = "${var.cluster_name}-public-${each.value}" | ||
} | ||
} | ||
|
||
data "aws_subnet" "private" { | ||
for_each = local.availability_zones | ||
|
||
availability_zone = each.value | ||
vpc_id = data.aws_vpc.network.id | ||
tags = { | ||
Name = "${var.cluster_name}-private-${each.value}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters