{"id":18535791,"url":"https://github.com/iamfrench/terraform-aws-billing-export","last_synced_at":"2026-03-03T16:08:57.016Z","repository":{"id":237455793,"uuid":"618163392","full_name":"IAmFrench/terraform-aws-billing-export","owner":"IAmFrench","description":"Terraform Module which creates FinOps FOCUS billing export on AWS.","archived":false,"fork":false,"pushed_at":"2025-11-23T00:45:06.000Z","size":158,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T02:15:37.395Z","etag":null,"topics":["aws","aws-billing","aws-cur","finops","finops-focus","focus","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/IAmFrench/billing-export/aws/latest","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IAmFrench.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-23T22:07:50.000Z","updated_at":"2025-11-23T00:45:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"96d9c4ca-9ca6-47c7-9915-ccd0d744da02","html_url":"https://github.com/IAmFrench/terraform-aws-billing-export","commit_stats":null,"previous_names":["iamfrench/terraform-aws-billing-export"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/IAmFrench/terraform-aws-billing-export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2Fterraform-aws-billing-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2Fterraform-aws-billing-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2Fterraform-aws-billing-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2Fterraform-aws-billing-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IAmFrench","download_url":"https://codeload.github.com/IAmFrench/terraform-aws-billing-export/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmFrench%2Fterraform-aws-billing-export/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30051191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T15:26:47.567Z","status":"ssl_error","status_checked_at":"2026-03-03T15:26:17.132Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-billing","aws-cur","finops","finops-focus","focus","terraform","terraform-modules"],"created_at":"2024-11-06T19:27:37.561Z","updated_at":"2026-03-03T16:08:57.011Z","avatar_url":"https://github.com/IAmFrench.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amazon Web Services (AWS) Billing export Terraform Module\n\nTerraform module witch creates FinOps FOCUS billing export on AWS.\n\nFOCUS v1.2 billing export for AWS now available!\n\nThis module will create a S3 bucket for AWS billing exports.\n\n![AWS FOCUS Billing exports](./assets/aws_focus_billing_exports.png)\n\n## What is FOCUS™?\n\nThe FinOps Cost and Usage Specification (FOCUS™) is an open-source specification that defines clear requirements for cloud vendors to produce consistent cost and usage datasets.\n\nSupported by the FinOps Foundation, FOCUS™ aims to reduce complexity for FinOps Practitioners so they can drive data-driven decision-making and maximize the business value of cloud, while making their skills more transferable across clouds, tools, and organizations.\n\nLearn more about FOCUS in [What is FOCUS?](https://focus.finops.org/what-is-focus/).\n\n## Usage\n\n```terraform\n# FOCUS v1.2 AWS billing export with the creation of the S3 bucket\nmodule \"aws_billing_export\" {\n  source  = \"IAmFrench/billing-export/aws\"\n\n  # Version of this module, see release on GitHub: https://github.com/IAmFrench/terraform-aws-billing-export/releases\n  version = \"1.0.6\"\n  \n  # Name of the S3 bucket to create exports in\n  s3_bucket_name   = \"finops-exports-1a2b3c4d\"\n  # Type of the export\n  export_type      = \"FOCUS\"\n  # Version of the export\n  export_version   = \"1.2\"\n  # Name of the export\n  export_name      = \"focus-v1-2-export\"\n  # Prefix of the export\n  export_s3_prefix = \"focus/v1.2/1234556789\"\n}\n```\n\n```terraform\n# FOCUS v1.2 AWS billing export with an existing S3 bucket\nmodule \"aws_billing_export\" {\n  source  = \"IAmFrench/billing-export/aws\"\n\n  # Version of this module, see release on GitHub: https://github.com/IAmFrench/terraform-aws-billing-export/releases\n  version = \"1.0.6\"\n  \n  # Name of the S3 bucket to create exports in\n  s3_bucket_name   = data.aws_s3_bucket.export.id\n  # Should this module create the S3 bucket with associated policy?\n  create_s3_bucket = false\n  # Type of the export\n  export_type      = \"FOCUS\"\n  # Version of the export\n  export_version   = \"1.2\"\n  # Name of the export\n  export_name      = \"focus-v1-2-export\"\n  # Prefix of the export\n  export_s3_prefix = \"focus/v1.2/1234556789\"\n}\n```\n## Roadmap\n\n- [X] FOCUS `v1.2` export [Data Exports for FOCUS 1.2 is now generally available](https://aws.amazon.com/blogs/aws-cloud-financial-management/data-exports-for-focus-1-2-is-now-generally-available/)\n- [X] FOCUS `v1.0` export [Data Exports for FOCUS 1.0 is now in general availability](https://aws.amazon.com/blogs/aws-cloud-financial-management/data-exports-for-focus-1-0-is-now-generally-available/) \n- [X] FOCUS `v1.0-preview` export [Announcing Data Exports for FOCUS 1.0 (Preview) in AWS Billing and Cost Management](https://aws.amazon.com/blogs/aws-cloud-financial-management/announcing-data-exports-for-focus-1-0-preview-in-aws-billing-and-cost-management/)\n\n## Common errors\n\n- `ValidationException: S3 bucket permission validation failed`: The existing S3 bucket is missing the policy to allow AWS export services to write to the bucket, see https://docs.aws.amazon.com/cur/latest/userguide/dataexports-s3-bucket.html\n- `ServiceQuotaExceededException: Account has reached the resource limit of 2 on FOCUS_1_2_AWS table.`: You already have 2 FOCUS exports (version 1.2). You will need to delete at least one of the existing exports to create a new one. Billing and Cost Management \u003e Cost and Usages Analysis \u003e Data Exports.\n\n## Backfill Request\n\nAWS Data Export service doesn't support backfill when creating the export. Therefore you will need to open a support case.\n\nHere is an support ticket sample to request a backfill:\n\n```\nPlease backfill the data export for the following export:\nexport name: finops-focus-1-2-export\nexport id: arn:aws:bcm-data-exports:us-east-1:\u003caws-account-id\u003e\u003e:export/finops-focus-1-2-export-\u003crandom-uuid\u003e\n\nDesired start date: YYYY-MM-DD\n```\n\n## Minimum permissions\n\nYou can use the following IAM policy to allow a user to create and delete a FOCUS billing export using this Terraform module:\n\nNote: This first policy assumes that you use a bucket name starting with `finops-exports-` (as demonstrated in the [example](./examples/) folder).\n\n```json\n{\n\t\"Version\": \"2012-10-17\",\n\t\"Statement\": [\n\t\t{\n\t\t\t\"Sid\": \"Statement1\",\n\t\t\t\"Effect\": \"Allow\",\n\t\t\t\"Action\": [\n\t\t\t\t\"s3:CreateBucket\",\n\t\t\t\t\"s3:ListBucket\",\n\t\t\t\t\"s3:GetBucketPolicy\",\n\t\t\t\t\"s3:GetBucketAcl\",\n\t\t\t\t\"s3:GetBucketCORS\",\n\t\t\t\t\"s3:GetBucketWebsite\",\n\t\t\t\t\"s3:GetBucketVersioning\",\n\t\t\t\t\"s3:GetAccelerateConfiguration\",\n\t\t\t\t\"s3:GetBucketRequestPayment\",\n\t\t\t\t\"s3:GetBucketLogging\",\n\t\t\t\t\"s3:GetLifecycleConfiguration\",\n\t\t\t\t\"s3:GetReplicationConfiguration\",\n\t\t\t\t\"s3:GetEncryptionConfiguration\",\n\t\t\t\t\"s3:GetBucketObjectLockConfiguration\",\n\t\t\t\t\"s3:GetBucketTagging\",\n\t\t\t\t\"s3:DeleteBucket\",\n\t\t\t\t\"s3:PutBucketPolicy\",\n\t\t\t\t\"s3:DeleteBucketPolicy\",\n\t\t\t\t\"s3:ListBucketVersions\",\n\t\t\t\t\"s3:DeleteObjectVersion\",\n\t\t\t\t\"s3:DeleteObject\"\n\t\t\t],\n\t\t\t\"Resource\": \"arn:aws:s3:::finops-exports-*\"\n\t\t}\n\t]\n}\n```\n\n```json\n{\n\t\"Version\": \"2012-10-17\",\n\t\"Statement\": [\n\t\t{\n\t\t\t\"Sid\": \"Statement1\",\n\t\t\t\"Effect\": \"Allow\",\n\t\t\t\"Action\": [\n\t\t\t\t\"bcm-data-exports:CreateExport\",\n\t\t\t\t\"bcm-data-exports:GetExport\",\n\t\t\t\t\"bcm-data-exports:ListTagsForResource\",\n\t\t\t\t\"bcm-data-exports:DeleteExport\"\n\t\t\t],\n\t\t\t\"Resource\": [\n\t\t\t\t\"arn:aws:bcm-data-exports:us-east-1:*:export/*\",\n\t\t\t\t\"arn:aws:bcm-data-exports:us-east-1:*:table/FOCUS_*\"\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"Sid\": \"Statement2\",\n\t\t\t\"Effect\": \"Allow\",\n\t\t\t\"Action\": [\n\t\t\t\t\"cur:putReportDefinition\"\n\t\t\t],\n\t\t\t\"Resource\": \"arn:aws:cur:us-east-1:*:/putReportDefinition\"\n\t\t}\n\t]\n}\n```\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | ~\u003e 1.1 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | ~\u003e 6.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | ~\u003e 6.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_bcmdataexports_export.focus](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/bcmdataexports_export) | resource |\n| [aws_s3_bucket.export](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |\n| [aws_s3_bucket_policy.allow_data_export](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n| [aws_iam_policy_document.allow_data_export](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_s3_bucket.export](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_bucket) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_create_s3_bucket\"\u003e\u003c/a\u003e [create\\_s3\\_bucket](#input\\_create\\_s3\\_bucket) | Option to create or not the S3 bucket for the billing export.\u003cbr/\u003eIf set to `false`, this module will not create the S3 bucket.\u003cbr/\u003eTherefore please check that bucket policies are sets to allow AWS export services to write files in it.\u003cbr/\u003eMore info: https://docs.aws.amazon.com/cur/latest/userguide/dataexports-s3-bucket.html\u003cbr/\u003e\u003cbr/\u003eE.g.: `true`, `false` | `bool` | `true` | no |\n| \u003ca name=\"input_export_name\"\u003e\u003c/a\u003e [export\\_name](#input\\_export\\_name) | Name of the billing export. \u003cbr/\u003eValidation: Export name must be unique, not include spaces, and contain only alphanumeric and characters ! - \\_ . * ' ( )\u003cbr/\u003eE.g.: `focus-v1-2` | `string` | n/a | yes |\n| \u003ca name=\"input_export_s3_prefix\"\u003e\u003c/a\u003e [export\\_s3\\_prefix](#input\\_export\\_s3\\_prefix) | Prefix of the billing export.\u003cbr/\u003eE.g.: `focus/v1.2/123456789` with `123456789` being the account id | `string` | `\"\"` | no |\n| \u003ca name=\"input_export_type\"\u003e\u003c/a\u003e [export\\_type](#input\\_export\\_type) | Version of the billing export.\u003cbr/\u003eValid values: `FOCUS`\u003cbr/\u003eE.g.: `FOCUS` | `string` | n/a | yes |\n| \u003ca name=\"input_export_version\"\u003e\u003c/a\u003e [export\\_version](#input\\_export\\_version) | Version of the billing export. Should be use with `export_type`.\u003cbr/\u003eValid values are:\u003cbr/\u003e- `1.2`, `1.0` and `1.0-preview` for FOCUS\u003cbr/\u003eE.g.: `1.2`, `1.0`, `1.0-preview` | `string` | n/a | yes |\n| \u003ca name=\"input_s3_bucket_name\"\u003e\u003c/a\u003e [s3\\_bucket\\_name](#input\\_s3\\_bucket\\_name) | Name of the S3 bucket to be created\u003cbr/\u003eE.g.: `finops-focus-export-a1b2c3d4` | `string` | n/a | yes |\n| \u003ca name=\"input_s3_force_destroy\"\u003e\u003c/a\u003e [s3\\_force\\_destroy](#input\\_s3\\_force\\_destroy) | Force the destruction of the S3 bucket containing the billing export when the \u003cbr/\u003emodule is destroyed even if it contains objects.\u003cbr/\u003e\u003cbr/\u003eE.g.: `true`, `false`\u003cbr/\u003e\u003cbr/\u003eDefault is `false`. | `bool` | `false` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | Tags to apply to all created resources.\u003cbr/\u003e\u003cbr/\u003eE.g.:\u003cpre\u003e{\u003cbr/\u003e  createdBy = \"Terraform\"\u003cbr/\u003e}\u003c/pre\u003e | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_export_arn\"\u003e\u003c/a\u003e [export\\_arn](#output\\_export\\_arn) | ARN of the export |\n| \u003ca name=\"output_s3_arn\"\u003e\u003c/a\u003e [s3\\_arn](#output\\_s3\\_arn) | ARN of the export bucket |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfrench%2Fterraform-aws-billing-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamfrench%2Fterraform-aws-billing-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfrench%2Fterraform-aws-billing-export/lists"}