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-436: Update privatelink endpoint service resources timeout config #1329

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
"strings"
"time"

matlas "go.mongodb.org/atlas/mongodbatlas"

andreaangiolillo marked this conversation as resolved.
Show resolved Hide resolved
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
matlas "go.mongodb.org/atlas/mongodbatlas"
)

const (
Expand Down Expand Up @@ -90,7 +91,7 @@ func resourceMongoDBAtlasPrivateLinkEndpointServerlessCreate(ctx context.Context
Refresh: resourcePrivateLinkEndpointServerlessRefreshFunc(ctx, conn, projectID, instanceName, endPoint.ID),
Timeout: d.Timeout(schema.TimeoutCreate),
MinTimeout: 5 * time.Second,
Delay: 3 * time.Second,
Delay: 5 * time.Second,
}
// RESERVATION_REQUESTED, RESERVED, INITIATING, AVAILABLE, FAILED, DELETING.
// Wait, catching any errors
Expand Down Expand Up @@ -182,7 +183,7 @@ func resourceMongoDBAtlasPrivateLinkEndpointServerlessDelete(ctx context.Context
Refresh: resourcePrivateLinkEndpointServerlessRefreshFunc(ctx, conn, projectID, instanceName, endpointID),
Timeout: d.Timeout(schema.TimeoutDelete),
MinTimeout: 5 * time.Second,
Delay: 3 * time.Second,
Delay: 5 * time.Second,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, why 5 seconds delay?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zuhairahmed just making it consistent across privatelink_endpoint resources.

}
// Wait, catching any errors
_, err = stateConf.WaitForStateContext(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"fmt"
"net/http"
"strings"
"time"

matlas "go.mongodb.org/atlas/mongodbatlas"

andreaangiolillo marked this conversation as resolved.
Show resolved Hide resolved
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
matlas "go.mongodb.org/atlas/mongodbatlas"
)

const (
Expand Down Expand Up @@ -54,6 +56,10 @@ func resourceMongoDBAtlasPrivatelinkEndpointServiceDataFederationOnlineArchive()
Computed: true,
},
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(2 * time.Hour),
Delete: schema.DefaultTimeout(2 * time.Hour),
},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ resource "mongodbatlas_privatelink_endpoint_service_data_federation_online_archi
provider_name = "AWS"
comment = "Test"
}

```
## Argument Reference

* `project_id` (Required) - Unique 24-hexadecimal digit string that identifies your project.
* `endpoint_id` (Required) - Unique 22-character alphanumeric string that identifies the private endpoint. See [Atlas Data Lake supports Amazon Web Services private endpoints using the AWS PrivateLink feature](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/createDataFederationPrivateEndpoint:~:text=Atlas%20Data%20Lake%20supports%20Amazon%20Web%20Services%20private%20endpoints%20using%20the%20AWS%20PrivateLink%20feature).
* `provider_name` (Required) - Human-readable label that identifies the cloud service provider.
* `timeouts`- (Optional) The duration of time to wait for Private Endpoint Service 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 `2h`. Learn more about timeouts [here](https://www.terraform.io/plugin/sdkv2/resources/retries-and-customizable-timeouts).

## Attributes Reference

Expand Down