COST03-BP01 Track resources over their lifetime
Track each resource from provisioning to retirement so you can retire it when its purpose ends. Consistent tracking makes cleanup a routine you can automate.
Desired outcome:
-
You know the purpose, owner, environment, and expected end date of every resource in your workload.
-
Your resource utilization is monitored, so idle and abandoned resources surface without manual investigation.
-
You can identify which resources are ready for decommissioning from tracking data alone.
-
Your temporary and programmatically created resources carry the same tracking as long-lived resources.
Common anti-patterns:
-
Teams add resource tracking only to production and leave development and test resources untracked.
-
Tagging conventions differ across resource types, so reports miss resources that use a different key.
-
Resource metadata records what a resource is but not when to retire it.
-
Monitoring covers manually created resources and ignores the resources that automation provisions.
-
Ephemeral resources fall outside the tracking strategy and linger after their task finishes.
Benefits of establishing this best practice:
-
Costs fall because resources that no longer serve a purpose are found and removed.
-
Optimization opportunities become visible when utilization data is tied to each resource.
-
Resource lifecycle policies are more reliably enforced when every resource carries lifecycle metadata.
-
Cleanup and decommissioning become repeatable because tracking data drives them.
Level of risk exposed if this best practice is not established: High
Implementation guidance
A test environment left running overnight, a snapshot taken before a risky change, and a load balancer stranded after a migration all keep billing until someone notices. The organization loses track of why a resource exists and whether anyone still needs it. Record that context when you create the resource, and keep it current through every lifecycle state, so retirement becomes a decision based on data.
A tracking record answers four questions about a resource: what it is for, who owns it, which environment it belongs to, and when to retire it. Most tagging strategies omit the last question, so resources linger. A purpose tag such as feature-X testing explains why the resource exists. A time-based tag with a lifespan or time-to-live value states when it becomes a candidate for removal. Without an expiration signal, every retirement decision needs investigation, and investigation rarely happens.
Resources do not share a single lifecycle. Long-lived resources such as production databases change slowly. Temporary resources such as test fixtures, build artifacts, and short-lived environments are created and abandoned quickly, and generate most untracked waste. Resources that automation creates are the hardest to see, because no person decided to make them or remembers they exist. A tracking strategy that covers only what people provision manually will miss the resources that scale, replicate, or clone themselves.
Resources depend on one another, so deleting a resource that another component still references can break a workload. Dependency mapping records those relationships, so you can retire a resource knowing nothing else relies on it. Tags are not applied consistently by default. Use tag governance to define required keys and flag resources that lack them.
Several AWS services support tracking across the lifecycle. AWS Organizations tag policies define required tag keys and values across accounts, and AWS Config reports resources that fall out of compliance. Amazon CloudWatch measures utilization so idle resources become visible, and AWS Cost Optimization Hub consolidates recommendations to remove them. For retirement, AWS Resource Groups collect the resources that make up an application, based on tags or a CloudFormation stack. AWS Lambda with Amazon EventBridge runs scheduled checks that act on expired lifecycle tags.
Implementation steps
-
Define mandatory lifecycle tags: Establish a tag schema that captures environment, purpose, owner, and an expiration or time-to-live value for temporary resources. Add a project or initiative tag for context. Document the required keys and allowed values so every team applies them the same way, and treat this schema as a prerequisite for the tracking that follows.
-
Enforce tagging with governance controls: Apply AWS Organizations tag policies to standardize keys and values across accounts, and use AWS Config rules to detect resources missing required tags. Group related resources with resource groups so you can report on them together.
-
Monitor resource utilization: Configure Amazon CloudWatch metrics for utilization and add custom metrics for workload-specific signals. Review AWS Cost Optimization Hub recommendations to find idle resources, and check AWS Trusted Advisor cost optimization checks for additional candidates.
-
Track dependencies and configuration state: Use AWS Resource Groups to see the resources that belong to each application and AWS Systems Manager State Manager to track configuration. Enable AWS CloudFormation drift detection so you know when deployed resources diverge from their definitions before you retire them.
-
Automate detection of expired resources: Schedule checks with Amazon EventBridge that invoke AWS Lambda functions to find resources whose time-to-live tags have passed. For managed cleanup, pair the checks with AWS Config remediation actions, Systems Manager Automation runbooks, and Amazon S3 object lifecycle configuration for stored data.
-
Report and notify on lifecycle events: Set Amazon CloudWatch alarms for resource states and route Amazon S3 Lifecycle event notifications to the teams that own the affected resources. Build tracking dashboards so owners can see decommissioning candidates, using solutions such as the Cloud Intelligence Dashboards.
Resources
Related best practices:
Related documents:
Related videos:
Related examples:
Related tools:
Related workshops: