Skip to content

Commit fc5bd96

Browse files
committed
updates to params and readme
1 parent 09466d8 commit fc5bd96

File tree

6 files changed

+32
-24
lines changed

6 files changed

+32
-24
lines changed

terraform/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ $ terraform apply
2121

2222
| Name | Version |
2323
|------|---------|
24-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.98.0 |
25-
| <a name="provider_tls"></a> [tls](#provider\_tls) | 4.1.0 |
24+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.74 |
25+
| <a name="provider_tls"></a> [tls](#provider\_tls) | >= 4.0 |
2626

2727
## Modules
2828

@@ -31,7 +31,7 @@ $ terraform apply
3131
| <a name="module_eks_cluster"></a> [eks\_cluster](#module\_eks\_cluster) | native-cube/kms/aws | ~> 1.0.0 |
3232
| <a name="module_eks_node_group_al2023"></a> [eks\_node\_group\_al2023](#module\_eks\_node\_group\_al2023) | native-cube/eks-node-group/aws | ~> 1.1.0 |
3333
| <a name="module_eks_vpc_flow_logs"></a> [eks\_vpc\_flow\_logs](#module\_eks\_vpc\_flow\_logs) | native-cube/vpc-flow-logs/aws | ~> 2.2.0 |
34-
| <a name="module_vpc_eks"></a> [vpc\_eks](#module\_vpc\_eks) | terraform-aws-modules/vpc/aws | 5.18.1 |
34+
| <a name="module_vpc_eks"></a> [vpc\_eks](#module\_vpc\_eks) | terraform-aws-modules/vpc/aws | 6.0.1 |
3535

3636
## Resources
3737

@@ -65,7 +65,7 @@ $ terraform apply
6565
| [aws_iam_role.adot_collector](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
6666
| [aws_iam_role.cert_manager](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
6767
| [aws_iam_role.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
68-
| [aws_iam_role.ebs_csi_controller_sa](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
68+
| [aws_iam_role.ebs_csi_controller](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
6969
| [aws_iam_role.eks_node_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
7070
| [aws_iam_role.eks_node_karpenter](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
7171
| [aws_iam_role.external_dns](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
@@ -79,7 +79,7 @@ $ terraform apply
7979
| [aws_iam_role_policy.load_balancer_controller](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
8080
| [aws_iam_role_policy_attachments_exclusive.adot_collector](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachments_exclusive) | resource |
8181
| [aws_iam_role_policy_attachments_exclusive.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachments_exclusive) | resource |
82-
| [aws_iam_role_policy_attachments_exclusive.ebs_csi_controller_sa](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachments_exclusive) | resource |
82+
| [aws_iam_role_policy_attachments_exclusive.ebs_csi_controller](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachments_exclusive) | resource |
8383
| [aws_iam_role_policy_attachments_exclusive.eks_node_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachments_exclusive) | resource |
8484
| [aws_iam_role_policy_attachments_exclusive.eks_node_karpenter](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachments_exclusive) | resource |
8585
| [aws_launch_template.cluster_al2023](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template) | resource |
@@ -142,6 +142,7 @@ $ terraform apply
142142
| Name | Description | Type | Default | Required |
143143
|------|-------------|------|---------|:--------:|
144144
| <a name="input_azs"></a> [azs](#input\_azs) | A list of availability zones names or ids in the region | `list(string)` | `[]` | no |
145+
| <a name="input_capacity_type"></a> [capacity\_type](#input\_capacity\_type) | Type of capacity associated with the EKS Node Group. Defaults to ON\_DEMAND. Valid values: ON\_DEMAND, SPOT. | `string` | `"ON_DEMAND"` | no |
145146
| <a name="input_ebs_delete_on_termination"></a> [ebs\_delete\_on\_termination](#input\_ebs\_delete\_on\_termination) | Whether the volume should be destroyed on instance termination. | `bool` | `true` | no |
146147
| <a name="input_ebs_encrypted"></a> [ebs\_encrypted](#input\_ebs\_encrypted) | Enables EBS encryption on the volume. | `bool` | `true` | no |
147148
| <a name="input_ebs_volume_size"></a> [ebs\_volume\_size](#input\_ebs\_volume\_size) | The size of the volume in gigabytes. | `number` | `100` | no |

terraform/eks-addons.tf

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ resource "aws_eks_addon" "aws_ebs_csi_driver" {
5151
resolve_conflicts_on_create = "OVERWRITE"
5252
resolve_conflicts_on_update = "OVERWRITE"
5353

54-
service_account_role_arn = aws_iam_role.ebs_csi_controller_sa.arn
54+
service_account_role_arn = aws_iam_role.ebs_csi_controller.arn
5555

5656
preserve = true
5757

@@ -60,22 +60,6 @@ resource "aws_eks_addon" "aws_ebs_csi_driver" {
6060
}
6161
}
6262

63-
resource "aws_iam_role" "ebs_csi_controller_sa" {
64-
name = "ebs-csi-controller-sa"
65-
66-
assume_role_policy = templatefile("policies/oidc_assume_role_policy.json", {
67-
OIDC_ARN = aws_iam_openid_connect_provider.cluster.arn,
68-
OIDC_URL = replace(aws_iam_openid_connect_provider.cluster.url, "https://", ""),
69-
NAMESPACE = "kube-system",
70-
SA_NAME = "ebs-csi-controller-sa"
71-
})
72-
}
73-
74-
resource "aws_iam_role_policy_attachments_exclusive" "ebs_csi_controller_sa" {
75-
role_name = aws_iam_role.ebs_csi_controller_sa.name
76-
policy_arns = ["arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy"]
77-
}
78-
7963
resource "aws_eks_addon" "kubecost" {
8064
count = var.eks_addon_version_kubecost != null ? 1 : 0
8165

terraform/eks-managed-node-group-al2023.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module "eks_node_group_al2023" {
7777
version = aws_launch_template.cluster_al2023.latest_version
7878
}
7979

80-
capacity_type = "ON_DEMAND"
80+
capacity_type = var.capacity_type
8181

8282
tags = {
8383
"kubernetes.io/cluster/${var.name_prefix}" = "owned"

terraform/oidc-iam-roles.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,20 @@ resource "aws_iam_role_policy_attachments_exclusive" "adot_collector" {
136136
"arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy",
137137
]
138138
}
139+
140+
# Used by EBS CSI addon
141+
resource "aws_iam_role" "ebs_csi_controller" {
142+
name = "${var.name_prefix}-ebs-csi-controller"
143+
144+
assume_role_policy = templatefile("policies/oidc_assume_role_policy.json", {
145+
OIDC_ARN = aws_iam_openid_connect_provider.cluster.arn,
146+
OIDC_URL = replace(aws_iam_openid_connect_provider.cluster.url, "https://", ""),
147+
NAMESPACE = "kube-system",
148+
SA_NAME = "ebs-csi-controller-sa"
149+
})
150+
}
151+
152+
resource "aws_iam_role_policy_attachments_exclusive" "ebs_csi_controller" {
153+
role_name = aws_iam_role.ebs_csi_controller.name
154+
policy_arns = ["arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy"]
155+
}

terraform/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ variable "instance_types" {
4747
default = ["m6i.large"]
4848
}
4949

50+
variable "capacity_type" {
51+
type = string
52+
description = "Type of capacity associated with the EKS Node Group. Defaults to ON_DEMAND. Valid values: ON_DEMAND, SPOT."
53+
default = "ON_DEMAND"
54+
}
55+
5056
variable "eks_service_ipv4_cidr" {
5157
type = string
5258
description = "The CIDR block to assign Kubernetes service IP addresses from."

terraform/vpc.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "vpc_eks" {
22
source = "terraform-aws-modules/vpc/aws"
3-
version = "5.18.1"
3+
version = "6.0.1"
44

55
name = var.name_prefix
66

0 commit comments

Comments
 (0)