cloudfoundry-community / terraform-provider-cloudfoundry

Terraform Cloud Foundry Provider
https://registry.terraform.io/providers/cloudfoundry-community/cloudfoundry/latest
Mozilla Public License 2.0
75 stars 87 forks source link

Issue for CF-RateLimitV2APIExceeded #478

Open michael1011101 opened 1 year ago

michael1011101 commented 1 year ago

When I executed the "terraform apply", it failed with error code "CF-RateLimitV2APIExceeded".

│ Error: Error when loading default quota: Unexpected Response
│ Response code: 429
│ CC code:       10018
│ CC error code: CF-RateLimitV2APIExceeded
│ Request ID:    ***
│ Description:   Rate Limit of V2 API Exceeded. Please consider using the V3 API

The provider version is

cloudfoundry = {
      source  = "cloudfoundry-community/cloudfoundry"
      version = "0.50.3"
}

Do you have any ideas to solve or workaround this issue?

janosbinder commented 1 year ago

Hi Wang,

I think one of the API calls have been not ported to CFAPIv3. Can you give more details, on which call type do you see this error?

sleungcy commented 1 year ago

@janosbinder is there a way to get the provider to print out the api calls used?

To print out the output to standard out:

export TF_LOG=debug

In my case, I found the below api calls, obsfucated all sensitive info with 'x'

GET /v2/apps?q=x&q=space_guid=x 
GET /v2/info 
GET /v2/service_keys?q=x&q=service_instance_guid=x 
GET /v3/apps/x 
GET /v3/apps/x/droplets/current 
GET /v3/apps/x/environment_variables 
GET /v3/apps/x/features/ssh 
GET /v3/apps/x/processes/web 
GET /v3/apps/x/routes 
GET /v3/apps?guids=x 
GET /v3/domains 
GET /v3/domains/x 
GET /v3/domains?page=2&per_page=50 
GET /v3/organization_quotas?names=default 
GET /v3/organizations/x 
GET /v3/organizations?names=x 
GET /v3/routes?guids=x 
GET /v3/service_credential_bindings/x/details 
GET /v3/service_credential_bindings?app_guids=x 
GET /v3/service_credential_bindings?names=x&service_instance_guids=x 
GET /v3/service_instances/x/credentials 
GET /v3/service_instances?guids=x 
GET /v3/service_instances?names=x&space_guids=x
GET /v3/service_offerings?fields%5Bservice_broker%5D=name%2Cguid&names=x
GET /v3/service_offerings?fields%5Bservice_broker%5D=name%2Cguid&names=x 
GET /v3/service_plans?service_offering_guids=x 
GET /v3/spaces/x 
GET /v3/spaces?names=x&organization_guids=x 
GET /v3/stacks/x 
GET /v3/stacks?guids=x 
GET /v3/stacks?names=x 
michael1011101 commented 1 year ago

It failed with the following codes. @janosbinder

data "cloudfoundry_org" "myorg" {
  name = var.org_name
}

data "cloudfoundry_space" "myspace" {
  name = var.space_name
  org = data.cloudfoundry_org.myorg.id
}
Thanhphan1147 commented 1 year ago

Indeed these datasources have not been updated to use the v3 API. The process is quite simple however, I'll see if I can find the time to do it.