-
Notifications
You must be signed in to change notification settings - Fork 157
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
Support for source-name and source-url on tfe_workspace #392
Comments
Update on my workaround idea, for the curious... I have been successful in using a curl provisioner as a workaround in the past, see: #383 However, in this case, Ah well. It was at least worth checking, just in case. |
The TFE SDK does actually contain So I've added this: Not had a chance to test it yet though |
With a source set...
|
Updating the attributes, behaviour is as expected. Terraform destroys then recreates the workspace. This makes sense, as these source parameters can only be set at workspace creation.
However, when it comes to removing the attributes...
TF tries to set the parameter regardless, and as such it fails validation. I don't have time to do that today, but it shouldn't be a big change. |
Turns out I did, in fact, have time. Fixed, and PR incoming (probably tomorrow on that one though). |
Addresses hashicorp#392 The TFE SDK does actually contain `SourceName` and `SourceURL` fields already: https://github.com/hashicorp/go-tfe/blob/main/workspace.go#L129-L130 This is currently untested
PR merged 🥳 & closing this issue. |
Use-cases
source-name and source-url are currently listed as beta
https://www.terraform.io/docs/cloud/api/workspaces.html
These result in "Created via <SOURCE NAME>" to be displayed on the workspace.
Attempted Solutions
N/A as this is not yet implemented
Tempted to do a short-term workaround using a provisioner to update the workspace with a PATCH though:
https://www.terraform.io/docs/cloud/api/workspaces.html#update-a-workspace
Proposal
Add the source-name and source-url parameters to the tfe_workspace resource.
I appreciate we may not want to actually do this while those parameters are listed as "beta" though
The text was updated successfully, but these errors were encountered: