diff --git a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint.go b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint.go index 64378bcc8e..7d56368c45 100644 --- a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint.go +++ b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint.go @@ -105,6 +105,10 @@ func resourceMongoDBAtlasPrivateLinkEndpoint() *schema.Resource { }, }, }, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(1 * time.Hour), + Delete: schema.DefaultTimeout(1 * time.Hour), + }, } } @@ -128,7 +132,7 @@ func resourceMongoDBAtlasPrivateLinkEndpointCreate(ctx context.Context, d *schem Pending: []string{"INITIATING", "DELETING"}, Target: []string{"WAITING_FOR_USER", "FAILED", "DELETED", "AVAILABLE"}, Refresh: resourcePrivateLinkEndpointRefreshFunc(ctx, conn, projectID, providerName, privateEndpointConn.ID), - Timeout: 1 * time.Hour, + Timeout: d.Timeout(schema.TimeoutCreate), MinTimeout: 5 * time.Second, Delay: 3 * time.Second, } @@ -246,7 +250,7 @@ func resourceMongoDBAtlasPrivateLinkEndpointDelete(ctx context.Context, d *schem Pending: []string{"DELETING"}, Target: []string{"DELETED", "FAILED"}, Refresh: resourcePrivateLinkEndpointRefreshFunc(ctx, conn, projectID, providerName, privateLinkID), - Timeout: 1 * time.Hour, + Timeout: d.Timeout(schema.TimeoutDelete), MinTimeout: 5 * time.Second, Delay: 3 * time.Second, } diff --git a/website/docs/d/privatelink_endpoint.html.markdown b/website/docs/d/privatelink_endpoint.html.markdown index 31087ef79c..c009bebaf5 100644 --- a/website/docs/d/privatelink_endpoint.html.markdown +++ b/website/docs/d/privatelink_endpoint.html.markdown @@ -55,6 +55,6 @@ In addition to all arguments above, the following attributes are exported: * `private_link_service_resource_id` - Resource ID of the Azure Private Link Service that Atlas manages. * `endpoint_group_names` - GCP network endpoint groups corresponding to the Private Service Connect endpoint service. * `region_name` - GCP region for the Private Service Connect endpoint service. -* `service_attachment_names` - Unique alphanumeric and special character strings that identify the service attachments associated with the GCP Private Service Connect endpoint service. +* `service_attachment_names` - Unique alphanumeric and special character strings that identify the service attachments associated with the GCP Private Service Connect endpoint service. See [MongoDB Atlas API](https://docs.atlas.mongodb.com/reference/api/private-endpoints-service-get-one/) Documentation for more information. \ No newline at end of file diff --git a/website/docs/r/privatelink_endpoint.html.markdown b/website/docs/r/privatelink_endpoint.html.markdown index f937ca5f44..8987d47254 100644 --- a/website/docs/r/privatelink_endpoint.html.markdown +++ b/website/docs/r/privatelink_endpoint.html.markdown @@ -26,6 +26,11 @@ resource "mongodbatlas_privatelink_endpoint" "test" { project_id = "" provider_name = "AWS/AZURE" region = "US_EAST_1" + + timeouts { + create = "30m" + delete = "20m" + } } ``` @@ -35,6 +40,7 @@ resource "mongodbatlas_privatelink_endpoint" "test" { * `provider_name` - (Required) Name of the cloud provider for which you want to create the private endpoint service. Atlas accepts `AWS`, `AZURE` or `GCP`. * `region` - (Required) Cloud provider region in which you want to create the private endpoint connection. Accepted values are: [AWS regions](https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws), [AZURE regions](https://docs.atlas.mongodb.com/reference/microsoft-azure/#microsoft-azure) and [GCP regions](https://docs.atlas.mongodb.com/reference/google-gcp/#std-label-google-gcp) +* `timeouts`- (Optional) The duration of time to wait for Private Endpoint to be created or deleted. The timeout value is definded by a signed sequence of decimal numbers with an time unit suffix such as: `1h45m`, `300s`, `10m`, .... The valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. The default timeout for Private Endpoint create & delete is `1h`. Learn more about timeouts [here](https://www.terraform.io/plugin/sdkv2/resources/retries-and-customizable-timeouts). ## Attributes Reference