Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibm_tg_gateway delete is not complete when it has reported deleted #1783

Closed
powellquiring opened this issue Aug 7, 2020 · 1 comment
Closed
Assignees

Comments

@powellquiring
Copy link

Change the resource id of the transit gateway fails, apply again and it works:

$ cat main.tf
variable "ibmcloud_api_key" {
}
variable "resource_group_name" {
  default = "default"
}
variable "region" {
  default = "us-south"
}

variable "basename" {
  description = "Name for the VPC to create and prefix to use for all other resources."
  default     = "example"
}

provider "ibm" {
  region           = var.region
  ibmcloud_api_key = var.ibmcloud_api_key
  generation       = 2
}

data "ibm_resource_group" "group" {
  name = var.resource_group_name
}

#resource "ibm_tg_gateway" "tgw2"{
resource "ibm_tg_gateway" "tgw"{
  name              = "${var.basename}-tgw"
  location          = var.region
  global            = false
  resource_group    = data.ibm_resource_group.group.id
} 
$ terraform apply -auto-approve
$ edit main.tf

Change the id of ibm_tg_gateway from tgw to tgw2

$ terraform apply -auto-approve
data.ibm_resource_group.group: Refreshing state...
ibm_tg_gateway.tgw: Refreshing state... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f]
ibm_tg_gateway.tgw: Destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f]
ibm_tg_gateway.tgw2: Creating...
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 10s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 20s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 30s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 40s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 50s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 1m0s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 1m10s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 1m20s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 1m30s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 1m40s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 1m50s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 2m0s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 2m10s elapsed]
ibm_tg_gateway.tgw: Still destroying... [id=414a2cdf-4bee-4e4f-b1df-d570c2a57a0f, 2m20s elapsed]
ibm_tg_gateway.tgw: Destruction complete after 2m29s

Error: A gateway with the same name already exists.

  on main.tf line 25, in resource "ibm_tg_gateway" "tgw2":
  25: resource "ibm_tg_gateway" "tgw2"{

Try again and it works

$ terraform apply -auto-approve
data.ibm_resource_group.group: Refreshing state...
ibm_tg_gateway.tgw2: Creating...
ibm_tg_gateway.tgw2: Still creating... [10s elapsed]
ibm_tg_gateway.tgw2: Still creating... [20s elapsed]
ibm_tg_gateway.tgw2: Still creating... [30s elapsed]
ibm_tg_gateway.tgw2: Still creating... [40s elapsed]
ibm_tg_gateway.tgw2: Creation complete after 43s [id=6375ed6f-3e1c-42b6-9ebb-b80a6751cd33]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
$ terraform version
Terraform v0.12.24
+ provider.ibm v1.10.0

Your version of Terraform is out of date! The latest version
is 0.12.29. You can update by downloading from https://www.terraform.io/downloads.html
@hkantare
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants