Skip to content

BUG/MEDIUM: edge: fix remapping of service to another workspace #245

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

Merged

Conversation

daniel-corbett
Copy link
Collaborator

It was recently identified by @BrooksCunningham that updating the site_short_name on a sigsci_edge_deployment_service object resulted in an error (failed to attach service). Successive runs of terraform 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 a DELETE call and then attaching a new workspace with a PUT 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 existing createOrUpdateEdgeDeploymentService 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

It was recently identified by @BrooksCunningham that updating the
`site_short_name` on a `sigsci_edge_deployment_service` object resulted in an
error (`failed to attach service`). Successive runs of `terraform 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 a `DELETE` call and then attaching a new
workspace with a `PUT` 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 existing `createOrUpdateEdgeDeploymentService` 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
@daniel-corbett daniel-corbett merged commit a2f0119 into signalsciences:main May 12, 2025
2 checks passed
@daniel-corbett daniel-corbett deleted the dcorbett/fix-site-remap0509 branch May 12, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants