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

google_document_ai_processor resource fails when setting the "eu" location. #12015

Assignees
Labels

Comments

@moiseslodeiroedosoft
Copy link

moiseslodeiroedosoft commented Jul 4, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.2.4
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v4.27.0
  • provider registry.terraform.io/hashicorp/random v3.3.2

Affected Resource(s)

  • google_document_ai_processor

Terraform Configuration Files

Failing configuration

locals {
  name_suffix = "${random_pet.suffix.id}"
}

resource "random_pet" "suffix" {
  length = 2
}

provider "google" {
  region = "europe-west2"
  zone   = "europe-west2-a"
}

resource "google_document_ai_processor" "processor" {
  location = "eu"
  display_name = "test-processor-${local.name_suffix}"
  type = "OCR_PROCESSOR"
}

Working configuration (just chancing region and location)

locals {
  name_suffix = "${random_pet.suffix.id}"
}

resource "random_pet" "suffix" {
  length = 2
}

provider "google" {
  region = "us-central1"
  zone   = "us-central1-c"
}

resource "google_document_ai_processor" "processor" {
  location = "us"
  display_name = "test-processor-${local.name_suffix}"
  type = "OCR_PROCESSOR"
}

Debug Output

Gist error google_document_ai_processor

Expected Behavior

It should have created a resource of type google_document_ai_processor in the europe region (cannot change endpoint for european one https://cloud.google.com/document-ai/docs/reference/rest#service-endpoint)

Actual Behavior

Throws the following error

Error: Error creating Processor: googleapi: Error 400: Request contains an invalid argument.

Steps to Reproduce

  1. Log into gcloud with gcloud auth application-default login (or modify the script to accept credentials)
  2. terraform plan
  3. terraform apply

Important Factoids

  1. The error is displayed when authenticated with a service account and also with terminal login.
  2. There is no possibility to change the hostname according to Google DocumentAI for Europe (https://cloud.google.com/document-ai/docs/reference/rest#service-endpoint)
    `
@edwardmedia edwardmedia self-assigned this Jul 4, 2022
@edwardmedia
Copy link
Contributor

#10684

@moiseslodeiroedosoft
Copy link
Author

Thank you for your response @edwardmedia . I have tried to make use of the MMs by compiling my own version of terraform-provider-google but it doesn't work. I don't know if I have made a mistake since the documentation is a bit confusing and unclear about it. I have even enabled the terraform provider installation in the .terraformrc and still not working. Any alternative?

`provider_installation {
dev_overrides {
"hashicorp/google" = "/home/mlodsan/go/bin"
}

    direct {}

}`

Warning: Provider development overrides are in effect │ │ The following provider development overrides are set in the CLI configuration: │ - hashicorp/google in /home/mlodsan/go/bin

...

google_document_ai_processor.ocr_processor: Creating... ╷ │ Error: Error creating Processor: googleapi: Error 400: Request contains an invalid argument. │ │ with google_document_ai_processor.ocr_processor, │ on main.tf line 74, in resource "google_document_ai_processor" "ocr_processor": │ 74: resource "google_document_ai_processor" "ocr_processor" { │ ╵

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.