mirror of
https://github.com/terraform-aws-modules/terraform-aws-eks.git
synced 2025-09-09 19:32:58 +08:00
Readme and example updates.
This commit is contained in:
@@ -24,17 +24,19 @@ provider "template" {
|
||||
}
|
||||
|
||||
data "aws_eks_cluster" "cluster" {
|
||||
name = module.eks.cluster_id
|
||||
count = var.create_eks ? 1 : 0
|
||||
name = module.eks.cluster_id
|
||||
}
|
||||
|
||||
data "aws_eks_cluster_auth" "cluster" {
|
||||
name = module.eks.cluster_id
|
||||
count = var.create_eks ? 1 : 0
|
||||
name = module.eks.cluster_id
|
||||
}
|
||||
|
||||
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
|
||||
host = element(concat(data.aws_eks_cluster.cluster[*].endpoint, list("")), 0)
|
||||
cluster_ca_certificate = base64decode(element(concat(data.aws_eks_cluster.cluster[*].certificate_authority.0.data, list("")), 0))
|
||||
token = element(concat(data.aws_eks_cluster_auth.cluster[*].token, list("")), 0)
|
||||
load_config_file = false
|
||||
version = "~> 1.10"
|
||||
}
|
||||
@@ -128,6 +130,7 @@ module "vpc" {
|
||||
|
||||
module "eks" {
|
||||
source = "../.."
|
||||
create_eks = var.create_eks
|
||||
cluster_name = local.cluster_name
|
||||
subnets = module.vpc.private_subnets
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@ variable "region" {
|
||||
default = "us-west-2"
|
||||
}
|
||||
|
||||
variable "create_eks" {
|
||||
default = true
|
||||
description = "Set to false to skip creating EKS cluster."
|
||||
}
|
||||
|
||||
variable "map_accounts" {
|
||||
description = "Additional AWS account numbers to add to the aws-auth configmap."
|
||||
type = list(string)
|
||||
|
||||
Reference in New Issue
Block a user