Repository navigation
docs: deprecate this repo in favor of the per-cloud modules (ENG-8762) #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,33 @@ | ||
| # 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 | ||
|
|
||
| > [!TIP] | ||
| > For AWS users, a Terraform module is available at https://github.com/stacklet/terraform-aws-stacklet-cur-setup | ||
|
|
||
| ### 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. | ||
|
|
||
| ### Inputs | ||
|
|
||
| The terraform accepts three inputs: | ||
|
|
||
| * `customer_prefix` - (required) The customer prefix | ||
| * `stacklet_saas_account_id` - (required) The account ID where the Stacklet platform for this customer is deployed | ||
| * `s3_region` - (optional) AWS region where the s3 bucket is created (default: us-east-1) | ||
| * `clouds` - (required) List of clouds to set up, requires ["aws"] | ||
|
|
||
| If you need help identifying the correct values for `customer_prefix` and `stacklet_saas_account_id`, please contact Stacklet customer service. | ||
|
|
||
| ## Azure | ||
|
|
||
| ### Overview | ||
|
|
||
| The terraform in this repository is meant to be applied in each subscription, independent of any account in which the Stacklet platform is running, and must be applied by a user or service principal that has permissions to create Cost Management exports, storage accounts, and resource groups. Stacklet utilizes credentials provided in Stacklet to read from the created Storage Account. | ||
|
|
||
| It does the following: | ||
|
|
||
| * Creates a Resource Group to contain all created resources | ||
| * Creates a Storage Account to store cost management exports | ||
| * Creates a Cost Management export job to push data into the Storage Account | ||
|
|
||
| This setup ensures that the Cost Management export is in the format required by Stacklet. | ||
|
|
||
| ### Inputs | ||
|
|
||
| The terraform accepts three inputs: | ||
|
|
||
| * `customer_prefix` - (required) The customer prefix | ||
| * `clouds` - (required) List of clouds to set up, requires ["azure"] | ||
| * `resource_group_location` - (required) Resource Group Location | ||
|
|
||
| If you need help identifying the correct value for `customer_prefix`, please contact Stacklet customer service. | ||
|
|
||
| ## Running the Terraform | ||
|
|
||
| Make sure you update the `export`s below with real values. | ||
|
|
||
| ```bash | ||
| cd terraform/ | ||
| terraform init | ||
| terraform plan | ||
| terraform apply | ||
| ``` | ||
| > [!WARNING] | ||
| > This repository is deprecated and no longer maintained. Use the dedicated | ||
| > module for your cloud instead: | ||
| > | ||
| > * AWS: [terraform-aws-stacklet-cur-setup](https://github.com/stacklet/terraform-aws-stacklet-cur-setup) | ||
| > * Azure: [terraform-azure-stacklet-cost-setup](https://github.com/stacklet/terraform-azure-stacklet-cost-setup) | ||
|
|
||
| This repository configured cost reporting in your cloud account, so that the | ||
| Stacklet platform running elsewhere could read it. That automation now lives in | ||
| the two repositories above, one per cloud. Each is a reusable Terraform module | ||
| with its own documentation, and each carries fixes that this repository never | ||
| received. | ||
|
|
||
| The Terraform here remains only as a record of what existing users deployed. Do | ||
| not start a new setup from it. | ||
|
|
||
| ## Migrating | ||
|
|
||
| Follow the README of the repository for your cloud. Neither module is a drop-in | ||
| replacement for what is here. | ||
|
|
||
| * The Azure module requires a new `stacklet_principal_id` input, and it declares | ||
| no provider block. Its README covers both changes under "Migrating to 1.0.0". | ||
| * The AWS module drops the `s3_region` input and takes the region from the | ||
| `aws` provider that the caller configures. Set a region on that provider, or | ||
| in the environment, since the module no longer defaults to `us-east-1`. | ||
| * Each module covers a single cloud, so the `clouds` input has no equivalent. | ||
| Apply the module for the cloud you need. | ||
|
|
||
| Contact Stacklet customer service for help identifying `customer_prefix` or any | ||
| other Stacklet-supplied value. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.