Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ terraform.tfvars
*.conf

# Testing output files
test/test_output/*
test/test_output/*
4 changes: 2 additions & 2 deletions docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Additional node pools can be created separately from the default node pool. This
| <div style="width:50px">Name</div> | <div style="width:150px">Description</div> | <div style="width:50px">Type</div> | <div style="width:75px">Default</div> | <div style="width:150px">Notes</div> |
| :--- | :--- | :--- | :--- | :--- |
| vm_type | Type of the node pool VMs | string | | https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html |
| cpu_type | Processor type CPU/GPU | string | AL2_x86_64| [AMI type](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) – Choose Amazon Linux 2 (AL2_x86_64) for Linux non-GPU instances, Amazon Linux 2 GPU Enabled (AL2_x86_64_GPU) for Linux GPU instances|
| cpu_type | Processor type CPU/GPU | string | AL2023_x86_64_STANDARD| [AMI type](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) – Choose Amazon Linux 2 (AL2023_x86_64_STANDARD) for Linux non-GPU instances, Amazon Linux 2 GPU Enabled (AL2023_x86_64_STANDARD_GPU) for Linux GPU instances|
| os_disk_type | Disk type for node pool VMs | string | | `gp2` or `io1` |
| os_disk_size | Disk size for node pool VMs in GB | number | | |
| os_disk_iops | Amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html) | number | | For `io1`, you MUST set the value to your desired IOPS value. Reference [Amazon EBS volume types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html) for details on values based on the `os_disk_type` selected.|
Expand Down Expand Up @@ -439,4 +439,4 @@ postgres_servers = {
<!--| Name | Description | Type | Default | Notes | -->
| <div style="width:50px">Name</div> | <div style="width:150px">Description</div> | <div style="width:50px">Type</div> | <div style="width:75px">Default</div> | <div style="width:150px">Notes</div> |
| :--- | :--- | :--- | :--- | :--- |
| cluster_enabled_log_types | List of audits to record from EKS cluster in CloudWatch | list(string) | | More information on the audit types can be [found here.](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) |
| cluster_enabled_log_types | List of audits to record from EKS cluster in CloudWatch | list(string) | | More information on the audit types can be [found here.](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) |
10 changes: 5 additions & 5 deletions examples/sample-input-byo.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ subnet_ids = { # only needed if using pre-existing subnets
"database" : ["existing-database-subnet-id1", "existing-database-subnet-id2"] # only when 'create_postgres=true'
}
nat_id = "<existing-NAT-gateway-id>"
security_group_id = "<existing-security-group-id>" # only needed if using pre-existing Security Group
security_group_id = "<existing-security-group-id>" # only needed if using pre-existing Security Group
cluster_security_group_id = "<existing-cluster-security-group-id>" # only needed if using pre-existing Cluster Security Group
workers_security_group_id = "<existing-workers-security-group-id>" # only needed if using pre-existing Security Group for Node Group VMs

Expand Down Expand Up @@ -52,7 +52,7 @@ storage_type = "standard"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -69,7 +69,7 @@ node_pools = {
},
compute = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -87,7 +87,7 @@ node_pools = {
},
stateless = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -104,7 +104,7 @@ node_pools = {
},
stateful = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
10 changes: 5 additions & 5 deletions examples/sample-input-connect.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ storage_type = "standard"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -57,7 +57,7 @@ node_pools = {
},
compute = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -75,7 +75,7 @@ node_pools = {
},
connect = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -93,7 +93,7 @@ node_pools = {
},
stateless = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -110,7 +110,7 @@ node_pools = {
},
stateful = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
8 changes: 4 additions & 4 deletions examples/sample-input-custom-data.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ storage_type = "standard"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -57,7 +57,7 @@ node_pools = {
},
compute = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -75,7 +75,7 @@ node_pools = {
},
stateless = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -92,7 +92,7 @@ node_pools = {
},
stateful = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
10 changes: 5 additions & 5 deletions examples/sample-input-gpu.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ storage_type = "standard"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -57,7 +57,7 @@ node_pools = {
},
gpu_cas = {
"vm_type" = "p2.8xlarge"
"cpu_type" = "AL2_x86_64_GPU"
"cpu_type" = "AL2023_x86_64_STANDARD_GPU"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -74,7 +74,7 @@ node_pools = {
},
compute = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -92,7 +92,7 @@ node_pools = {
},
stateless = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -109,7 +109,7 @@ node_pools = {
},
stateful = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
8 changes: 4 additions & 4 deletions examples/sample-input-ha.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ storage_type = "ha"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -57,7 +57,7 @@ node_pools = {
},
compute = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -75,7 +75,7 @@ node_pools = {
},
stateless = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -92,7 +92,7 @@ node_pools = {
},
stateful = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
4 changes: 2 additions & 2 deletions examples/sample-input-minimal.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cluster_node_pool_mode = "minimal"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -58,7 +58,7 @@ node_pools = {
},
generic = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
10 changes: 5 additions & 5 deletions examples/sample-input-singlestore.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ storage_type = "standard"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -57,7 +57,7 @@ node_pools = {
},
compute = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -75,7 +75,7 @@ node_pools = {
},
stateless = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -92,7 +92,7 @@ node_pools = {
},
stateful = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -109,7 +109,7 @@ node_pools = {
},
singlestore = {
"vm_type" = "r6idn.4xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
8 changes: 4 additions & 4 deletions examples/sample-input.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ storage_type = "standard"
node_pools = {
cas = {
"vm_type" = "r6idn.2xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -57,7 +57,7 @@ node_pools = {
},
compute = {
"vm_type" = "m6idn.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -75,7 +75,7 @@ node_pools = {
},
stateless = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand All @@ -92,7 +92,7 @@ node_pools = {
},
stateful = {
"vm_type" = "m6in.xlarge"
"cpu_type" = "AL2_x86_64"
"cpu_type" = "AL2023_x86_64_STANDARD"
"os_disk_type" = "gp2"
"os_disk_size" = 200
"os_disk_iops" = 0
Expand Down
11 changes: 6 additions & 5 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ locals {
caller_is_user = strcontains(data.aws_caller_identity.terraform.arn, ":user")

# AWS caller role name derived from ARN value
aws_caller_role_name = local.caller_is_user ? "" : element(split("/", data.aws_caller_identity.terraform.arn), length(split("/", data.aws_caller_identity.terraform.arn)) - 2)
aws_caller_role_name = local.caller_is_user ? "" : element(split("/", data.aws_caller_identity.terraform.arn), length(split("/", data.aws_caller_identity.terraform.arn)) - 2)

# General
security_group_id = var.security_group_id == null ? aws_security_group.sg[0].id : data.aws_security_group.sg[0].id
Expand Down Expand Up @@ -72,6 +72,7 @@ locals {
default = {
name = "default"
instance_types = [var.default_nodepool_vm_type]
ami_type = var.default_nodepool_cpu_type
block_device_mappings = {
xvda = {
device_name = "/dev/xvda"
Expand All @@ -92,7 +93,8 @@ locals {
"effect" = length(regexall(":No", taint)) > 0 ? upper(replace(split(":", split("=", taint)[1])[1], "No", "NO_")) : upper(replace(split(":", split("=", taint)[1])[1], "No", "_NO_"))
}
}
labels = var.default_nodepool_labels
labels = var.default_nodepool_labels
schedules = var.default_nodepool_schedules
# User data
bootstrap_extra_args = "--kubelet-extra-args '--node-labels=${replace(replace(jsonencode(var.default_nodepool_labels), "/[\"\\{\\}]/", ""), ":", "=")} --register-with-taints=${join(",", var.default_nodepool_taints)} ' "
pre_bootstrap_user_data = (var.default_nodepool_custom_data != "" ? file(var.default_nodepool_custom_data) : "")
Expand Down Expand Up @@ -142,7 +144,8 @@ locals {
"effect" = length(regexall(":No", taint)) > 0 ? upper(replace(split(":", split("=", taint)[1])[1], "No", "NO_")) : upper(replace(split(":", split("=", taint)[1])[1], "No", "_NO_"))
}
}
labels = np_value.node_labels
labels = np_value.node_labels
schedules = np_value.schedules
# User data
bootstrap_extra_args = "--kubelet-extra-args '--node-labels=${replace(replace(jsonencode(np_value.node_labels), "/[\"\\{\\}]/", ""), ":", "=")} --register-with-taints=${join(",", np_value.node_taints)}' "
pre_bootstrap_user_data = (np_value.custom_data != "" ? file(np_value.custom_data) : "")
Expand Down Expand Up @@ -172,15 +175,13 @@ locals {
v.server_port
] : [] : []
postgres_cidr_port_pairs = setproduct(local.postgres_sgr_ports, local.postgres_public_access_cidrs)

ingress_pairs = length(local.postgres_cidr_port_pairs) != 0 ? { for pair in local.postgres_cidr_port_pairs :
"${pair[0]}-${pair[1]}" => {
"server_port" : pair[0],
"cidr" : pair[1]
}
} : {}


postgres_outputs = length(module.postgresql) != 0 ? { for k, v in module.postgresql :
k => {
"server_name" : module.postgresql[k].db_instance_identifier,
Expand Down
Loading
Loading