-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add deletion protection to resource_compute_instance #1205
Conversation
Added unit tests:
@danawillow I think this is ready for review! $ make testacc TEST=./google TESTARGS='-run=TestAccComputeInstance_basic1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccComputeInstance_basic1 -timeout 120m
=== RUN TestAccComputeInstance_basic1
--- PASS: TestAccComputeInstance_basic1 (59.16s)
PASS
ok github.com/terraform-providers/terraform-provider-google/google 59.188s $ make testacc TEST=./google TESTARGS='-run=TestAccComputeInstance_deletionProtectionExplicitFalse'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccComputeInstance_deletionProtectionExplicitFalse -timeout 120m
=== RUN TestAccComputeInstance_deletionProtectionExplicitFalse
--- PASS: TestAccComputeInstance_deletionProtectionExplicitFalse (179.77s)
PASS
ok github.com/terraform-providers/terraform-provider-google/google 179.803s $ make testacc TEST=./google TESTARGS='-run=TestAccComputeInstance_deletionProtectionExplicitTrueAndUpdateFalse'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccComputeInstance_deletionProtectionExplicitTrueAndUpdateFalse -timeout 120m
=== RUN TestAccComputeInstance_deletionProtectionExplicitTrueAndUpdateFalse
--- PASS: TestAccComputeInstance_deletionProtectionExplicitTrueAndUpdateFalse (81.45s)
PASS
ok github.com/terraform-providers/terraform-provider-google/google 81.485s |
"google_compute_instance.foobar", &instance), | ||
testAccCheckComputeInstanceHasConfiguredDeletionProtection(&instance, true), | ||
), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you toss an ImportStateVerify
test step here between step 0 and step 1? That way we can be sure that this works on import. I'm sure it does, it's just something we're trying to do lately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Updating commit incoming.
This looks great! Thanks for the contribution. |
Great! Running acceptance tests now. |
Tests pass, great. :) |
IAP IAM AppEngine Version
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
deletion_protection
boolean parameter forgoogle_compute_instance
resources (inresource_compute_instance.go
).This resolves #956.