Skip to content

Commit

Permalink
chore: npm run format
Browse files Browse the repository at this point in the history
  • Loading branch information
aliscott committed Aug 7, 2024
1 parent dc1a675 commit ffaa130
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion docs/features/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,16 @@ For Terraform Cloud/Enterprise users, used to specify the organization name. Thi
Accepts a comma separated list of `source=dest` pairs, and replaces any matched source URL value found in Terraform `module` or Terragrunt `terraform` blocks. This is useful when you have module URLs that are referenced in your infra-as-code repos one way (e.g. using a private URL), but they should use a different URL when Infracost runs them (e.g. using a public URL). See [this docs section](/docs/features/terraform_modules/#source-map) for more details.

### INFRACOST_SPACELIFT_API_KEY_ENDPOINT

- The URL to your Spacelift account, e.g., `https://mycorp.app.spacelift.io`. For more information see our documentation on our Spacelift integration [here](/docs/integrations/spacelift/).

### INFRACOST_SPACELIFT_API_KEY_ID

- The ID of your Spacelift API key. For more information see our documentation on our Spacelift integration [here](/docs/integrations/spacelift/).

### INFRACOST_SPACELIFT_API_KEY_SECRET
- The secret associated with your API key. This is only available when the secret is created. For more information see our documentation on our Spacelift integration [here](/docs/integrations/spacelift/).

- The secret associated with your API key. This is only available when the secret is created. For more information see our documentation on our Spacelift integration [here](/docs/integrations/spacelift/).

### INFRACOST_PARALLELISM

Expand Down
13 changes: 7 additions & 6 deletions docs/integrations/spacelift.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ Infracost integrates with Spacelift to fetch environment variables and propagate
### How to Configure Infracost with Spacelift

1. **Generate an API Key:**
- Create an API key in your Spacelift account. More information on generating a token can be found [here](https://docs.spacelift.io/integrations/api#spacelift-api-key-token).
- Assign **reader** access to the spaces from which you want to read environment variables.

- Create an API key in your Spacelift account. More information on generating a token can be found [here](https://docs.spacelift.io/integrations/api#spacelift-api-key-token).
- Assign **reader** access to the spaces from which you want to read environment variables.

2. **Define Environment Variables:**
Define the following environment variables in one of the VCS integrations you've enabled in Infracost cloud:
- **INFRACOST_SPACELIFT_API_KEY_ENDPOINT**: The URL to your Spacelift account, e.g., `https://mycorp.app.spacelift.io`.
- **INFRACOST_SPACELIFT_API_KEY_ID**: The ID of your Spacelift API key.
- **INFRACOST_SPACELIFT_API_KEY_SECRET**: The secret associated with your API key. This is only available when the secret is created and should be viewable in the file that is auto-downloaded from Spacelift.

- **INFRACOST_SPACELIFT_API_KEY_ENDPOINT**: The URL to your Spacelift account, e.g., `https://mycorp.app.spacelift.io`.
- **INFRACOST_SPACELIFT_API_KEY_ID**: The ID of your Spacelift API key.
- **INFRACOST_SPACELIFT_API_KEY_SECRET**: The secret associated with your API key. This is only available when the secret is created and should be viewable in the file that is auto-downloaded from Spacelift.

You can configure these environment variables in Infracost cloud by selecting a created VCS integration in your organization settings and navigating to the "Run configurations" tab.

Expand All @@ -26,4 +28,3 @@ Infracost integrates with Spacelift to fetch environment variables and propagate
If you are using a manual CI/CD integration, you can define the environment variables in the CI/CD system you are using.

> **Note:** For Infracost to populate the environment variables, it needs to infer the Spacelift space name from your local directory. Infracost does this by attempting to match local Terraform var file names or local directories to the Spacelift space name. For example, Infracost would attempt to find environment variables for a "dev" space if a `dev.tfvars` file is located in a Terraform directory.

0 comments on commit ffaa130

Please sign in to comment.