This file contains hidden or 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
# create some variables | |
variable "namespaces" { | |
type = list(string) | |
description = "List of namespaces to be created in our EKS Cluster." | |
} | |
# create all Namespaces into EKS | |
resource "kubernetes_namespace" "eks_namespaces" { | |
for_each = toset(var.namespaces) |
This file contains hidden or 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
external_dns_iam_role = "external-dns" | |
external_dns_chart_name = "external-dns" | |
external_dns_chart_repo = "https://kubernetes-sigs.github.io/external-dns/" | |
external_dns_chart_version = "1.9.0" | |
external_dns_values = { | |
"image.repository" = "k8s.gcr.io/external-dns/external-dns", | |
"image.tag" = "v0.11.0", | |
"logLevel" = "info", | |
"logFormat" = "json", |
This file contains hidden or 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
# create some variables | |
variable "external_dns_iam_role" { | |
type = string | |
description = "IAM Role Name associated with external-dns service." | |
} | |
variable "external_dns_chart_name" { | |
type = string | |
description = "Chart Name associated with external-dns service." | |
} |
This file contains hidden or 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
dns_base_domain = "eks.singh.cl" | |
ingress_gateway_name = "aws-load-balancer-controller" | |
ingress_gateway_iam_role = "load-balancer-controller" | |
ingress_gateway_chart_name = "aws-load-balancer-controller" | |
ingress_gateway_chart_repo = "https://aws.github.io/eks-charts" | |
ingress_gateway_chart_version = "1.4.1" |
This file contains hidden or 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
# create some variables | |
variable "dns_base_domain" { | |
type = string | |
description = "DNS Zone name to be used from EKS Ingress." | |
} | |
variable "ingress_gateway_name" { | |
type = string | |
description = "Load-balancer service name." | |
} | |
variable "ingress_gateway_iam_role" { |
This file contains hidden or 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
autoscaling_average_cpu = 30 | |
eks_managed_node_groups = { | |
"my-app-eks-x86" = { | |
ami_type = "AL2_x86_64" | |
min_size = 1 | |
max_size = 16 | |
desired_size = 1 | |
instance_types = [ | |
"t3.small", | |
"t3.medium", |
This file contains hidden or 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
# create some variables | |
variable "eks_managed_node_groups" { | |
type = map(any) | |
description = "Map of EKS managed node group definitions to create" | |
} | |
variable "autoscaling_average_cpu" { | |
type = number | |
description = "Average CPU threshold to autoscale EKS EC2 instances." | |
} |
This file contains hidden or 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
cluster_name = "my-app-eks" | |
iac_environment_tag = "development" | |
name_prefix = "my-app" | |
main_network_block = "10.0.0.0/16" | |
cluster_azs = ["us-east-1a", "us-east-1b", "us-east-1c"] | |
subnet_prefix_extension = 4 | |
zone_offset = 8 |
This file contains hidden or 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
# create some variables | |
variable "cluster_name" { | |
type = string | |
description = "EKS cluster name." | |
} | |
variable "name_prefix" { | |
type = string | |
description = "Prefix to be used on each infrastructure object Name created in AWS." | |
} | |
variable "main_network_block" { |
This file contains hidden or 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
provider "aws" { | |
version = "~> 2.57.0" | |
} | |
provider "random" { | |
version = "~> 2.2.1" | |
} | |
data "aws_caller_identity" "current" {} # used for accesing Account ID and ARN |