Skip to content

Commit 6ded875

Browse files
authored
Update vpc and eks/cluster components (#677)
1 parent f974c7d commit 6ded875

File tree

11 files changed

+48
-34
lines changed

11 files changed

+48
-34
lines changed

modules/eks/cluster/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Component: `eks/cluster`
22

3-
This component is responsible for provisioning an end-to-end EKS Cluster, including managed node groups.
3+
This component is responsible for provisioning an end-to-end EKS Cluster, including managed node groups and Fargate profiles.
44

55

66
:::warning
@@ -195,16 +195,16 @@ For example:
195195

196196
| Name | Source | Version |
197197
|------|--------|---------|
198-
| <a name="module_eks"></a> [eks](#module\_eks) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
199-
| <a name="module_eks_cluster"></a> [eks\_cluster](#module\_eks\_cluster) | cloudposse/eks-cluster/aws | 2.6.0 |
200-
| <a name="module_fargate_profile"></a> [fargate\_profile](#module\_fargate\_profile) | cloudposse/eks-fargate-profile/aws | 1.1.0 |
198+
| <a name="module_eks"></a> [eks](#module\_eks) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.2 |
199+
| <a name="module_eks_cluster"></a> [eks\_cluster](#module\_eks\_cluster) | cloudposse/eks-cluster/aws | 2.7.0 |
200+
| <a name="module_fargate_profile"></a> [fargate\_profile](#module\_fargate\_profile) | cloudposse/eks-fargate-profile/aws | 1.2.0 |
201201
| <a name="module_iam_arns"></a> [iam\_arns](#module\_iam\_arns) | ../../account-map/modules/roles-to-principals | n/a |
202202
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../../account-map/modules/iam-roles | n/a |
203203
| <a name="module_karpenter_label"></a> [karpenter\_label](#module\_karpenter\_label) | cloudposse/label/null | 0.25.0 |
204204
| <a name="module_region_node_group"></a> [region\_node\_group](#module\_region\_node\_group) | ./modules/node_group_by_region | n/a |
205205
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
206-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
207-
| <a name="module_vpc_ingress"></a> [vpc\_ingress](#module\_vpc\_ingress) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
206+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.2 |
207+
| <a name="module_vpc_ingress"></a> [vpc\_ingress](#module\_vpc\_ingress) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.2 |
208208

209209
## Resources
210210

modules/eks/cluster/aws_sso.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# This is split off into a separate file in the hopes we can drop it altogether in the future,
22
# or else move it into `roles-to-principals`.
33

4-
54
locals {
65

76
# EKS does not accept the actual role ARN of the permission set,
@@ -20,7 +19,6 @@ locals {
2019
username = format("%s-%s", local.this_account_name, role.aws_sso_permission_set)
2120
groups = role.groups
2221
}]
23-
2422
}
2523

2624
data "aws_iam_roles" "sso_roles" {

modules/eks/cluster/fargate-profiles.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ locals {
44

55
module "fargate_profile" {
66
source = "cloudposse/eks-fargate-profile/aws"
7-
version = "1.1.0"
7+
version = "1.2.0"
88

99
for_each = local.fargate_profiles
1010

modules/eks/cluster/main.tf

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ locals {
33
eks_outputs = module.eks.outputs
44
vpc_outputs = module.vpc.outputs
55

6-
attributes = flatten(concat(module.this.attributes, [var.color]))
7-
public_subnet_ids = local.vpc_outputs.public_subnet_ids
8-
private_subnet_ids = local.vpc_outputs.private_subnet_ids
9-
vpc_id = local.vpc_outputs.vpc_id
6+
attributes = flatten(concat(module.this.attributes, [var.color]))
107

118
this_account_name = module.iam_roles.current_account_account_name
129
identity_account_name = module.iam_roles.identity_account_account_name
@@ -78,11 +75,21 @@ locals {
7875
module.vpc_ingress[k].outputs.vpc_cidr
7976
]
8077
)
78+
79+
vpc_id = local.vpc_outputs.vpc_id
80+
81+
# Get only the public subnets that correspond to the AZs provided in `var.availability_zones`
82+
# `az_public_subnets_map` is a map of AZ names to list of public subnet IDs in the AZs
83+
public_subnet_ids = flatten([for k, v in local.vpc_outputs.az_public_subnets_map : v if contains(var.availability_zones, k)])
84+
85+
# Get only the private subnets that correspond to the AZs provided in `var.availability_zones`
86+
# `az_private_subnets_map` is a map of AZ names to list of private subnet IDs in the AZs
87+
private_subnet_ids = flatten([for k, v in local.vpc_outputs.az_private_subnets_map : v if contains(var.availability_zones, k)])
8188
}
8289

8390
module "eks_cluster" {
8491
source = "cloudposse/eks-cluster/aws"
85-
version = "2.6.0"
92+
version = "2.7.0"
8693

8794
region = var.region
8895
attributes = local.attributes

modules/eks/cluster/modules/node_group_by_az/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data "aws_subnets" "private" {
1818

1919
module "az_abbreviation" {
2020
source = "cloudposse/utils/aws"
21-
version = "1.1.0"
21+
version = "1.3.0"
2222
}
2323

2424
locals {
@@ -32,7 +32,7 @@ locals {
3232

3333
module "eks_node_group" {
3434
source = "cloudposse/eks-node-group/aws"
35-
version = "2.6.0"
35+
version = "2.10.0"
3636

3737
enabled = local.enabled
3838

modules/eks/cluster/modules/node_group_by_region/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ locals {
33
az_list = tolist(local.az_set)
44
}
55

6-
76
module "node_group" {
87
for_each = module.this.enabled ? local.az_set : []
98

modules/eks/cluster/remote-state.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module "iam_arns" {
1212

1313
module "vpc" {
1414
source = "cloudposse/stack-config/yaml//modules/remote-state"
15-
version = "1.4.1"
15+
version = "1.4.2"
1616

1717
component = "vpc"
1818

@@ -21,7 +21,7 @@ module "vpc" {
2121

2222
module "vpc_ingress" {
2323
source = "cloudposse/stack-config/yaml//modules/remote-state"
24-
version = "1.4.1"
24+
version = "1.4.2"
2525

2626
for_each = local.accounts_with_vpc
2727

@@ -33,13 +33,12 @@ module "vpc_ingress" {
3333
context = module.this.context
3434
}
3535

36-
3736
# Yes, this is self-referential.
3837
# It obtains the previous state of the cluster so that we can add
3938
# to it rather than overwrite it (specifically the aws-auth configMap)
4039
module "eks" {
4140
source = "cloudposse/stack-config/yaml//modules/remote-state"
42-
version = "1.4.1"
41+
version = "1.4.2"
4342

4443
component = var.eks_component_name
4544

modules/vpc/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ components:
7070
7171
| Name | Source | Version |
7272
|------|--------|---------|
73-
| <a name="module_endpoint_security_groups"></a> [endpoint\_security\_groups](#module\_endpoint\_security\_groups) | cloudposse/security-group/aws | 2.0.0-rc1 |
73+
| <a name="module_endpoint_security_groups"></a> [endpoint\_security\_groups](#module\_endpoint\_security\_groups) | cloudposse/security-group/aws | 2.1.0 |
7474
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../account-map/modules/iam-roles | n/a |
75-
| <a name="module_subnets"></a> [subnets](#module\_subnets) | cloudposse/dynamic-subnets/aws | 2.0.4 |
75+
| <a name="module_subnets"></a> [subnets](#module\_subnets) | cloudposse/dynamic-subnets/aws | 2.3.0 |
7676
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
77-
| <a name="module_utils"></a> [utils](#module\_utils) | cloudposse/utils/aws | 1.1.0 |
78-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | cloudposse/vpc/aws | 2.0.0 |
79-
| <a name="module_vpc_endpoints"></a> [vpc\_endpoints](#module\_vpc\_endpoints) | cloudposse/vpc/aws//modules/vpc-endpoints | 2.0.0 |
80-
| <a name="module_vpc_flow_logs_bucket"></a> [vpc\_flow\_logs\_bucket](#module\_vpc\_flow\_logs\_bucket) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
77+
| <a name="module_utils"></a> [utils](#module\_utils) | cloudposse/utils/aws | 1.3.0 |
78+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | cloudposse/vpc/aws | 2.1.0 |
79+
| <a name="module_vpc_endpoints"></a> [vpc\_endpoints](#module\_vpc\_endpoints) | cloudposse/vpc/aws//modules/vpc-endpoints | 2.1.0 |
80+
| <a name="module_vpc_flow_logs_bucket"></a> [vpc\_flow\_logs\_bucket](#module\_vpc\_flow\_logs\_bucket) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.2 |
8181
8282
## Resources
8383
@@ -143,6 +143,8 @@ components:
143143
| Name | Description |
144144
|------|-------------|
145145
| <a name="output_availability_zones"></a> [availability\_zones](#output\_availability\_zones) | List of Availability Zones where subnets were created |
146+
| <a name="output_az_private_subnets_map"></a> [az\_private\_subnets\_map](#output\_az\_private\_subnets\_map) | Map of AZ names to list of private subnet IDs in the AZs |
147+
| <a name="output_az_public_subnets_map"></a> [az\_public\_subnets\_map](#output\_az\_public\_subnets\_map) | Map of AZ names to list of public subnet IDs in the AZs |
146148
| <a name="output_interface_vpc_endpoints"></a> [interface\_vpc\_endpoints](#output\_interface\_vpc\_endpoints) | List of Interface VPC Endpoints in this VPC. |
147149
| <a name="output_max_subnet_count"></a> [max\_subnet\_count](#output\_max\_subnet\_count) | Maximum allowed number of subnets before all subnet CIDRs need to be recomputed |
148150
| <a name="output_nat_eip_protections"></a> [nat\_eip\_protections](#output\_nat\_eip\_protections) | List of AWS Shield Advanced Protections for NAT Elastic IPs. |

modules/vpc/main.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ locals {
6767

6868
module "utils" {
6969
source = "cloudposse/utils/aws"
70-
version = "1.1.0"
70+
version = "1.3.0"
7171
}
7272

7373
module "vpc" {
7474
source = "cloudposse/vpc/aws"
75-
version = "2.0.0"
75+
version = "2.1.0"
7676

7777
ipv4_primary_cidr_block = var.ipv4_primary_cidr_block
7878
internet_gateway_enabled = var.public_subnets_enabled
@@ -99,7 +99,7 @@ module "endpoint_security_groups" {
9999
for_each = local.enabled && try(length(var.interface_vpc_endpoints), 0) > 0 ? toset([local.interface_endpoint_security_group_key]) : []
100100

101101
source = "cloudposse/security-group/aws"
102-
version = "2.0.0-rc1"
102+
version = "2.1.0"
103103

104104
create_before_destroy = true
105105
preserve_security_group_id = false
@@ -124,10 +124,9 @@ module "endpoint_security_groups" {
124124
context = module.this.context
125125
}
126126

127-
128127
module "vpc_endpoints" {
129128
source = "cloudposse/vpc/aws//modules/vpc-endpoints"
130-
version = "2.0.0"
129+
version = "2.1.0"
131130

132131
enabled = (length(var.interface_vpc_endpoints) + length(var.gateway_vpc_endpoints)) > 0
133132

@@ -140,7 +139,7 @@ module "vpc_endpoints" {
140139

141140
module "subnets" {
142141
source = "cloudposse/dynamic-subnets/aws"
143-
version = "2.0.4"
142+
version = "2.3.0"
144143

145144
availability_zones = local.availability_zones
146145
availability_zone_ids = local.availability_zone_ids

modules/vpc/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,13 @@ output "availability_zones" {
118118
description = "List of Availability Zones where subnets were created"
119119
value = module.subnets.availability_zones
120120
}
121+
122+
output "az_private_subnets_map" {
123+
description = "Map of AZ names to list of private subnet IDs in the AZs"
124+
value = module.subnets.az_private_subnets_map
125+
}
126+
127+
output "az_public_subnets_map" {
128+
description = "Map of AZ names to list of public subnet IDs in the AZs"
129+
value = module.subnets.az_public_subnets_map
130+
}

0 commit comments

Comments
 (0)