Skip to content

Commit

Permalink
Example that can terraform plan for sample output.
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Sep 26, 2023
1 parent 9c00be5 commit dc76c24
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/simple/eks-configuration.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module "eks-configuration" {
source = "git@github.it.census.gov:SOA/tfmod-eks-storage-classes.git//"
#source = "git@github.it.census.gov:SOA/tfmod-eks-configuration.git//?ref=v1.0.0"

region = var.region
profile = var.profile
vpc_id = var.vpc_id

cluster_name = var.cluster_name
subnets = var.subnets
security_group_all_worker_mgmt_id = var.security_group_all_worker_mgmt_id

oidc_provider_arn = var.oidc_provider_arn
eks_managed_node_groups_autoscaling_group_names = var.eks_managed_node_groups_autoscaling_group_names
}
33 changes: 33 additions & 0 deletions examples/simple/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
terraform {
required_version = ">= 1.5.0"
}

provider "aws" {
profile = var.profile
region = var.region
}

data "aws_eks_cluster" "cluster" {
name = var.cluster_name
}

data "aws_eks_cluster_auth" "cluster" {
name = var.cluster_name
}

provider "kubernetes" {
host = data.aws_eks_cluster.cluster.endpoint

cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}

provider "helm" {
kubernetes {
host = data.aws_eks_cluster.cluster.endpoint

cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
}

40 changes: 40 additions & 0 deletions examples/simple/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
variable "cluster_name" {
description = "EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev)"
type = string
}

variable "region" {
description = "AWS region"
type = string
}

variable "profile" {
description = "AWS config profile"
type = string
}

variable "vpc_id" {
description = "Specify the VPC id that is used by this cluster"
type = string
}

variable "subnets" {
description = "Specify the subnets used by this cluster"
type = list(string)
}

variable "security_group_all_worker_mgmt_id" {
description = "The security group representing all of the worker nodes in the cluster."
type = string
}

variable "eks_managed_node_groups_autoscaling_group_names" {
description = "List of the autoscaling group names created by EKS managed node groups"
type = list(string)
}

variable "oidc_provider_arn" {
description = "The ARN of the OIDC Provider if `enable_irsa = true`"
type = string
}

0 comments on commit dc76c24

Please sign in to comment.