terraform-provider-mongodbatlas
terraform-provider-mongodbatlas copied to clipboard
Timeout when creating `mongodbatlas_privatelink_endpoint` on GCP and does not allow `timeouts` block
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
-
terraform init
-
terraform plan
-
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.
At the moment the timeout values are not configurable by consumers of the provider, will investigate & do what we can to resolve
@dgteixeira Latest release v1.4.6 should address this please validate that this corrects issue you were encountering
@martinstibbe, nice!
Will definitely try out the new version and let you know.