Setup guide
Everything you must provision before this skill can run โ the exact credentials, permissions, and where to click. Links go to the official consoles and docs, which stay current.
Provision a read-only FinOps audit identity (IAM role or user) with ReadOnlyAccess plus Cost Explorer, Compute Optimizer and Pricing API permissions, activate Cost Explorer and opt in to Compute Optimizer so at least 14 days of cost and utilization history exists, then configure AWS CLI v2 locally; separate write-capable credentials are provisioned later, only for the remediation waves.
You need to already have
- An AWS account you can administer; for multi-account scope, credentials in the AWS Organizations management account or a delegated administrator account (consolidated billing changes how Savings Plans and volume tiers apply)
- Permission to create IAM identities and attach policies (iam:CreateRole, iam:AttachRolePolicy, iam:PutRolePolicy), or an administrator who will create the audit role for you
- Root user or an account administrator able to turn on 'IAM user and role access to billing information' in Account settings - without it, ce:* calls are denied even when the IAM policy allows them
- Cost Explorer activated on the payer account with at least 14 days of history (90 days recommended, since the skill baselines the last 3 full months of AmortizedCost)
- AWS Compute Optimizer opted in (account-level or organization-level) at least 12 hours before the run; the CloudWatch agent must be installed on EC2 instances for memory-based rightsizing findings to be meaningful
- AWS CLI v2 (2.9 or newer) and jq 1.6+ on the machine running the skill; on macOS either GNU coreutils `gdate` or use the BSD `date -u -v-90d +%F` form the skill documents
- Separate, explicitly approved write-capable credentials (and a change window) before any Wave 2-4 remediation - the audit itself must run read-only
How the pieces connect
Credentials this skill needs
Set these as environment variables. Never paste secrets into a chat or commit them.
| Variable | What it is | Where to get it |
|---|---|---|
AWS_ACCESS_KEY_ID | AWS access key ID (audit identity) format: 20-character uppercase alphanumeric; starts with AKIA for a long-lived IAM user key, ASIA for temporary STS/SSO credentials | IAM console > Access management > Users > <audit user> > Security credentials > Access keys > Create access key > Command Line Interface (CLI). Preferred alternative: skip static keys entirely and use IAM Identity Center - `aws configure sso` writes short-lived ASIA... credentials for you. |
AWS_SECRET_ACCESS_KEYsecret | AWS secret access key format: 40-character base64-style string (A-Z a-z 0-9 / +) | Shown exactly once on the IAM console 'Retrieve access keys' screen immediately after IAM console > Users > <audit user> > Security credentials > Create access key. It cannot be re-displayed; if lost, deactivate the key and create a new one. |
AWS_SESSION_TOKENsecretoptional | AWS session token format: Long opaque base64 string (several hundred characters) | Only present for temporary credentials. Produced by `aws sts assume-role --role-arn arn:aws:iam::<account-id>:role/FinOpsAuditReadOnly --role-session-name cost-cutter` (field Credentials.SessionToken), by `aws configure sso`, or by the 'Command line or programmatic access' panel in the IAM Identity Center access portal. Required whenever AWS_ACCESS_KEY_ID begins with ASIA. |
AWS_REGION | Default AWS region format: Region code, e.g. us-east-1 | Any region code from `aws ec2 describe-regions --all-regions --query 'Regions[].RegionName' --output text`. Set it to us-east-1: the Cost Explorer (ce) and AWS Budgets endpoints are global and served only from us-east-1, and the Pricing API is available only in us-east-1, ap-south-1 and eu-central-1. The skill iterates every other region explicitly via --region. |
AWS_PROFILEoptional | Named CLI profile format: Profile name matching a [profile <name>] section in ~/.aws/config | ~/.aws/config (Windows: %USERPROFILE%\.aws\config), created by `aws configure --profile finops-audit` or `aws configure sso --profile finops-audit`. Use this instead of static key env vars where possible. |
Permissions to grant
arn:aws:iam::aws:policy/ReadOnlyAccessIAM roleadmin consent requiredBlanket read access covering the ec2:Describe*, cloudwatch:Get*, logs:Describe*, rds:Describe*, s3:List*, elasticloadbalancing:Describe*, eks:Describe*, ecr:Describe* and backup:List* calls the waste sweep makes across every region.
โณ Narrower alternative: a custom policy limited to ec2:DescribeRegions, ec2:DescribeInstances, ec2:DescribeVolumes, ec2:DescribeSnapshots, ec2:DescribeAddresses, ec2:DescribeNatGateways, ec2:DescribeVpcEndpoints, cloudwatch:GetMetricStatistics, cloudwatch:GetMetricData, cloudwatch:ListMetrics, logs:DescribeLogGroups, rds:DescribeDBInstances, elasticloadbalancing:DescribeLoadBalancers, eks:ListClusters, ecr:DescribeRepositories and backup:ListRecoveryPointsByBackupVault - that is the exact read surface the skill touches.
ce:GetCostAndUsageIAM roleadmin consent requiredPulls the 90-day AmortizedCost baseline grouped by SERVICE and USAGE_TYPE, which ranks every downstream finding.
โณ Cost Explorer actions do not support resource-level restriction; Resource must be "*". Grant only the specific ce:Get* actions listed here rather than ce:*.
ce:GetRightsizingRecommendationIAM roleadmin consent requiredCross-checks Compute Optimizer findings with Cost Explorer's own CROSS_INSTANCE_FAMILY rightsizing recommendations in step 4.
ce:GetSavingsPlansPurchaseRecommendationIAM roleadmin consent requiredSizes the Compute Savings Plan commitment in step 6 against 60 days of hourly on-demand spend.
โณ Read-only: it returns a recommendation and never purchases. Purchasing requires savingsplans:CreateSavingsPlan, which must NOT be granted to the audit identity.
ce:GetSavingsPlansUtilizationIAM roleadmin consent requiredReports commitment utilization %, which the cost model requires before quoting any savings from deleting or resizing covered compute.
ce:GetSavingsPlansCoverageIAM roleadmin consent requiredSupplies current_SP_coverage, the multiplier in `on-demand rate x hours x (1 - current_SP_coverage)` - without it every savings figure is overstated.
compute-optimizer:GetEC2InstanceRecommendationsIAM roleadmin consent requiredRetrieves Overprovisioned findings with observed CPU/memory utilization for the rightsizing step.
โณ Use the managed policy arn:aws:iam::aws:policy/ComputeOptimizerReadOnlyAccess if you prefer a maintained policy over inline actions.
compute-optimizer:GetEnrollmentStatusIAM roleadmin consent requiredPre-flight check in 'Inputs to gather' that confirms opt-in and how long data has been collected, so the skill can flag low-confidence findings.
pricing:GetProductsIAM roleadmin consent requiredResolves live on-demand $/hr for each instance type in the reference scan instead of relying on hardcoded us-east-1 list prices.
โณ Also grant pricing:DescribeServices only if you extend the scan to discover filter fields; the skill itself needs GetProducts alone.
organizations:ListAccountsIAM roleadmin consent requiredEnumerates linked accounts when the scope is a consolidated-billing payer rather than a single account.
โณ Omit entirely for single-account audits. It only works from the management account or a delegated administrator.
sts:GetCallerIdentityIAM roleProves which account and principal the audit is running as before anything is scanned or reported.
โณ Allowed implicitly for every IAM principal; no explicit grant needed.
aws-portal:ViewBillingIAM roleadmin consent requiredLegacy billing-console permission still enforced on some accounts alongside the ce:* actions; paired with activating IAM access to billing information.
โณ On accounts migrated to fine-grained billing permissions this is superseded by billing:Get* and ce:Get*; grant arn:aws:iam::aws:policy/AWSBillingReadOnlyAccess to cover both generations.
ec2:ModifyVolumeIAM roleadmin consent requiredWRITE - Wave 1 gp2 to gp3 migration. Belongs to the separate remediation identity, never to the audit identity.
โณ Scope with a Condition on aws:ResourceTag/Environment or a resource ARN list so only pre-approved volumes can be modified.
logs:PutRetentionPolicyIAM roleadmin consent requiredWRITE - Wave 1 fix for log groups whose retentionInDays is null.
โณ Restrict Resource to arn:aws:logs:<region>:<account>:log-group:<prefix>:* rather than "*".
ec2:CreateVpcEndpointIAM roleadmin consent requiredWRITE - Wave 1/3 creation of S3 and DynamoDB gateway endpoints and PrivateLink interface endpoints to remove NAT per-GB charges.
โณ Also needs ec2:ModifyVpcEndpoint and ec2:DescribeVpcEndpoints; scope by vpc-id condition key ec2:Vpc.
budgets:ModifyBudgetIAM roleadmin consent requiredWRITE - creates the guardrail budget in step 7 (the CreateBudget API maps to this IAM action).
โณ Pair with budgets:ViewBudget for read-back; ce:CreateAnomalyMonitor and ce:CreateAnomalySubscription are needed for the anomaly guardrail.
Step by step
- 1
Install AWS CLI v2 and jq
Install AWS CLI v2 (2.9+) from the official installer for your OS, then confirm with `aws --version` - it must print aws-cli/2.x, not 1.x, because the skill uses `aws ce`, `aws compute-optimizer` and `--query`/`--filters` syntax that v1 handles differently. Install jq 1.6+ (`brew install jq`, `apt-get install jq`, or `winget install jqlang.jq`). On macOS the scripts need either GNU date (`brew install coreutils`) or the documented BSD `date -u -v-90d +%F` fallback.
Open in the console / docs โ - 2
Activate IAM access to billing data on the payer account
Sign in as the root user (or an admin with the account-settings permission) of the management/payer account. Top-right account name menu > Account > scroll to 'IAM user and role access to billing information' > Edit > tick 'Activate IAM Access' > Update. Without this, ce:GetCostAndUsage returns AccessDenied no matter what the IAM policy says. In an Organization this must be done on the management account.
Open in the console / docs โ - 3
Enable Cost Explorer and wait for history
Open the AWS Billing and Cost Management console > left nav 'Cost Management' > Cost Explorer, and confirm it is enabled (first visit enables it). Data is prepared within ~24 hours and AWS backfills roughly the previous 12 months. The skill's 90-day AmortizedCost baseline needs at least 14 days, ideally 3 full months. For an Organization, also open Cost Management > Preferences and confirm 'Linked account access' so member accounts can call Cost Explorer.
Open in the console / docs โ - 4
Opt in to AWS Compute Optimizer
Open the Compute Optimizer console > Get started > choose 'Only this account' or 'All accounts within this organization' > Opt in. First recommendations appear after ~12 hours; the skill's 14-day idle thresholds and p99 rightsizing signal need 14-30 days. Memory metrics only exist for instances running the CloudWatch agent - without it, treat every memory finding as unknown rather than as headroom.
Open in the console / docs โ - 5
Create the read-only FinOps audit role
IAM console > Access management > Roles > Create role > 'AWS account' (or 'Custom trust policy' for cross-account) > Next. Attach arn:aws:iam::aws:policy/ReadOnlyAccess and arn:aws:iam::aws:policy/ComputeOptimizerReadOnlyAccess. Name it FinOpsAuditReadOnly > Create role. Then open the role > Permissions > Add permissions > Create inline policy > JSON, and allow Action: ["ce:GetCostAndUsage","ce:GetRightsizingRecommendation","ce:GetSavingsPlansPurchaseRecommendation","ce:GetSavingsPlansUtilization","ce:GetSavingsPlansCoverage","pricing:GetProducts","organizations:ListAccounts"] on Resource "*" (Cost Explorer and Pricing do not support resource-level permissions). Grant no write actions here.
Open in the console / docs โ - 6
Configure local credentials, preferring short-lived ones
Best: `aws configure sso --profile finops-audit` against IAM Identity Center, then `aws sso login --profile finops-audit` - it writes temporary ASIA... credentials that expire automatically. Otherwise assume the role directly: `aws sts assume-role --role-arn arn:aws:iam::<account-id>:role/FinOpsAuditReadOnly --role-session-name cost-cutter` and export AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN from the Credentials block. Set AWS_REGION=us-east-1 because the Cost Explorer, Budgets and Pricing endpoints live there. Static IAM user keys are the last resort - if you use them, rotate on a schedule.
Open in the console / docs โ - 7
Confirm every active region is reachable
Run `aws ec2 describe-regions --all-regions --query 'Regions[].[RegionName,OptInStatus]' --output text`. Opt-in regions such as ap-east-1, me-south-1 and af-south-1 return 'not-opted-in' and will fail with AuthFailure if the scan targets them - set the REGIONS variable in aws-waste-scan.sh to the opted-in list only. Forgotten resources in a rarely-used region are a routine finding, so do not shrink this list for convenience.
Open in the console / docs โ - 8
Provision a separate write role for the remediation waves - only after sign-off
Do not add write permissions to FinOpsAuditReadOnly. Create a second role, FinOpsRemediation, in IAM console > Roles > Create role, with a scoped inline policy covering only the actions each wave needs (ec2:ModifyVolume, ec2:DeleteVolume, ec2:CreateSnapshot, ec2:ReleaseAddress, ec2:StopInstances, ec2:CreateVpcEndpoint, logs:PutRetentionPolicy, s3:PutLifecycleConfiguration, budgets:ModifyBudget, ce:CreateAnomalyMonitor), gated with a Condition on aws:ResourceTag/Environment. Never grant savingsplans:CreateSavingsPlan or ec2:TerminateInstances to an automated caller - Wave 4 is financially irreversible and requires a human.
Open in the console / docs โ
Check it worked
aws sts get-caller-identity && aws compute-optimizer get-enrollment-status && aws ce get-cost-and-usage --time-period Start=$(date -u -d '30 days ago' +%F),End=$(date -u +%F) --granularity MONTHLY --metrics AmortizedCost --group-by Type=DIMENSION,Key=SERVICE --output json | jq -r '.ResultsByTime[-1].Groups[] | [.Keys[0], .Metrics.AmortizedCost.Amount] | @tsv' | sort -k2 -gr | head -5
If you hit an error
An error occurred (AccessDeniedException) when calling the GetCostAndUsage operation: User: arn:aws:iam::123456789012:user/finops is not authorized to perform: ce:GetCostAndUsage on resource: arn:aws:ce:us-east-1:123456789012:/GetCostAndUsageCause: Either the inline ce:Get* policy is missing, or 'IAM user and role access to billing information' was never activated on the payer account - the account-level switch overrides the IAM grant.
Fix: Activate IAM access to billing in the account-name menu > Account, and confirm the audit role has ce:GetCostAndUsage on Resource "*" (Cost Explorer does not support resource-level permissions). In an Organization, run the call from the management account or enable linked-account access.
An error occurred (DataUnavailableException) when calling the GetCostAndUsage operationCause: Cost Explorer was enabled less than ~24 hours ago, or the requested time period predates the first prepared data.
Fix: Wait for the first daily preparation run, then narrow --time-period to the days actually available. Do not substitute UnblendedCost or estimated data - the skill's baseline requires AmortizedCost.
An error occurred (OptInRequiredException) when calling the GetEC2InstanceRecommendations operationCause: The account (or the organization) is not opted in to AWS Compute Optimizer, so no recommendations exist.
Fix: Opt in via the Compute Optimizer console Get started flow, or `aws compute-optimizer update-enrollment-status --status Active`, then wait ~12 h. Verify first with `aws compute-optimizer get-enrollment-status`, and skip the rightsizing step until status is Active with enough history.
An error occurred (UnauthorizedOperation) when calling the DescribeVolumes operation: You are not authorized to perform this operation.Cause: The audit identity lacks ec2:Describe* in that region, or an SCP / permissions boundary on the account denies it.
Fix: Attach arn:aws:iam::aws:policy/ReadOnlyAccess (or the explicit ec2:Describe* list) and check Organizations SCPs. Re-run `aws sts get-caller-identity` to confirm you are the principal you think you are - a stale AWS_PROFILE is the usual cause.
An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentialsCause: The scan targeted an opt-in region (ap-east-1, me-south-1, af-south-1, eu-south-1, ...) that the account has not enabled.
Fix: Filter the REGIONS list to entries where DescribeRegions reports OptInStatus of opt-in-not-required or opted-in, and note the skipped regions in the assumptions section of the report.
An error occurred (ThrottlingException) when calling the GetMetricStatistics operation: Rate exceededCause: One get-metric-statistics call per instance per region exceeds the CloudWatch request rate once the fleet passes roughly 50 instances.
Fix: Switch to `aws cloudwatch get-metric-data`, batching up to 500 MetricDataQueries per call, and enable adaptive retries with `export AWS_RETRY_MODE=adaptive AWS_MAX_ATTEMPTS=10`.
Could not connect to the endpoint URL: "https://api.pricing.eu-west-1.amazonaws.com/"Cause: The Pricing API is served only from us-east-1, ap-south-1 and eu-central-1, but the call inherited the loop's regional --region value.
Fix: Always pass `--region us-east-1` to `aws pricing get-products` (as the reference implementation's price_hr() does) and pass the target region as the regionCode TERM_MATCH filter instead.
An error occurred (ExpiredTokenException) when calling the GetCostAndUsage operation: The security token included in the request is expiredCause: Temporary STS or IAM Identity Center credentials (AWS_ACCESS_KEY_ID starting ASIA) expired mid-scan; the default assume-role session is one hour.
Fix: Re-run `aws sso login --profile finops-audit` or re-assume the role with `--duration-seconds 43200` (up to the role's MaxSessionDuration), then restart the scan. Long multi-region sweeps should use a profile so the CLI refreshes credentials automatically.
An error occurred (VolumeModificationRateExceeded) when calling the ModifyVolume operation: You've reached the maximum modification rate per volume limit. Wait at least 6 hours between modifications per EBS volume.Cause: The gp2 to gp3 migration was retried, or IOPS and throughput were changed in a second call within the 6-hour per-volume cooldown.
Fix: Set --volume-type, --iops and --throughput in a single modify-volume call, and poll `aws ec2 describe-volumes-modifications --volume-ids vol-0abc` for state 'completed' rather than retrying.
date: illegal option -- dCause: The BSD `date` on macOS does not accept GNU's `-d '90 days ago'`.
Fix: Use `date -u -v-90d +%F` (the fallback the skill documents) or install GNU coreutils and call `gdate`. The reference script's iso_ago() already tries both forms.
Official documentation: https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html โ
API operations this skill uses (20)
Every call the skill makes, linked to its official reference page.
| Operation | Call | Permission | Ref |
|---|---|---|---|
| Verify the audit identity Pre-flight check confirming which account and role the audit runs as before any scan or dollar figure is produced. | CLI aws sts get-caller-identity | sts:GetCallerIdentity (implicitly allowed for all principals) | docs โ |
| Enumerate active regions Builds the region loop so waste hiding in forgotten regions is found; OptInStatus also tells the scan which regions to skip. | CLI aws ec2 describe-regions --all-regions --query 'Regions[].RegionName' --output text | ec2:DescribeRegions | docs โ |
| List Organizations member accounts Determines whether the scope is a single account or a consolidated-billing payer, which changes how commitments and volume tiers apply. | CLI aws organizations list-accounts | organizations:ListAccounts (management or delegated administrator account only) | docs โ |
| Baseline amortized cost by service Step 1 baseline: ranks the top 15 services by absolute dollars over 90 days, then re-runs grouped by USAGE_TYPE to expose NatGateway-Bytes, DataTransfer-Regional-Bytes and EBS:VolumeUsage.gp2. | CLI aws ce get-cost-and-usage --time-period Start=<YYYY-MM-DD>,End=<YYYY-MM-DD> --granularity MONTHLY --metrics AmortizedCost --group-by Type=DIMENSION,Key=SERVICE | ce:GetCostAndUsage | docs โ |
| Check Compute Optimizer enrollment Confirms opt-in and data age before rightsizing; low history means findings must be reported as a range, not a precise figure. | CLI aws compute-optimizer get-enrollment-status | compute-optimizer:GetEnrollmentStatus | docs โ |
| Fetch over-provisioned EC2 recommendations Step 4 rightsizing source, including observed CPU and (only where the CloudWatch agent is installed) memory utilization. | CLI aws compute-optimizer get-ec2-instance-recommendations --filters name=Finding,values=Overprovisioned | compute-optimizer:GetEC2InstanceRecommendations | docs โ |
| Cross-check Cost Explorer rightsizing Second opinion on downsizing that already accounts for existing commitment benefits, so savings are not double-counted against a Savings Plan. | CLI aws ce get-rightsizing-recommendation --service AmazonEC2 --configuration '{"RecommendationTarget":"CROSS_INSTANCE_FAMILY","BenefitsConsidered":true}' | ce:GetRightsizingRecommendation | docs โ |
| Find unattached EBS volumes Step 2 orphan sweep: volumes in 'available' state for more than 7 days bill at full GB rate; each becomes a snapshot-then-delete ledger row. | CLI aws ec2 describe-volumes --region <region> --filters Name=status,Values=available --query 'Volumes[].[VolumeId,Size,VolumeType]' | ec2:DescribeVolumes | docs โ |
| Find unassociated Elastic IPs Since 2024 every public IPv4 address bills whether attached or not (~$3.60/mo each); unassociated ones are zero-risk Wave 1 releases. | CLI aws ec2 describe-addresses --region <region> --query 'Addresses[?AssociationId==`null`].AllocationId' | ec2:DescribeAddresses | docs โ |
| Inventory running EC2 instances Seeds the idle-compute check and supplies instance types and Owner/Environment tags used for ownership gating and pricing lookups. | CLI aws ec2 describe-instances --region <region> --filters Name=instance-state-name,Values=running --query 'Reservations[].Instances[].[InstanceId,InstanceType]' | ec2:DescribeInstances | docs โ |
| Pull per-instance CPU utilization Applies the three-part idle test (avg CPU < 5% AND max CPU < 20% AND NetworkIn+NetworkOut < 5 MB/day over 14 days) so busy low-CPU hosts are not killed. | CLI aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name CPUUtilization --dimensions Name=InstanceId,Value=<i-id> --period 86400 --statistics Average Maximum --start-time <ISO8601> --end-time <ISO8601> | cloudwatch:GetMetricStatistics | docs โ |
| Batch metric retrieval for large fleets Above ~50 instances the skill batches up to 500 MetricDataQueries per call instead of looping GetMetricStatistics, which throttles. | CLI aws cloudwatch get-metric-data --metric-data-queries file://queries.json --start-time <ISO8601> --end-time <ISO8601> | cloudwatch:GetMetricData | docs โ |
| List NAT gateways for egress analysis Step 3 driver: each gateway is then measured with the AWS/NATGateway BytesOutToDestination metric to size the per-GB charge and the endpoint break-even. | CLI aws ec2 describe-nat-gateways --filter Name=state,Values=available --query 'NatGateways[].NatGatewayId' | ec2:DescribeNatGateways | docs โ |
| Create S3/DynamoDB gateway VPC endpoint Wave 1 fix that eliminates 100% of NAT per-GB charges for S3 and DynamoDB traffic at $0/hr and $0/GB - no break-even to compute. | CLI aws ec2 create-vpc-endpoint --vpc-id <vpc-id> --service-name com.amazonaws.<region>.s3 --vpc-endpoint-type Gateway --route-table-ids <rtb-ids> | ec2:CreateVpcEndpoint (remediation role only) | docs โ |
| Find log groups with no retention Unbounded log groups accumulate storage forever at ~$0.03/GB-mo on top of ~$0.50/GB ingest; step 5 quantifies each one. | CLI aws logs describe-log-groups --query 'logGroups[?retentionInDays==`null`].[logGroupName,storedBytes]' | logs:DescribeLogGroups | docs โ |
| Apply log retention Wave 1 zero-risk fix that caps storage growth on every group found without a retention setting. | CLI aws logs put-retention-policy --log-group-name <name> --retention-in-days 30 | logs:PutRetentionPolicy (remediation role only) | docs โ |
| Migrate gp2 volumes to gp3 Online, no-downtime, ~20% cheaper per GB-mo; limited to one modification per volume per 6 hours, so type/IOPS/throughput go in one call. | CLI aws ec2 modify-volume --volume-id <vol-id> --volume-type gp3 --iops 3000 --throughput 125 | ec2:ModifyVolume (remediation role only) | docs โ |
| Resolve live on-demand instance pricing Turns each idle instance into a real monthly figure ($/hr x 730) instead of a hardcoded us-east-1 estimate; PriceList entries are JSON strings that must be parsed with jq fromjson. | CLI aws pricing get-products --region us-east-1 --service-code AmazonEC2 --filters Type=TERM_MATCH,Field=instanceType,Value=<type> Type=TERM_MATCH,Field=regionCode,Value=<region> Type=TERM_MATCH,Field=operatingSystem,Value=Linux Type=TERM_MATCH,Field=tenancy,Value=Shared Type=TERM_MATCH,Field=preInstalledSw,Value=NA Type=TERM_MATCH,Field=capacitystatus,Value=Used | pricing:GetProducts | docs โ |
| Size the Savings Plan commitment Step 6, run only after cleanup: sizes a commitment to the P5-P10 trough of hourly on-demand spend targeting 70-85% coverage, never 100%. | CLI aws ce get-savings-plans-purchase-recommendation --savings-plans-type COMPUTE_SP --term-in-years ONE_YEAR --payment-option NO_UPFRONT --lookback-period-in-days SIXTY_DAYS | ce:GetSavingsPlansPurchaseRecommendation | docs โ |
| Read Savings Plan coverage and utilization Supplies current_SP_coverage for `on-demand rate x hours x (1 - coverage)`; deleting covered compute saves $0 until the commitment is re-absorbed, and utilization must be re-checked after every deletion wave. | CLI aws ce get-savings-plans-coverage --time-period Start=<YYYY-MM-DD>,End=<YYYY-MM-DD> ; aws ce get-savings-plans-utilization --time-period Start=<YYYY-MM-DD>,End=<YYYY-MM-DD> | ce:GetSavingsPlansCoverage, ce:GetSavingsPlansUtilization | docs โ |