Skip to content

About

Terraform module for setting up a shared AWS CUR for Stacklet

Topics

Resources

Stars

0 stars

Watchers

3 watching

Forks

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

Name Version
terraform >= 1.14.0
aws ~> 6.0

Providers

Name Version
aws ~> 6.0

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  = "stacklet/stacklet-cur-setup/aws"
  version = "0.1.0"

  customer_prefix          = ""
  stacklet_saas_account_id = ""
}

Versioning

This module is published to the Terraform Registry. Set source to the registry address and pin version to a release.

version takes the usual constraint syntax. This module is pre-1.0, and on a 0.x line a minor release is where it ships breaking changes, so pin at the patch level: ~> 0.1.0 accepts 0.1.1 and later patches and holds at 0.2.0. Read the release notes before moving to a new minor.

About

Terraform module for setting up a shared AWS CUR for Stacklet

Topics

Resources

Stars

0 stars

Watchers

3 watching

Forks

Used by

Contributors

Languages