Skip to content

Commit

Permalink
Create : TF | Resource | EKS Cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
unchaptered committed Mar 8, 2024
1 parent 3b2bc02 commit 6209f1a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions terraform/resources/aws/eks/cluster/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
resource "aws_eks_cluster" "resource" {
name = var.name
role_arn = var.role_arn

enabled_cluster_log_types = [ "api", "audit" ]
vpc_config {
# Require
subnet_ids = var.vpc_config.subnet_ids

# Optional
security_group_ids = var.vpc_config.security_group_ids
public_access_cidrs = var.vpc_config.public_access_cidrs
endpoint_private_access = var.vpc_config.endpoint_private_access
endpoint_public_access = var.vpc_config.endpoint_public_access
}
}

variable "name" {
type = string
}
variable "role_arn" {
type = string
sensitive = true
}

variable "vpc_config" {
type = object({
subnet_ids = list(string)
security_group_ids = list(string)
public_access_cidrs = list(string)
endpoint_private_access = bool
endpoint_public_access = bool
})

default = {
public_access_cidrs = ["0.0.0.0/0"]
security_group_ids = []

endpoint_private_access = false
endpoint_public_access = true
}
}
Empty file.
Empty file.

0 comments on commit 6209f1a

Please sign in to comment.