Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTMDB-371: PrivateLink Endpoint Timeout #841

Merged
merged 8 commits into from
Sep 15, 2022
8 changes: 6 additions & 2 deletions mongodbatlas/resource_mongodbatlas_privatelink_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func resourceMongoDBAtlasPrivateLinkEndpoint() *schema.Resource {
},
},
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(1 * time.Hour),
Delete: schema.DefaultTimeout(1 * time.Hour),
},
}
}

Expand All @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/privatelink_endpoint.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 6 additions & 0 deletions website/docs/r/privatelink_endpoint.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ resource "mongodbatlas_privatelink_endpoint" "test" {
project_id = "<PROJECT-ID>"
provider_name = "AWS/AZURE"
region = "US_EAST_1"

timeouts {
create = "30m"
delete = "20m"
}
}
```

Expand All @@ -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
Expand Down