AWS Integration
Infracost already finds tagging and FinOps issues in your CI/CD pipelines before deployment. Our AWS integration completes the picture by enabling Infracost to find post-deployment issues too. For example, with the AWS integration, Infracost can:
- find idle and unused resources
- investigate cost anomalies and pin-point which application or infrastructure pull request caused them
- find tagging issues from resources not in IaC
Infracost will continuously monitor cloud resources, triage findings, create Jira tickets, drafts PR fixes, and queue them for your team's approval - ultimately saving engineering time and reducing your cloud costs.
This integration requires access to your AWS organization's management account. Reach out to support@infracost.io before getting started if you have questions.
Each guide below includes a required step to enable cost and usage data exports — you can let Infracost create these for you, or bring your own existing exports.
Pick the guide that matches how your team manages AWS infrastructure:
S3 Storage Lens setup and troubleshooting
S3 usage metrics require an enabled Storage Lens configuration in your organization's management account, with a Parquet metrics export and a valid destination bucket. A dashboard without an S3 export, or a CSV export, is not enough. Both free and advanced metrics tiers are supported; advanced metrics are not required to pass the integration checks.
The Terraform and CloudFormation guides can create this configuration for you. To create it yourself, follow the AWS Console or AWS CLI instructions, including granting the management account's Infracost role access to the export bucket.
Which configuration does Infracost use?
Infracost selects one configuration per management account, using the same selection for health checks and reading S3 usage data:
- Disabled configurations are ignored.
- Configuration IDs starting with
InfracostStorageLensExporttake priority. If any enabled configuration with that prefix has a missing or invalid export destination or is not using Parquet, fix it or disable it if it is no longer needed. Infracost does not silently fall back to another export. - If there is no enabled configuration with that prefix, Infracost uses a suitable enabled Parquet configuration. When several configurations have the same priority, the alphabetically first configuration ID wins.
Other configurations listed in the health check are informational. Their bucket permissions do not affect the selected configuration's S3 access check. If the selected export is inaccessible or empty, Infracost does not switch to another configuration.
For custom setups, also check the home region of your Storage Lens configuration. Infracost searches the S3 destination regions reported by your BCM Data Exports, even if those exports are unhealthy. If no destination region is available, it searches us-east-1. It does not search every AWS region. Using us-east-1 for the setup in these guides avoids a region mismatch; contact support@infracost.io if your existing configuration is in another region that is not being searched.
Resolve Storage Lens health check results
Check the Storage Lens discovery and Storage Lens S3 access results when testing your AWS integration:
| Result | What to check |
|---|---|
| Discovery reports no suitable configuration found | In the management account's S3 > Storage Lens console, confirm the configuration is enabled, has metrics export turned on, uses Parquet, and points to the intended bucket. Check its home region as described above. |
| Discovery reports a preferred configuration does not qualify | Fix the InfracostStorageLensExport... configuration named in the message, or disable it if it is unused. Creating a differently named export will not bypass an enabled, invalid preferred configuration. |
| Discovery fails with Access Denied, or reports partial discovery | Check that the management account's Infracost role can call s3:ListStorageLensConfigurations and s3:GetStorageLensConfiguration in the searched regions. Resolve the AWS error and test again. An incomplete discovery cannot confirm which export to use, so the S3 access check is skipped. |
| S3 access fails with Access Denied | Use the selected configuration ID and bucket in the message. Check the role's s3:ListBucket and s3:GetObject permissions for that bucket and export prefix, along with bucket policies and any explicit denies. For SSE-KMS exports, check the role's decrypt permissions and the KMS key policy too. See the bucket access and KMS instructions. |
| S3 access is skipped because the bucket/prefix is empty | Listing succeeded, but there was no object to download, so read access is not yet verified. Confirm the bucket and prefix match the selected export and allow up to 24 hours for AWS's first delivery. If it stays empty, check the bucket policy allows Storage Lens to write exports. |
After correcting a configuration or permissions issue, test the connection again. A passed S3 access check verifies listing and downloading a sample object; it does not mean the latest S3 usage data has already been imported. Infracost refreshes S3 usage data daily and checks the live AWS configuration on each run, independently of the health check. After changing the selected configuration, bucket, or prefix, allow a new import to complete rather than treating previously displayed data as confirmation that the new export works.
If the issue persists, contact support@infracost.io with the management account ID, selected configuration ID and home region, export bucket and prefix, and the full health check message.