BUG/MEDIUM: edge: fix remapping of service to another workspace #245
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It was recently identified by @BrooksCunningham that updating the
site_short_name
on asigsci_edge_deployment_service
object resulted in an error (failed to attach service
). Successive runs ofterraform apply
would result in a succes, however, ultimately it was not working as expected.This update of the
site_short_name
is what is known and documented as a "re-map" [1]. As the documentation shows, it requires first detaching the old workspace from the service using aDELETE
call and then attaching a new workspace with aPUT
call.Previously, both Create & Update were using the same function, which prohibited proper detachment.
This commit introduces a update specific function
updateEdgeDeploymentService
and renames the existingcreateOrUpdateEdgeDeploymentService
function to be exclusively used with Create (createEdgeDeploymentService
).[1] https://docs.fastly.com/en/ngwaf/configuring-edge-waf-deployments-using-the-next-gen-waf-control-panel#re-mapping-a-fastly-cdn-service-to-a-new-site-workspace