alibaba / terraform-provider

[DEPRECATED] This repo has been deprecated and please access https://github.com/terraform-providers/terraform-provider-alicloud
Apache License 2.0
384 stars 117 forks source link

terraform job should fail immediately after kubernetes create failed #488

Open georgedriver opened 6 years ago

georgedriver commented 6 years ago

terraform job should fail immediately after kubernetes create failed

Issue

terraform job should fail immediately after kubernetes create failed

Version

terraform version
Terraform v0.11.7
+ provider.alicloud (unversioned)   <<< Build from master branch with commit: ab466d155bf98c04d80de6dea2c3fc513419110f

Detailed error on aliyun page

No matter what kind of error, the terraform job still running until timeout. 

Code

main.tf

// Provider specific configs
provider "alicloud" {
  access_key = "${var.alicloud_access_key}"
  secret_key = "${var.alicloud_secret_key}"
  region     = "${var.region}"
}

data "alicloud_instance_types" "default-master" {
  availability_zone = "${var.availability_zone}"
  cpu_core_count    = 2
  memory_size       = 4
}

data "alicloud_instance_types" "default-worker" {
  availability_zone = "${var.availability_zone}"
  cpu_core_count    = 8
  memory_size       = 16
}

resource "alicloud_cs_kubernetes" "lims-cluster-1" {
  name                  = "lims-cluster-1"
  new_nat_gateway       = true
  master_instance_type  = "${data.alicloud_instance_types.default-master.instance_types.0.id}"
  worker_instance_type  = "${data.alicloud_instance_types.default-worker.instance_types.0.id}"
  worker_number         = 1
  master_disk_category  = "cloud_efficiency"
  worker_disk_category  = "cloud_efficiency"
  master_disk_size      = 40
  worker_disk_size      = 100
  password              = "${var.ecs_password}"
  pod_cidr              = "${var.pod_cidr}"
  service_cidr          = "${var.service_cidr}"
  enable_ssh            = true
  install_cloud_monitor = true
}

variable "alicloud_access_key" { default = "" }
variable "alicloud_secret_key" { default = "" }
variable "region" {}
variable "availability_zone" {}
variable "pod_cidr" {}
variable "service_cidr" {}
variable "ecs_password" {}

terraform.tfvars

region = "cn-shenzhen"
availability_zone = "cn-shenzhen-a"
ecs_password = "Pass123"
service_cidr = "10.128.1.0/24"
pod_cidr = "10.129.1.0/24"

How to reproduce

export TF_VAR_alicloud_access_key='your access key'
export TF_VAR_alicloud_secret_key='your secret key'

terraform init
terraform plan 
terraform apply

phenomena

Look into aliyun Kubernetes manage page, you will get the error about "invalid password format", but the terraform keep running.

xiaozhu36 commented 5 years ago

HI @georgedriver I am sorry for late reply. Does it still exist?