Follow removal
Following removal means showing the customer where their removal stands until nothing of yours is left to manage. It applies when you launch the portal with a Deploy button or build it in with your own setup screen, after you start the removal.
Example UI /Waiting for the admin
Document processing
Settings · Deploy in your cloud
Delete the setup stack to finish
We removed the service. Your AWS admin finishes by deleting the CloudFormation stack that setup created.
aws cloudformation delete-stack --stack-name a3f9c21b0-customer-1 --region us-east-1
- Stack
- a3f9c21b0-customer-1
- Region
- us-east-1
The split follows the two parts of a deployment's life:
- Ongoing management: Alien created the live resources, so Alien deletes them.
- Initial setup: the admin created the management identity and the frozen resources with their own credentials, so the admin's teardown removes them, except the data you keep.
Statuses
Removal runs in the background. Your page shows one of these states, read from the deployment's status:
status | Product state | Who acts next |
|---|---|---|
delete-pending, deleting | Removing | Alien |
teardown-required | Waiting for the admin | The customer's admin |
retention-required | Waiting for the admin, data kept | The customer's admin |
delete-failed | Removal stopped | Your team |
teardown-failed | The admin's teardown failed | The customer's admin |
retained | Removed, data kept | You: close the record |
deleted | Removed | You: close the record |
Removing
While Alien deletes the live resources, your page has nothing for anyone to do. Say where the work goes now, as in the example on Remove a deployment.
Show it when status is delete-pending or deleting.
- Traffic first. Switch your product off the deployment before you start removal, and say where the work goes now.
- No Cancel. The API can't stop a removal once it starts. Don't offer the button.
- Who and when. Save who started removal and when in your own database. The response doesn't return it.
- Repeat clicks. Calling delete again while it runs is safe: it doesn't start a second removal.
{
"status": "deleting",
"platform": "aws",
"environmentInfo": { "platform": "aws", "accountId": "123456789012", "region": "us-east-1" },
"error": null,
"retryRequested": false
}Waiting for the admin
teardown-required means Alien's part is done and the customer's part isn't. Give the step for the admin's setup method, from setupMethod:
setupMethod | What the admin does |
|---|---|
cloudformation | Delete the stack: "Delete the a3f9c21b0-customer-1 stack in CloudFormation in us-east-1." |
terraform | In the Terraform folder, set TF_VAR_token to the deployment token from initial setup (and on AWS TF_VAR_management_external_id), then run terraform destroy. |
helm | Run helm uninstall. |
cli | Run your CLI's destroy command, such as acmectl destroy --deployment-id <id>, with the cloud credentials used for initial setup. |
The example at the top of this page shows this state.
Show it when status is teardown-required or retention-required. setupMethod says which step to show.
- Name the admin. Alien's part is done. Say the customer's admin acts next, and give the exact step for their
setupMethod. - Days, not minutes. Keep the card on the page and remind the admin, instead of hiding it.
- Data kept.
retention-requiredmeans the data resources stay. The admin still removes the setup stack; the data stays in the account. - The link can go. The stack deletes itself with the deployment's own token, so revoking the setup link doesn't block this step.
{
"status": "teardown-required",
"platform": "aws",
"setupMethod": "cloudformation",
"environmentInfo": { "platform": "aws", "accountId": "123456789012", "region": "us-east-1" },
"error": null
}When the admin's teardown reaches Alien, the status becomes deleted, or retained when data was kept. The deployment portal shows the admin the same step under Finish uninstall, with the exact command for every setup method: see Follow a deployment.
Failures
delete-failed means Alien couldn't delete a live resource. Show error.message, tell the customer your team is on it, and see Debug a deployment.
teardown-failed means the admin's teardown stopped, for example a stack deletion that failed in AWS:
Example UI /Teardown failed
Document processing
Settings · Deploy in your cloud
The setup stack didn’t delete
The service is gone, but the setup stack in your AWS account is still there.
Open the stack’s Events tab in CloudFormation to see which resource failed, fix it, then delete the stack again.
Show it when status is teardown-failed. Show error.message.
- The fix is in their account. Tell the admin where to look: the stack's Events tab in CloudFormation, or the
terraform destroyoutput. - Azure resource groups. Terraform won't delete a resource group that still holds resources, such as a kept Key Vault. The admin deletes those first.
- Then retry. After the fix, the admin deletes the stack or runs
terraform destroyagain. Nothing changes on your side. delete-failedis different. It means Alien couldn't delete a live resource, and your team acts.
{
"status": "teardown-failed",
"platform": "aws",
"setupMethod": "cloudformation",
"error": {
"code": "CLOUD_PLATFORM_ERROR",
"message": "The setup stack could not delete the management role.",
"retryable": true
}
}Removed
deleted and retained are the end of removal. Some things stay until the customer deletes them, and they may still cost money.
Example UI /Removed
Document processing
Settings · Deploy in your cloud
Removed from Document processing
Data that setup didn’t create, such as an existing VPC or a bucket you kept, stays in your account until you delete it.
- Removed
- Jan 20, 15:41
Show it when status is deleted or retained.
- Say what stays. With
retained, list the kept data, such as the bucket with their documents. With either, an existing VPC the customer named stays too. - Honest wording. Say "Removed from Document processing", not "Nothing left in your account".
- Close your record. Clear your active flag and endpoint, then revoke the setup link from the deployment group's Deployment links card.
- Deploy again. Deploy again creates a new setup link for the same customer.
{
"status": "retained",
"platform": "aws",
"setupMethod": "cloudformation",
"error": null
}Map the status
Server. Poll the deployment and map its status:
import { alien } from "./alien"
export async function removalState(deploymentId: string) {
const d = await alien.deployments.get({ id: deploymentId })
switch (d.status) {
case "delete-pending":
case "deleting":
return { state: "removing" }
case "teardown-required":
case "retention-required":
return { state: "waiting-for-admin", setupMethod: d.setupMethod }
case "delete-failed":
case "teardown-failed":
return { state: "failed", status: d.status, message: d.error?.message }
case "deleted":
case "retained":
return { state: "removed", dataKept: d.status === "retained" }
default:
return { state: d.status }
}
}Test it
- Remove a test deployment end to end. Check that your page shows Removing, then Waiting for the admin with the right command, then Removed only after
deletedorretained. - Wait from the CLI while you watch your page:
alien deployments wait customer-1/customer-1 --for deleted --timeout 1h. - Delete the stack too early. On a second deployment, delete the stack in AWS before you start removal. Alien should remove the deployment, and your page should reach Removed.
- Unit-test the failures. Feed the Teardown failed response to your mapping, and assert your page shows the error and names the admin.
Next
- Show deployment progress: every status and what to show
- Status messages: the words to use