mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-26 03:11:06 +01:00
fix: Create false and avoid waiting forever for a non-existent cluster to respond (#789)
This commit is contained in:
@@ -46,7 +46,7 @@ resource "aws_eks_cluster" "this" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "null_resource" "wait_for_cluster" {
|
resource "null_resource" "wait_for_cluster" {
|
||||||
count = var.manage_aws_auth ? 1 : 0
|
count = var.create_eks && var.manage_aws_auth ? 1 : 0
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
aws_eks_cluster.this[0]
|
aws_eks_cluster.this[0]
|
||||||
|
|||||||
30
examples/create_false/main.tf
Normal file
30
examples/create_false/main.tf
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
provider "aws" {
|
||||||
|
region = var.region
|
||||||
|
}
|
||||||
|
|
||||||
|
data "aws_eks_cluster" "cluster" {
|
||||||
|
count = 0
|
||||||
|
name = module.eks.cluster_id
|
||||||
|
}
|
||||||
|
|
||||||
|
data "aws_eks_cluster_auth" "cluster" {
|
||||||
|
count = 0
|
||||||
|
name = module.eks.cluster_id
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "kubernetes" {
|
||||||
|
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.11"
|
||||||
|
}
|
||||||
|
|
||||||
|
module "eks" {
|
||||||
|
source = "../.."
|
||||||
|
create_eks = false
|
||||||
|
|
||||||
|
vpc_id = ""
|
||||||
|
cluster_name = ""
|
||||||
|
subnets = []
|
||||||
|
}
|
||||||
3
examples/create_false/variables.tf
Normal file
3
examples/create_false/variables.tf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
variable "region" {
|
||||||
|
default = "us-west-2"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user