hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.34k stars 1.75k forks source link

Unable to provision google_healthcare_* resources #11532

Closed itsbalamurali closed 2 years ago

itsbalamurali commented 2 years ago

Community Note

Terraform Version

Terraform v1.1.8
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v4.18.0

Affected Resource(s)

Terraform Configuration Files

resource "google_healthcare_dataset" "dev_dataset" {
  project   = "some-test-project-id"
  name      = "dev-dataset"
  location  = "asia-south1"
  time_zone = "UTC"
}

# resource "google_pubsub_topic" "topic" {
#   name = "fhir-notifications"
# }

resource "google_healthcare_fhir_store" "dev_fhir_store" {
  name    = "dev-fhir-store"
  dataset = google_healthcare_dataset.dev_dataset.id
  version = "R4"

  enable_update_create          = false
  disable_referential_integrity = false
  disable_resource_versioning   = false
  enable_history_import         = true

  labels = {
    "enviroment" = "development"
  }
}

Expected Behavior

Provision google_healthcare_dataset & google_healthcare_fhir_store.

Actual Behavior

β•·
β”‚ Error: Error creating Dataset: googleapi: got HTTP response code 404 with body: <!DOCTYPE html>
β”‚ <html lang=en>
β”‚   <meta charset=utf-8>
β”‚   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
β”‚   <title>Error 404 (Not Found)!!1</title>
β”‚   <style>
β”‚     *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
β”‚   </style>
β”‚   <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
β”‚   <p><b>404.</b> <ins>That’s an error.</ins>
β”‚   <p>The requested URL <code>/v1/projects/projects/some-test-project-id/locations/asia-south1/datasets?alt=json&amp;datasetId=dev-dataset</code> was not found on this server.  <ins>That’s all we know.</ins>
β”‚ 
β”‚ 
β”‚   with google_healthcare_dataset.dev_dataset,
β”‚   on gcp_healthcare_datasets.tf line 1, in resource "google_healthcare_dataset" "dev_dataset":
β”‚    1: resource "google_healthcare_dataset" "dev_dataset" {

Steps to Reproduce

Terraform Docs Example

  1. terraform apply
slevenick commented 2 years ago

From β”‚ <p>The requested URL <code>/v1/projects/projects/some-test-project-id/locations/asia-south1/datasets?alt=json&amp;datasetId=dev-dataset</code> was not found on this server. <ins>That’s all we know.</ins>

It looks like you have a duplicate "projects/". Is your default project set to something like "projects/your-project-id"?

itsbalamurali commented 2 years ago

@slevenick that helped πŸ™πŸΌ fix: trimprefix(google_project.your_project.id,"projects/") referencing google_project resource.

github-actions[bot] commented 2 years ago

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.