Currently to enable infracost, two things are necessary:
add the infracost label to a stack
set the INFRACOST_API_KEY environment variable
In order to disable infracost for specific situations (e.g. local preview run or drift detection run), one has to manipulate the INFRACOST_API_KEY environment variable in order to prevent the call from happening.
It would be good to have better control over this, and not have to manipulate the INFRACOST_API_KEY environment variable (which I assume will still make the call to infracost, and Infracost will block it because of the bad API key).
```
[[ "$TF_VAR_spacelift_run_trigger" = "spacelift/drift_detection" || "$TF_VAR_spacelift_local_preview" = "true" ]] && export INFRACOST_API_KEY=disabled && export INFRACOST_WARN_ON_FAILURE=true || true
```
It would be nice to have an INFRACOST_ENABLED environment value that is possible to configure on the fly, which would prevent the calls from actually made and allowing us better control over the infracost integration.
Please authenticate to join the conversation.
π Discovery
π‘ Feature Requests
Integrations
About 2 months ago
Get notified by email when there are changes.
π Discovery
π‘ Feature Requests
Integrations
About 2 months ago
Get notified by email when there are changes.