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

Wait for the instance to be completely deleted #253

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Wait for the instance to be completely deleted #253

merged 1 commit into from
Jul 10, 2024

Conversation

uzaxirr
Copy link
Member

@uzaxirr uzaxirr commented Jul 9, 2024

Fixes: #252

To address this issue, we can implement dependencies explicitly in the Terraform configuration using the depends_on argument. This argument will make sure the reserved IP is destroyed after the instance.

provider "civo" {
  region = "LON1"
}

resource "civo_reserved_ip" "www" {
  name = "test-ip2"
}

resource "civo_instance" "foo" {
  hostname = "amazingthingy20"
  tags = ["python", "nginx"]
  notes = "This is a test-issue"
  size = "g3.xsmall"
  region = "LON1"
  reserved_ipv4 = civo_reserved_ip.www.id
  firewall_id = "default-default"
  disk_image = "debian-10"

  depends_on = [civo_reserved_ip.www]
}

Also i've made changes in the provider to ensure that when an instance is deleted, it properly waits for the deletion to be completed this will solve the issue

Screenshot 2024-07-10 at 1 07 11 AM

@uzaxirr uzaxirr self-assigned this Jul 9, 2024
Copy link
Contributor

@fernando-villalba fernando-villalba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but make sure you test it with a few different destroying scenarios to ensure it doesn't make destroying operations too long in some cases.

@uzaxirr
Copy link
Member Author

uzaxirr commented Jul 10, 2024

Looks good to me, but make sure you test it with a few different destroying scenarios to ensure it doesn't make destroying operations too long in some cases.

Yes, I have tested it locally before raising the PR

@uzaxirr uzaxirr merged commit a675626 into master Jul 10, 2024
3 checks passed
@uzaxirr uzaxirr deleted the inst-del branch July 10, 2024 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants