Skip to content

stacklet/terraform-aws-stacklet-cur-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-stacklet-cur-setup

Cost and Usage Report (CUR) setup for Stacklet customers

This repository provides automation for setting up a CUR in your organizational account in such a way that the Stacklet platform, running in a different account, can access and use the CUR data.

More background information, along with instructions for accomplishing the same thing via the AWS console, can be found in the Stacklet documentation.

AWS

Overview

The terraform in this repository is meant to be applied in your organization's payer account, independent of any account in which the Stacklet platform is running, and must be applied by a role that has permissions to create a new CUR in the AWS billing console.

It does the following:

  • Creates an S3 bucket named <customer-prefix>-stacklet-shared-cur in your organization's account
  • Creates an hourly CUR, with resource IDs, in parquet format, which is written to the S3 bucket
  • Grants limited read permissions to the S3 bucket, by the <customer-prefix>-cur-read role in the Stacklet platform SAAS account

This setup ensures that the CUR is in the format required by Stacklet, and that the Stacklet platform SAAS account can read CUR data in the correct S3 bucket.

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_cur_report_definition.stacklet_shared_cur_report resource
aws_s3_bucket.cur_bucket resource
aws_s3_bucket_ownership_controls.bucket_ownership resource
aws_s3_bucket_policy.s3-bucket-cur-report-policy resource
aws_s3_bucket_public_access_block.block_public_access resource
aws_s3_bucket_server_side_encryption_configuration.cur_bucket_encryption_config resource
aws_region.current data source

Inputs

Name Description Type Default Required
customer_prefix Stacklet provided customer prefix string n/a yes
stacklet_saas_account_id Stacklet provided SaaS Account ID string n/a yes

Outputs

Name Description
output n/a

Usage

module "cur-setup" {
  source = "github.com/stacklet/terraform-aws-stacklet-cur-setup"
  customer_prefix = ""
  stacklet_saas_account_id = ""
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages