Remove a deployment
Removing a deployment deletes your software from the customer's cloud when they turn the feature off or leave. This page is for products that launch the portal with a Deploy button or build it in with your own setup screen. When you send a link, your team removes deployments from the dashboard or CLI.
Example UI /Removing
Document processing
Settings · Deploy in your cloud
Removing the service from your AWS account
Documents are processed by our hosted service again. This usually takes a few minutes.
- Account
- 123456789012 · us-east-1
- Removal started
- Jan 20, 14:02 by dana@customer-1.example
Your product starts removal with one API call. Alien deletes what it manages, and the customer's admin deletes what their initial setup created:
- 1
Start removalyou
Your backend calls delete with action cleanup.
- 2
Delete live resourcesAlien
Alien removes what it created on each release.
- 3
Delete the stackcustomer admin
Status is teardown-required or retention-required until the admin deletes the stack.
- 4
Close the recordyou
Status becomes deleted, or retained when data was kept. Clear your state.
Follow removal covers each state after the call.
Switch traffic off first
Server. Before you call delete, move your product off the deployment:
- Point traffic back to your hosted service.
- Stop sending work to the customer's endpoint.
- Clear your own active flag.
Once removal starts, the endpoint can disappear at any moment.
Start removal
Server. Removal needs a key with the project.admin role. Create one with alien api-keys create --for project-admin, and keep it apart from the key that reads status.
POST /v1/deployments/{id}/delete with action: "cleanup". Cleanup keeps the customer's data: see Keep or erase data.
import { Alien } from "@alienplatform/platform-api"
// A project.admin key: alien api-keys create --for project-admin
const admin = new Alien({ apiKey: process.env.ALIEN_ADMIN_API_KEY, workspace: "acme" })
export async function removeDeployment(deploymentId: string) {
const res = await admin.deployments.delete(deploymentId, { action: "cleanup" })
return res.message
}The call accepts the request and returns. Your page follows removal by polling, below.
Your team can also remove a deployment by hand, for example from support. In the dashboard, open the deployment under Deployments and delete it: the Delete Deployment dialog asks you to type the deployment's name. From the CLI:
alien deployments delete customer-1/customer-1Keep or erase data
Some resources hold the customer's data: buckets, databases, key-value stores, queues, vaults, and keys. By default, removal keeps them in the customer's account.
action | Data resources | CLI |
|---|---|---|
cleanup or retain | Kept in the customer's account | alien deployments delete customer-1/customer-1 |
erase | Deleted, permanently | alien deployments delete customer-1/customer-1 --erase-data |
- Ask before you erase. Erasing can't be undone. Confirm it with the customer in your product, in words: "Delete all documents stored in your AWS account."
- Erase later. A removal that kept data can be turned into an erase afterwards: call delete again with
action: "erase". - One choice at a time. While a removal runs, a request with the other choice fails with
409DEPLOYMENT_DELETE_POLICY_CONFLICT. Wait for it to finish.
Other delete actions
action | Use |
|---|---|
cleanup | The normal path above. Keeps data, like retain. |
retain | Same as cleanup. |
erase | Also deletes the data resources. See Keep or erase data. |
forget | Delete only Alien's record, without touching the cloud. Use it for a deployment whose initial setup never ran, or whose resources are already gone. Needs a workspace admin key. From the CLI: alien deployments delete customer-1/customer-1 --force customer-1. |
detach | Stop managing an imported pull deployment without deleting it. |
Never use forget on a deployment whose initial setup ran: the resources keep running in the customer's account with nothing managing them.
The cleanup call over REST, for readers without one of the languages above:
curl --fail-with-body -X POST "https://api.alien.dev/v1/deployments/$DEPLOYMENT_ID/delete" \
-H "Authorization: Bearer $ALIEN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "cleanup"}'The setup link
The stack holds the deployment's own token, not the setup link's, so revoking the link doesn't block removal.
Once the status is deleted, revoke any link you no longer need from the deployment group's Deployment links card in the dashboard. Stacks launched with the link's own token, before deployments were created first, can still finish deletion after the link stops working; see Link lifetime.
Test it
- Remove with data. Upload a file to the deployment's bucket, remove it with
cleanup, and confirm the bucket is still in the account afterretained. - Click twice. Start removal twice, and confirm the second call doesn't start a second removal.
- Erase later. Remove with
cleanup, then call delete withaction: "erase", and confirm the bucket is gone.
Next
- Follow removal: the states until the deployment is gone
- Follow a deployment: the admin's last step for every setup method
Updates and connection
Keep your deployment card honest after initial setup. Show when a new release needs the customer's admin, and when Alien can't confirm the current state.
Follow removal
Show a customer's removal until it ends, including the last step their admin finishes in their own cloud, and close your record when it's done.