terraform-provider-mongodbatlas icon indicating copy to clipboard operation
terraform-provider-mongodbatlas copied to clipboard

Timeout when creating `mongodbatlas_privatelink_endpoint` on GCP and does not allow `timeouts` block

Open dgteixeira opened this issue 1 year ago • 3 comments

Description

Every time I try to create the resource mongodbatlas_privatelink_endpoint on GCP, I get timed out and I cannot change the timer.

Terraform CLI and Terraform MongoDB Atlas Provider Version

 - tf version
Terraform v1.2.6
on linux_amd64
+ provider registry.terraform.io/mongodb/mongodbatlas v1.4.3

Terraform Configuration File

resource "mongodbatlas_privatelink_endpoint" "gcp_psc" {
  project_id    = var.gcp_project_id
  provider_name = "GCP"
  region        = var.gcp_region

/*
  #We need to add this, because if the apply fails, even if the resource gets created, it does not get stored on tf state
  timeouts {
    create = "40m"
  }
*/
}

Steps to Reproduce

  1. terraform init
  2. terraform plan
  3. terraform apply

Expected Behavior

Creation should not exceed Create default timer , which is 20 minutes.

Actual Behavior

Takes between 27-32 minutes, for the tests I've done.

mongodbatlas_privatelink_endpoint.gcp_psc: Still creating... [19m30s elapsed]
mongodbatlas_privatelink_endpoint.gcp_psc: Still creating... [19m40s elapsed]
mongodbatlas_privatelink_endpoint.gcp_psc: Still creating... [19m50s elapsed]
╷
│ Error: error creating MongoDB Private Endpoints Connection: context deadline exceeded
│
│   with mongodbatlas_privatelink_endpoint.gcp_psc,
│   on projects-labs.tf line 15, in resource "mongodbatlas_privatelink_endpoint" "gcp_psc":
│   15: resource "mongodbatlas_privatelink_endpoint" "gcp_psc" {
│
╵

Additional Context

I tried using the timeouts{} block to increase the create timer, but with no success, because the resource does not allow it, like stated in the doc.

I got the following code:

resource "mongodbatlas_privatelink_endpoint" "gcp_psc" {
  project_id    = var.gcp_project_id
  provider_name = "GCP"
  region        = var.gcp_region

  #We need to add this, because if the apply fails, even if the resource gets created, it does not get stored on tf state
  timeouts {
    create = "40m"
  }
}

And I get the following error:

➜ tf plan -out=tfplan
╷
│ Error: Unsupported block type
│
│   on projects-labs.tf line 21, in resource "mongodbatlas_privatelink_endpoint" "gcp_psc":
│   21:   timeouts {
│
│ Blocks of type "timeouts" are not expected here.

Do you know if I can change the values? Because everytime I try to create the resource, I get timed out.

dgteixeira avatar Aug 08 '22 17:08 dgteixeira

At the moment the timeout values are not configurable by consumers of the provider, will investigate & do what we can to resolve

evertsd avatar Aug 16 '22 21:08 evertsd

@dgteixeira Latest release v1.4.6 should address this please validate that this corrects issue you were encountering

martinstibbe avatar Sep 20 '22 13:09 martinstibbe

@martinstibbe, nice!

Will definitely try out the new version and let you know.

dgteixeira avatar Sep 20 '22 18:09 dgteixeira