Our Infrastructure has over a 1500 user resources, and we want to start using Terraform to manage these, but because we also have a lot of teams it is taking a lot of time to refresh the resources when running terraform plan/apply. Whenever user resource refresh is initiated it starts searching for all "teams" it is part of, but since there isn't a direct api call to query all "invitations" for this users email, it starts going through all team in our organisation and for us it takes ~1 min per user. So based on this calculated it would take us over 1500 minutes, which is too long.
Would be nice if there was an API endpoint that was used to get all invitations for an email, then only one request is needed to be called out, instead of 180+ requests (for our organisation). Based on what the current API endpoint returns it should be possible to implement a search/query by passing along an email.
Similar improvement (https://github.com/rollbar/terraform-provider-rollbar/pull/357) was done for projects with the provider-version update to 1.12.0. (Projects teams are now queryable by ProjectID instead of going through all teams projects to find the teams one project is part of). And this really helped us, making our 1500+ project resources refreshed in 18 minutes.
Our Infrastructure has over a 1500 user resources, and we want to start using Terraform to manage these, but because we also have a lot of teams it is taking a lot of time to refresh the resources when running
terraform plan/apply
. Whenever user resource refresh is initiated it starts searching for all "teams" it is part of, but since there isn't a direct api call to query all "invitations" for this users email, it starts going through all team in our organisation and for us it takes ~1 min per user. So based on this calculated it would take us over 1500 minutes, which is too long.This is the function where all teams are being checked to find the invitations for one user: https://github.com/rollbar/terraform-provider-rollbar/blob/be38bdcbb44f814454559d5340d58c9cdda106d7/client/invitation.go#L238
Would be nice if there was an API endpoint that was used to get all invitations for an email, then only one request is needed to be called out, instead of 180+ requests (for our organisation). Based on what the current API endpoint returns it should be possible to implement a search/query by passing along an email.
Similar improvement (https://github.com/rollbar/terraform-provider-rollbar/pull/357) was done for projects with the provider-version update to 1.12.0. (Projects teams are now queryable by ProjectID instead of going through all teams projects to find the teams one project is part of). And this really helped us, making our 1500+ project resources refreshed in 18 minutes.