Skip to content

Commit

Permalink
fix the vpc blueprints example
Browse files Browse the repository at this point in the history
  • Loading branch information
Z4ck404 committed Oct 31, 2024
1 parent b4117a8 commit 07a33a9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
43 changes: 28 additions & 15 deletions examples/from-vpc-eks-blueprint/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ provider "helm" {
}

module "eks_blueprints" {
source = "github.com/aws-ia/terraform-aws-eks-blueprints"
source = "github.com/aws-ia/terraform-aws-eks-blueprints?ref=v4.32.1"

# EKS CLUSTER
cluster_name = var.cluster_name
cluster_version = var.cluster_version
vpc_id = var.vpc_id
private_subnet_ids = var.private_subnet_ids
public_subnet_ids = var.public_subnet_ids
private_subnet_ids = var.private_subnets_ids
public_subnet_ids = var.public_subnets_ids
map_roles = [
{
rolearn = aws_iam_role.nodes.arn
Expand All @@ -60,22 +60,37 @@ module "eks_blueprints" {
}
]

tags = local.tags
}

module "eks_blueprints_kubernetes_addons" {
source = "github.com/aws-ia/terraform-aws-eks-blueprints//modules/kubernetes-addons"
module "eks_blueprints_addons" {
source = "aws-ia/eks-blueprints-addons/aws"
version = "~> 1.18"

eks_cluster_id = module.eks_blueprints.eks_cluster_id
cluster_name = var.cluster_name
cluster_endpoint = module.eks_blueprints.eks_cluster_endpoint
cluster_version = module.eks_blueprints.eks_cluster_version
oidc_provider_arn = module.eks_blueprints.eks_oidc_provider_arn

eks_addons = {
aws-ebs-csi-driver = {
most_recent = true
}
coredns = {
most_recent = true
}
vpc-cni = {
most_recent = true
}
kube-proxy = {
most_recent = true
}
}

#K8s Add-ons
enable_metrics_server = true

depends_on = [
module.ocean-aws-k8s
]
}


output "configure_kubectl" {
description = "Configure kubectl: make sure you're logged in with the correct AWS profile and run the following command to update your kubeconfig"
value = module.eks_blueprints.configure_kubectl
Expand Down Expand Up @@ -139,13 +154,11 @@ module "ocean-aws-k8s" {
# Configuration
cluster_name = var.cluster_name
region = var.aws_region
subnet_ids = concat(var.public_subnet_ids, var.private_subnet_ids)
subnet_ids = concat(var.public_subnets_ids, var.private_subnets_ids)
worker_instance_profile_arn = aws_iam_instance_profile.profile.arn
security_groups = [module.eks_blueprints.cluster_primary_security_group_id]
min_size = 0

tags = local.tags

shutdown_hours = {
time_windows = var.shutdown_time_windows,
is_enabled = var.enable_shutdown_hours
Expand Down Expand Up @@ -187,7 +200,7 @@ module "ocean-spark" {
ocean_cluster_id = module.ocean-aws-k8s.ocean_id

cluster_config = {
cluster_name = module.eks.cluster_id
cluster_name = var.cluster_name
certificate_authority_data = module.eks_blueprints.eks_cluster_certificate_authority_data
server_endpoint = module.eks_blueprints.eks_cluster_endpoint
token = data.aws_eks_cluster_auth.this.token
Expand Down
5 changes: 3 additions & 2 deletions examples/from-vpc-eks-blueprint/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,20 @@ variable "vpc_id" {
type = string
}

variable "private_subnets" {
variable "private_subnets_ids" {
description = "AWS private subnet IDs"
type = list(any)
}

variable "public_subnets" {
variable "public_subnets_ids" {
description = "AWS public subnet IDs"
type = list(any)
}

variable "creator_email" {
description = "Creator's email"
type = string
default = ""
}

variable "shutdown_time_windows" {
Expand Down

0 comments on commit 07a33a9

Please sign in to comment.