Skip to content
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

[FEAT]: Reduce API throttling by reading all env variables per env at once. #2526

Open
1 task done
DavidWHarvey opened this issue Dec 30, 2024 · 0 comments
Open
1 task done
Labels
Status: Triage This is being looked at and prioritized Type: Feature New feature or request

Comments

@DavidWHarvey
Copy link

Describe the need

When running plans against 64 repos, we hit API throttling at about an order of magnitude earlier due to the reading of env variables one at a time rather than one API call to get all of them (the data source can read them all in one call). WRT number of resources per repo, env variables currently dominate, since there may be 10 or 50 per environment.

We are re-planning repos and Azure resources (using a matrix per repo - so one plan per repo in parallel), and the process takes about 8 minutes on 64 repos, consuming about 60% of the budget, i.e., we cannot run this twice in the same hour.

I have identified 3 possible solutions:

  • on a read, read all values for the environment and cache them in memory. This is simple, but I'm unclear about how this might affect terraform.
  • create a new resource that holds the env variable map for the entire environment, similar to the data source.
  • Work around this with a provisioner and the data source to trigger the provisioner to run. The provisioner would sync a per env map with the contents of the environment.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@DavidWHarvey DavidWHarvey added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant