Skip to content

Commit fcd41b9

Browse files
authored
INTMDB-371: PrivateLink Endpoint Timeout (#841)
* Updated privatelink_endpoint CD endpoints to match refresh func timeout * Using Configured timeout times in refresh func * Updated docs to contain timeout instructions * Corrected default timeout value on privatelink_endpoint * Moved the timeout documentation to the resource * PrivateLink Endpoint documentation refers to the proper resource and includes an example * Fixed casing on Private Endpoint * Added to docs on how to learn more about timeouts
1 parent f4a6c15 commit fcd41b9

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

mongodbatlas/resource_mongodbatlas_privatelink_endpoint.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ func resourceMongoDBAtlasPrivateLinkEndpoint() *schema.Resource {
105105
},
106106
},
107107
},
108+
Timeouts: &schema.ResourceTimeout{
109+
Create: schema.DefaultTimeout(1 * time.Hour),
110+
Delete: schema.DefaultTimeout(1 * time.Hour),
111+
},
108112
}
109113
}
110114

@@ -128,7 +132,7 @@ func resourceMongoDBAtlasPrivateLinkEndpointCreate(ctx context.Context, d *schem
128132
Pending: []string{"INITIATING", "DELETING"},
129133
Target: []string{"WAITING_FOR_USER", "FAILED", "DELETED", "AVAILABLE"},
130134
Refresh: resourcePrivateLinkEndpointRefreshFunc(ctx, conn, projectID, providerName, privateEndpointConn.ID),
131-
Timeout: 1 * time.Hour,
135+
Timeout: d.Timeout(schema.TimeoutCreate),
132136
MinTimeout: 5 * time.Second,
133137
Delay: 3 * time.Second,
134138
}
@@ -246,7 +250,7 @@ func resourceMongoDBAtlasPrivateLinkEndpointDelete(ctx context.Context, d *schem
246250
Pending: []string{"DELETING"},
247251
Target: []string{"DELETED", "FAILED"},
248252
Refresh: resourcePrivateLinkEndpointRefreshFunc(ctx, conn, projectID, providerName, privateLinkID),
249-
Timeout: 1 * time.Hour,
253+
Timeout: d.Timeout(schema.TimeoutDelete),
250254
MinTimeout: 5 * time.Second,
251255
Delay: 3 * time.Second,
252256
}

website/docs/d/privatelink_endpoint.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ In addition to all arguments above, the following attributes are exported:
5555
* `private_link_service_resource_id` - Resource ID of the Azure Private Link Service that Atlas manages.
5656
* `endpoint_group_names` - GCP network endpoint groups corresponding to the Private Service Connect endpoint service.
5757
* `region_name` - GCP region for the Private Service Connect endpoint service.
58-
* `service_attachment_names` - Unique alphanumeric and special character strings that identify the service attachments associated with the GCP Private Service Connect endpoint service.
58+
* `service_attachment_names` - Unique alphanumeric and special character strings that identify the service attachments associated with the GCP Private Service Connect endpoint service.
5959

6060
See [MongoDB Atlas API](https://docs.atlas.mongodb.com/reference/api/private-endpoints-service-get-one/) Documentation for more information.

website/docs/r/privatelink_endpoint.html.markdown

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ resource "mongodbatlas_privatelink_endpoint" "test" {
2626
project_id = "<PROJECT-ID>"
2727
provider_name = "AWS/AZURE"
2828
region = "US_EAST_1"
29+
30+
timeouts {
31+
create = "30m"
32+
delete = "20m"
33+
}
2934
}
3035
```
3136

@@ -35,6 +40,7 @@ resource "mongodbatlas_privatelink_endpoint" "test" {
3540
* `provider_name` - (Required) Name of the cloud provider for which you want to create the private endpoint service. Atlas accepts `AWS`, `AZURE` or `GCP`.
3641
* `region` - (Required) Cloud provider region in which you want to create the private endpoint connection.
3742
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)
43+
* `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).
3844

3945

4046
## Attributes Reference

0 commit comments

Comments
 (0)