Skip to content

Commit 1040025

Browse files
authored
Fix serverless endpoint tests (#949)
* Fixed serverless tests * Fixed other serverless endpoint tests * Fixed spacing issues in test configs
1 parent b958465 commit 1040025

3 files changed

+39
-22
lines changed

mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_serverless_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ func testAccDSMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID,
5757
return fmt.Sprintf(`
5858
5959
data "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
60-
project_id = "%[1]s"
60+
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
6161
instance_name = mongodbatlas_serverless_instance.test.name
62-
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
62+
endpoint_id = mongodbatlas_privatelink_endpoint_service_serverless.test.endpoint_id
6363
}
6464
6565
resource "mongodbatlas_privatelink_endpoint_serverless" "test" {
6666
project_id = "%[1]s"
6767
instance_name = mongodbatlas_serverless_instance.test.name
6868
provider_name = "AWS"
69-
}
70-
71-
72-
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
69+
}
70+
71+
72+
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
7373
project_id = "%[1]s"
7474
instance_name = "%[2]s"
7575
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
@@ -84,6 +84,10 @@ func testAccDSMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID,
8484
provider_settings_provider_name = "SERVERLESS"
8585
provider_settings_region_name = "US_EAST_1"
8686
continuous_backup_enabled = true
87+
88+
lifecycle {
89+
ignore_changes = [connection_strings_private_endpoint_srv]
90+
}
8791
}
8892
8993
`, projectID, instanceName, comment)

mongodbatlas/data_source_mongodbatlas_privatelink_endpoints_service_serverless_test.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,30 @@ func TestAccNetworkDSPrivateLinkEndpointsServiceServerless_basic(t *testing.T) {
3333
func testAccMongoDBAtlasPrivateLinkEndpointsServerlessDataSourceConfig(projectID, instanceID, comments string) string {
3434
return fmt.Sprintf(`
3535
data "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
36-
project_id = "%[1]s"
36+
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
3737
instance_name = mongodbatlas_serverless_instance.test.name
38-
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
39-
}
38+
endpoint_id = mongodbatlas_privatelink_endpoint_service_serverless.test.endpoint_id
39+
}
4040
4141
data "mongodbatlas_privatelink_endpoints_service_serverless" "test" {
42-
project_id = "%[1]s"
42+
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
4343
instance_name = mongodbatlas_serverless_instance.test.name
4444
}
4545
4646
resource "mongodbatlas_privatelink_endpoint_serverless" "test" {
4747
project_id = "%[1]s"
4848
instance_name = mongodbatlas_serverless_instance.test.name
4949
provider_name = "AWS"
50-
}
51-
52-
53-
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
50+
}
51+
52+
53+
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
5454
project_id = "%[1]s"
5555
instance_name = "%[2]s"
5656
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
5757
provider_name = "AWS"
5858
comment = "%[3]s"
59-
}
59+
}
6060
6161
resource "mongodbatlas_serverless_instance" "test" {
6262
project_id = "%[1]s"
@@ -65,6 +65,10 @@ func testAccMongoDBAtlasPrivateLinkEndpointsServerlessDataSourceConfig(projectID
6565
provider_settings_provider_name = "SERVERLESS"
6666
provider_settings_region_name = "US_EAST_1"
6767
continuous_backup_enabled = true
68+
69+
lifecycle {
70+
ignore_changes = [connection_strings_private_endpoint_srv]
71+
}
6872
}
6973
`, projectID, instanceID, comments)
7074
}

mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_serverless_test.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ func testAccMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID, in
9191
project_id = "%[1]s"
9292
instance_name = mongodbatlas_serverless_instance.test.name
9393
provider_name = "AWS"
94-
}
95-
96-
97-
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
98-
project_id = "%[1]s"
99-
instance_name = "%[2]s"
94+
}
95+
96+
97+
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
98+
project_id = mongodbatlas_privatelink_endpoint_serverless.test.project_id
99+
instance_name = mongodbatlas_privatelink_endpoint_serverless.test.instance_name
100100
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
101101
provider_name = "AWS"
102102
comment = "%[3]s"
103-
}
103+
}
104104
105105
resource "mongodbatlas_serverless_instance" "test" {
106106
project_id = "%[1]s"
@@ -109,6 +109,15 @@ func testAccMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID, in
109109
provider_settings_provider_name = "SERVERLESS"
110110
provider_settings_region_name = "US_EAST_1"
111111
continuous_backup_enabled = true
112+
113+
lifecycle {
114+
ignore_changes = [connection_strings_private_endpoint_srv]
115+
}
116+
}
117+
118+
data "mongodbatlas_serverless_instance" "test" {
119+
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
120+
name = mongodbatlas_serverless_instance.test.name
112121
}
113122
114123
`, projectID, instanceName, comment)

0 commit comments

Comments
 (0)