DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Redmond desk4 min

Deleting AWS Copilot Stacks Can Delete Your Database—Here’s Why

Copilot removes resources through CloudFormation, whose deletion policies determine whether an RDS database is deleted, retained, or snapshotted. Check the deployed stack before deleting it.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes—deleting an AWS Copilot service, environment, or application can delete database resources managed by the CloudFormation stacks involved. But the command alone does not determine what happens to each database: CloudFormation applies that resource’s deletion policy, and RDS defaults vary by resource type. Before deleting a stack, inspect its deployed resources and template, then decide whether you need the live database to remain or only a restorable snapshot.

What Copilot deletes—and what decides a database’s fate

Copilot commands remove resources at different scopes. Copilot asks AWS CloudFormation to delete the relevant stack; CloudFormation then handles each resource according to its deletion policy and, for some resource types, its default behavior.

As an Amazon Associate I earn from qualifying purchases.

Command Scope Database implication
copilot svc delete Resources associated with a service in a particular environment. AWS Copilot CLI documentation A database in that service’s stack may be affected according to its resource policy.
copilot env delete Deletes the environment’s CloudFormation stack. Copilot instructs users to delete running applications in the environment first. AWS Copilot CLI documentation Environment-level resources, including storage deployed with the environment, remain until this deletion and may be removed then.
copilot app delete “Deletes all resources associated with an application.” AWS Copilot CLI documentation Application-managed databases are within the broad scope; their individual outcomes still depend on CloudFormation behavior.

Copilot’s storage guide distinguishes workload storage, which is deployed and deleted with its service or job, from environment storage, which is deployed with the environment and “isn’t deleted until you run copilot env delete.” Copilot storage documentation That lifecycle tells you which deletion scope to inspect; it does not by itself establish whether a particular database is retained, snapshotted, or deleted.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CloudFormation deletion policies: delete, retain, or snapshot

CloudFormation’s DeletionPolicy attribute controls what happens to a resource when its stack is deleted. If no policy is specified, CloudFormation generally deletes the resource. CloudFormation DeletionPolicy documentation

Policy or behavior What happens to the live database What remains
Delete (or the general default where no policy applies) The resource is deleted. Do not assume a separate, restorable snapshot is created by this policy.
Retain The database remains running after stack deletion. The resource is detached from the deleted stack and is no longer tracked there; you must manage it separately.
Snapshot The database resource is deleted after CloudFormation creates a snapshot, when the resource type supports this policy. A snapshot remains as a backup artifact; it is not a live database.

Both retained resources and snapshots can continue to incur charges. CloudFormation DeletionPolicy documentation

RDS defaults are different for instances and clusters

Do not infer an RDS outcome from the word “database” alone. CloudFormation documents different default deletion behavior for three common resource configurations:

  • AWS::RDS::DBCluster: the default deletion policy is Snapshot.
  • AWS::RDS::DBInstance without DBClusterIdentifier: the default is Snapshot.
  • AWS::RDS::DBInstance with DBClusterIdentifier: the default is deletion.

These are CloudFormation defaults, not a guarantee about your deployed stack: an explicit policy in the template can change the result. Check the actual resource type and configuration, including whether an instance belongs to a cluster. CloudFormation DeletionPolicy documentation

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose whether you need the live database or a recovery point

Make the preservation choice before deleting the stack. Retain is for keeping the database resource available; Snapshot is for preserving a point-in-time recovery artifact while removing the database resource. A snapshot does not keep the database online, and restoring one is a separate operation.

  • Need the existing database to keep serving workloads: configure and verify a retention policy for the database resource, then plan how you will manage that resource outside the deleted stack.
  • Need a recoverable copy, not a live database: configure or verify a snapshot outcome for the relevant supported resource, and confirm the snapshot exists before relying on it.
  • Need both continuity and recovery: plan for the live resource and an independent recovery path rather than treating either deletion protection or an unverified snapshot as the whole plan.

The precise template change depends on the database resource type and the Copilot-generated add-on template in your application. Update the infrastructure definition, deploy the change, and verify the effective stack configuration before issuing a deletion command.

Inspect the deployed stack before deleting it

  1. Identify the deletion scope. Determine whether you are deleting a service, an environment, or the whole application; these commands address different resource scopes.
  2. List the actual stack resources. In the AWS CloudFormation console, open the relevant stack and inspect its Resources list. Identify the database resource and whether it is an instance, cluster, or cluster-associated instance.
  3. Inspect the deployed template and policy. Check the database resource’s DeletionPolicy, if present, and compare it with the current infrastructure definition. Do not assume the template or policy for another Copilot app applies to yours.
  4. Set the intended outcome. Choose retention or snapshot behavior based on whether you need the live database or a recovery artifact. Apply the appropriate change to the infrastructure definition and deploy/update the stack.
  5. Verify before deletion. Confirm the stack reflects the intended policy and that any required snapshot or separate backup is available. Then proceed with the relevant Copilot deletion command.
  6. Track what is left behind. If a resource is retained, record who owns it and how it will be managed after the stack disappears. Account for ongoing resource or snapshot charges.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why deletion protection and backups are not a complete plan

RDS deletion protection may block deletion while enabled, but its default varies by resource and creation path. It is a safeguard against an operation, not a substitute for choosing and verifying the CloudFormation deletion outcome. Amazon RDS DB instance deletion documentation Amazon Aurora DB cluster deletion documentation

Automated backups may remain for their configured retention period after an RDS database is deleted, and backup storage can incur charges. That is distinct from retaining the live database or creating a CloudFormation snapshot. Check the backup retention and recovery requirements for your specific database before deletion. AWS re:Post: RDS deletion guidance

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.