-
Notifications
You must be signed in to change notification settings - Fork 16
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 ability to lock VPS #35
base: master
Are you sure you want to change the base?
Conversation
TransIP API expects int64, while Terraform Schema expects TypeInt
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.
The feature itself is welcome, but I'm hesitant to enable Update on this resource without a full implementation and tests, see comments on the source.
@@ -17,7 +18,7 @@ func resourceVps() *schema.Resource { | |||
return &schema.Resource{ | |||
Create: resourceVpsCreate, | |||
Read: resourceVpsRead, | |||
// Update: resourceVpsUpdate, | |||
Update: resourceVpsUpdate, |
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.
By allowing updates we give the expectation to the user all (non-computed) attributes on this resource can be updated. This will be reflected in the plan as well. But the implementation below does not take care of all these situations.
We should either:
- implement Update fully
- perform the customer lock update at the end of the create step.
I'm ok with either solution, but the second one seems the quickest to get this feature included for now.
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.
I've worked on implementing the update fully, but had some trouble adding tags
to a VPS. I commented it out for now, but for your information it resulted in the following error:
panic: interface conversion: interface {} is []interface {}, not []string
I've tested this locally but the VPS does not seem to unlock with the update.
|
As of right now the provider has no support for setting the Customer Lock for a VPS (only for reading). In our workflow we like to set the Customer Lock directly after ordering, as we've had some issues with the front-end before where the wrong VPS got modified, upgraded or even deleted.
When ordering a VPS, TransIP's API does not support setting a Customer Lock on the VPS directly. However, when updating the VPS after you've ordered it, you'll be able to set the Lock. Hence why I added the Update function and changed line 236 to Update instead of Read the VPS, so the lock will be set if configured; even when the VPS was not created yet.
If you've got any feedback or suggestions, please let me know.