googleapi: Error 400: Invalid value for field 'region': 'global'. Unknown region., invalid
when running import google
without regions
flag
#1928
Labels
When running
terraformer import google
without theregions
flag, the following error appears in the log:Although this error doesn't stop the command from completing successfully, it's misleading and could cause confusion for users.
Cause:
The issue arises because, if the
regions
flag is not set,global
is used as the default value for the region. However,global
is not a valid region for this API call:This call triggers the following gRPC API request:
Since
global
is not a recognized region, the API responds with an error.Proposed Solution:
To fix this, the code should handle the case when the region is set to
global
by skipping the API call. This could be implemented by adding a conditional check in thegetRegion
function:By making this change, the error message will no longer appear when
global
is used as the default region, and it will prevent unnecessary API requests.Additional Information:
regions
flag is not provided.The text was updated successfully, but these errors were encountered: