Sub topic 8
Sustainability: reducing the environmental impact of workloads
This chapter assumes you know the shared responsibility model from earlier in this tutorial. You should also be comfortable with EC2, S3 and Auto Scaling.
What the pillar asks
The Sustainability pillar covers the environmental impact of running your workload, mainly energy use and the resources you consume. Its goal is to get the same business outcome with fewer resources.
Shared responsibility applies here too. AWS is responsible for the sustainability of the cloud: efficient data centers, hardware and energy sourcing. You are responsible for sustainability in the cloud: how much you provision, how well you use it, and how long you keep data.
Design principles
- Understand your impact. Measure it and pick a business metric, such as resources used per transaction. Track it over time.
- Set sustainability goals. Set targets for each workload and plan for growth.
- Maximize utilization. Idle capacity still draws power. Right-size resources and run them at healthy utilization.
- Adopt more efficient hardware and software. Move to newer instance generations, such as Graviton-based instances where your software supports them.
- Use managed services. AWS can share infrastructure across many customers, which raises overall utilization.
- Reduce downstream impact. Avoid forcing your users to upgrade devices or download more data than they need.
Practice areas
| Area | Question to ask | Example action |
|---|---|---|
| Region selection | Does the Region fit both business needs and carbon goals? | Choose among Regions that meet latency and compliance needs |
| Alignment to demand | Does capacity follow load? | Auto Scaling, scheduled shutdown of dev environments |
| Software and architecture | Is the code doing unnecessary work? | Caching, asynchronous processing, removing unused features |
| Data | Do you store only what you need? | Lifecycle rules, compression, deletion |
| Hardware and services | Are you on efficient instance types? | Newer generations, serverless for spiky loads |
| Process and culture | Is sustainability part of delivery? | Include the metric in reviews |
Worked example: data lifecycle
Data is a common source of waste because nobody deletes it. Suppose an application writes logs under logs/ in an S3 bucket. The rule below moves objects to an archive class after 30 days and deletes them after 365 days. It assumes you need a year of retention.
{
"Rules": [
{
"ID": "ArchiveThenExpireLogs",
"Status": "Enabled",
"Filter": { "Prefix": "logs/" },
"Transitions": [
{ "Days": 30, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 365 }
}
]
}Save it as lifecycle.json and apply it:
aws s3api put-bucket-lifecycle-configuration \
--bucket example-bucket \
--lifecycle-configuration file://lifecycle.jsonCheck your compliance rules before enabling expiration. Deleting data you are required to keep is a different kind of failure.
Measuring
You cannot improve what you do not measure. The AWS Customer Carbon Footprint Tool reports estimated emissions from your AWS usage. For workload-level efficiency, use proxy metrics you already have. Examples are vCPU-hours per thousand requests and gigabytes stored per active customer. Proxies work well because they track resource use directly and are easy to compare across releases.
Common errors
- Treating it as a one-time cleanup. Without a metric, savings drift back.
- Choosing a Region only for latency. Consider other factors when several Regions meet your requirements.
- Over-provisioning "to be safe". Prefer scaling on demand.
- Ignoring trade-offs. Consolidating onto fewer, busier instances improves utilization but may reduce Reliability headroom. Many sustainability gains also cut cost, which makes them easy to justify.
Exercise
A team runs a development environment on large EC2 instances 24 hours a day, but developers only use it from 08:00 to 18:00 on weekdays. Name two actions that improve sustainability, and name one metric to track the result.
Show answer
Schedule the environment to stop outside working hours, and right-size the instances to match actual load. Track a metric such as instance-hours per month, or vCPU-hours per deployment, and compare it before and after the change.