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

Deleted aws_customer_gateway is still updated #7136

Closed
clstokes opened this issue Jun 12, 2016 · 3 comments · Fixed by #7482
Closed

Deleted aws_customer_gateway is still updated #7136

clstokes opened this issue Jun 12, 2016 · 3 comments · Fixed by #7482
Assignees
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community

Comments

@clstokes
Copy link
Contributor

Terraform still performs updates to a deleted AWS customer gateway (CGW). Like terminated EC2 instances, deleted CGWS linger around for a time after they've been deleted with a state of deleted. While in deleted state, Terraform will continue to apply changes to the CQW.

Terraform Version

$ terraform version
Terraform v0.6.16

Affected Resource(s)

  • aws_customer_gateway

Terraform Configuration Files

resource "aws_customer_gateway" "main" {
  bgp_asn    = 60000
  ip_address = "172.83.124.10"
  type       = "ipsec.1"

  tags {
    Name = "recreate-test"
  }
}

output "cgw_id" {
  value = "${aws_customer_gateway.main.id}"
}

Expected Behavior

Terraform should recognize that the CGW has been deleted and re-create it if still present in my configuration.

Actual Behavior

Terraform applies changes to the deleted CGW.

Steps to Reproduce

  1. terraform apply
  2. aws ec2 describe-customer-gateways --customer-gateway-id $(terraform output cgw_id)
  3. aws ec2 delete-customer-gateway --customer-gateway-id $(terraform output cgw_id)
  4. aws ec2 describe-customer-gateways --customer-gateway-id $(terraform output cgw_id)
  5. Check for deleted status in previous step.
  6. terraform apply
  7. Observe Terraform updating the deleted CGW.
@stack72
Copy link
Contributor

stack72 commented Jun 29, 2016

Hey @clstokes

Here is what I have found:

  1. terraform apply of your code creates a gateway
  2. Deleting the gateway from the console and then terraform plan shows no changes
  3. made some code changes to remove deleted from state
  4. terraform plan now shows the following:
+ aws_customer_gateway.main
    bgp_asn:    "60000"
    ip_address: "172.83.124.10"
    tags.%:     "1"
    tags.Name:  "recreate-test"
    type:       "ipsec.1"


Plan: 1 to add, 0 to change, 0 to destroy.
  1. terraform apply succeeds

the issue here is that the gateway_id changes - when we pass in the create again to AWS, it creates a NEW gateway, rather than updating the old one

screen shot 2016-06-29 at 13 37 20

Is this acceptable behaviour for you?

Paul

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Jun 29, 2016
@stack72 stack72 self-assigned this Jun 29, 2016
@clstokes
Copy link
Contributor Author

clstokes commented Jul 4, 2016

Hey @stack72, I think this is exactly what we need - essentially treating the deleted gateway as if AWS returned a 404 that it no longer existed.

@ghost
Copy link

ghost commented Apr 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants