Skip to content

Commit 6fc6e44

Browse files
Release staging v1.6.0 (#921)
* INTMDB-444: Add support for termination protection enabled feature (#912) * Initial commit of termination_protection_enabled support * Lint dead code removal * INTMDB-364 Add support for serverless private endpoints (AWS + Azure) (#913) * Add support for serverless private endpoints * Correct lint error * Update 1.5.0-upgrade-guide.html.markdown * Update 1.5.0-upgrade-guide.html.markdown * Add documentation for serverless endpoints * Update Schema timeout values * Update documentation * Add privatelink_endpoints_service_serverless datasource and documentation * Fix lint error * Add support for Azure private endpoints * Provide additional examples for AWS and AZURE standardize parameter cloud_provider_endpoint_id * Additional examples * Tidy up docs * Update Doc region for Azure * Add AWS aws_vpc_endpoint to link to mongodbatlas_privatelink_endpoint_service_serverless * Remove Extra note Co-authored-by: Zuhair Ahmed <[email protected]> Co-authored-by: Zuhair Ahmed <[email protected]>
1 parent 0c0bc96 commit 6fc6e44

File tree

41 files changed

+1922
-140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1922
-140
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/mwielbut/pointy v1.1.0
1212
github.com/spf13/cast v1.5.0
1313
github.com/terraform-providers/terraform-provider-aws v1.60.1-0.20210625132053-af2d5c0ad54f
14-
go.mongodb.org/atlas v0.18.1-0.20221026132354-ca26a1fdb0a6
14+
go.mongodb.org/atlas v0.18.1-0.20221109142841-f9f8ebe7b9b9
1515
go.mongodb.org/realm v0.1.0
1616
)
1717

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,16 @@ go.mongodb.org/atlas v0.16.1-0.20220922005646-8a86dd63e243 h1:KkZ900dLCu2U3D+qoY
933933
go.mongodb.org/atlas v0.16.1-0.20220922005646-8a86dd63e243/go.mod h1:GUuW7/ZrHzCO0o47aiqhokN0N6i0GM3yraRyHIBTykU=
934934
go.mongodb.org/atlas v0.18.1-0.20221026132354-ca26a1fdb0a6 h1:lGmbUUTcdfXt0O1QN2z65B3mAYrUXUerqj3RZWg7Aao=
935935
go.mongodb.org/atlas v0.18.1-0.20221026132354-ca26a1fdb0a6/go.mod h1:PFk1IGhiGjFXHGVspOK7i1U2nnPjK8wAjYwQf6FoVf4=
936+
go.mongodb.org/atlas v0.18.1-0.20221108205600-df069600ea0e h1:2tJAuArFEru/aH3eZhfq8ZU7qv1DzgWp0FTYOYO9X0E=
937+
go.mongodb.org/atlas v0.18.1-0.20221108205600-df069600ea0e/go.mod h1:PFk1IGhiGjFXHGVspOK7i1U2nnPjK8wAjYwQf6FoVf4=
938+
go.mongodb.org/atlas v0.18.1-0.20221109004135-a08842cb4521 h1:gWLG7xNkgiFEw3PQo/0Jnp2MkDwDbYu6svMEET8IBFs=
939+
go.mongodb.org/atlas v0.18.1-0.20221109004135-a08842cb4521/go.mod h1:PFk1IGhiGjFXHGVspOK7i1U2nnPjK8wAjYwQf6FoVf4=
940+
go.mongodb.org/atlas v0.18.1-0.20221109012729-5270d3048e93 h1:i8sFIUYNTakDMxvtak2NEGVnqEWyfB5DYt1aW33IJ2M=
941+
go.mongodb.org/atlas v0.18.1-0.20221109012729-5270d3048e93/go.mod h1:PFk1IGhiGjFXHGVspOK7i1U2nnPjK8wAjYwQf6FoVf4=
942+
go.mongodb.org/atlas v0.18.1-0.20221109025158-49b06badf4a1 h1:sebMdTAFJSPMXidhUg/9D48xFzsHvvNrF3A2plPymmA=
943+
go.mongodb.org/atlas v0.18.1-0.20221109025158-49b06badf4a1/go.mod h1:PFk1IGhiGjFXHGVspOK7i1U2nnPjK8wAjYwQf6FoVf4=
944+
go.mongodb.org/atlas v0.18.1-0.20221109142841-f9f8ebe7b9b9 h1:9m35o4kyRYjwbsIb/lPrjxJ6afPpn9zwOF5i3SIY5Lg=
945+
go.mongodb.org/atlas v0.18.1-0.20221109142841-f9f8ebe7b9b9/go.mod h1:PFk1IGhiGjFXHGVspOK7i1U2nnPjK8wAjYwQf6FoVf4=
936946
go.mongodb.org/realm v0.1.0 h1:zJiXyLaZrznQ+Pz947ziSrDKUep39DO4SfA0Fzx8M4M=
937947
go.mongodb.org/realm v0.1.0/go.mod h1:4Vj6iy+Puo1TDERcoh4XZ+pjtwbOzPpzqy3Cwe8ZmDM=
938948
go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o=

mongodbatlas/data_source_mongodbatlas_advanced_cluster.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ func dataSourceMongoDBAtlasAdvancedCluster() *schema.Resource {
185185
Type: schema.TypeString,
186186
Computed: true,
187187
},
188+
"termination_protection_enabled": {
189+
Type: schema.TypeBool,
190+
Computed: true,
191+
},
188192
"version_release_system": {
189193
Type: schema.TypeString,
190194
Computed: true,
@@ -276,7 +280,9 @@ func dataSourceMongoDBAtlasAdvancedClusterRead(ctx context.Context, d *schema.Re
276280
if err := d.Set("state_name", cluster.StateName); err != nil {
277281
return diag.FromErr(fmt.Errorf(errorClusterAdvancedSetting, "state_name", clusterName, err))
278282
}
279-
283+
if err := d.Set("termination_protection_enabled", cluster.TerminationProtectionEnabled); err != nil {
284+
return diag.FromErr(fmt.Errorf(errorClusterAdvancedSetting, "termination_protection_enabled", clusterName, err))
285+
}
280286
if err := d.Set("version_release_system", cluster.VersionReleaseSystem); err != nil {
281287
return diag.FromErr(fmt.Errorf(errorClusterAdvancedSetting, "version_release_system", clusterName, err))
282288
}

mongodbatlas/data_source_mongodbatlas_advanced_cluster_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func TestAccDataSourceMongoDBAtlasAdvancedCluster_basic(t *testing.T) {
3636
resource.TestCheckResourceAttrSet(resourceName, "replication_specs.0.region_configs.#"),
3737
resource.TestCheckResourceAttrSet(resourceName, "project_id"),
3838
resource.TestCheckResourceAttr(dataSourceName, "name", name),
39+
resource.TestCheckResourceAttr(dataSourceName, "termination_protection_enabled", "false"),
3940
),
4041
},
4142
},

mongodbatlas/data_source_mongodbatlas_advanced_clusters.go

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ func dataSourceMongoDBAtlasAdvancedClusters() *schema.Resource {
193193
Type: schema.TypeString,
194194
Computed: true,
195195
},
196+
"termination_protection_enabled": {
197+
Type: schema.TypeBool,
198+
Computed: true,
199+
},
196200
"version_release_system": {
197201
Type: schema.TypeString,
198202
Computed: true,
@@ -240,24 +244,25 @@ func flattenAdvancedClusters(ctx context.Context, conn *matlas.Client, clusters
240244
}
241245

242246
result := map[string]interface{}{
243-
"advanced_configuration": flattenProcessArgs(processArgs),
244-
"backup_enabled": clusters[i].BackupEnabled,
245-
"bi_connector": flattenBiConnectorConfig(clusters[i].BiConnector),
246-
"cluster_type": clusters[i].ClusterType,
247-
"create_date": clusters[i].CreateDate,
248-
"connection_strings": flattenConnectionStrings(clusters[i].ConnectionStrings),
249-
"disk_size_gb": clusters[i].DiskSizeGB,
250-
"encryption_at_rest_provider": clusters[i].EncryptionAtRestProvider,
251-
"labels": flattenLabels(clusters[i].Labels),
252-
"mongo_db_major_version": clusters[i].MongoDBMajorVersion,
253-
"mongo_db_version": clusters[i].MongoDBVersion,
254-
"name": clusters[i].Name,
255-
"paused": clusters[i].Paused,
256-
"pit_enabled": clusters[i].PitEnabled,
257-
"replication_specs": replicationSpecs,
258-
"root_cert_type": clusters[i].RootCertType,
259-
"state_name": clusters[i].StateName,
260-
"version_release_system": clusters[i].VersionReleaseSystem,
247+
"advanced_configuration": flattenProcessArgs(processArgs),
248+
"backup_enabled": clusters[i].BackupEnabled,
249+
"bi_connector": flattenBiConnectorConfig(clusters[i].BiConnector),
250+
"cluster_type": clusters[i].ClusterType,
251+
"create_date": clusters[i].CreateDate,
252+
"connection_strings": flattenConnectionStrings(clusters[i].ConnectionStrings),
253+
"disk_size_gb": clusters[i].DiskSizeGB,
254+
"encryption_at_rest_provider": clusters[i].EncryptionAtRestProvider,
255+
"labels": flattenLabels(clusters[i].Labels),
256+
"mongo_db_major_version": clusters[i].MongoDBMajorVersion,
257+
"mongo_db_version": clusters[i].MongoDBVersion,
258+
"name": clusters[i].Name,
259+
"paused": clusters[i].Paused,
260+
"pit_enabled": clusters[i].PitEnabled,
261+
"replication_specs": replicationSpecs,
262+
"root_cert_type": clusters[i].RootCertType,
263+
"state_name": clusters[i].StateName,
264+
"termination_protection_enabled": clusters[i].TerminationProtectionEnabled,
265+
"version_release_system": clusters[i].VersionReleaseSystem,
261266
}
262267
results = append(results, result)
263268
}

mongodbatlas/data_source_mongodbatlas_advanced_clusters_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func TestAccDataSourceMongoDBAtlasAdvancedClusters_basic(t *testing.T) {
3838
resource.TestCheckResourceAttrSet(dataSourceName, "results.#"),
3939
resource.TestCheckResourceAttrSet(dataSourceName, "results.0.replication_specs.#"),
4040
resource.TestCheckResourceAttrSet(dataSourceName, "results.0.name"),
41+
resource.TestCheckResourceAttrSet(dataSourceName, "results.0.termination_protection_enabled"),
4142
),
4243
},
4344
},

mongodbatlas/data_source_mongodbatlas_cluster.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ func dataSourceMongoDBAtlasCluster() *schema.Resource {
308308
Type: schema.TypeString,
309309
Computed: true,
310310
},
311+
"termination_protection_enabled": {
312+
Type: schema.TypeBool,
313+
Computed: true,
314+
},
311315
"version_release_system": {
312316
Type: schema.TypeString,
313317
Computed: true,
@@ -442,6 +446,10 @@ func dataSourceMongoDBAtlasClusterRead(ctx context.Context, d *schema.ResourceDa
442446
return diag.FromErr(fmt.Errorf(errorClusterSetting, "labels", clusterName, err))
443447
}
444448

449+
if err := d.Set("termination_protection_enabled", cluster.TerminationProtectionEnabled); err != nil {
450+
return diag.FromErr(fmt.Errorf(errorClusterSetting, "termination_protection_enabled", clusterName, err))
451+
}
452+
445453
if err := d.Set("version_release_system", cluster.VersionReleaseSystem); err != nil {
446454
return diag.FromErr(fmt.Errorf(errorClusterSetting, "version_release_system", clusterName, err))
447455
}

mongodbatlas/data_source_mongodbatlas_cluster_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func TestAccDataSourceMongoDBAtlasCluster_basic(t *testing.T) {
5252
resource.TestCheckResourceAttr(dataSourceName, "provider_auto_scaling_compute_min_instance_size", minSizeInstance),
5353
resource.TestCheckResourceAttr(dataSourceName, "provider_auto_scaling_compute_max_instance_size", maxSizeInstance),
5454
resource.TestCheckResourceAttr(dataSourceName, "version_release_system", "LTS"),
55+
resource.TestCheckResourceAttr(dataSourceName, "termination_protection_enabled", "false"),
5556
),
5657
},
5758
},

mongodbatlas/data_source_mongodbatlas_clusters.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ func dataSourceMongoDBAtlasClusters() *schema.Resource {
315315
Type: schema.TypeString,
316316
Computed: true,
317317
},
318+
"termination_protection_enabled": {
319+
Type: schema.TypeBool,
320+
Computed: true,
321+
},
318322
},
319323
},
320324
},
@@ -403,6 +407,7 @@ func flattenClusters(ctx context.Context, d *schema.ResourceData, conn *matlas.C
403407
"replication_specs": flattenReplicationSpecs(clusters[i].ReplicationSpecs),
404408
"labels": flattenLabels(clusters[i].Labels),
405409
"snapshot_backup_policy": snapshotBackupPolicy,
410+
"termination_protection_enabled": clusters[i].TerminationProtectionEnabled,
406411
"version_release_system": clusters[i].VersionReleaseSystem,
407412
"container_id": containerID,
408413
}

mongodbatlas/data_source_mongodbatlas_clusters_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func TestAccDataSourceMongoDBAtlasClusters_basic(t *testing.T) {
4343
resource.TestCheckResourceAttrSet(dataSourceName, "results.0.replication_specs.#"),
4444
resource.TestCheckResourceAttrSet(dataSourceName, "results.0.name"),
4545
resource.TestCheckResourceAttr(dataSourceName, "results.0.version_release_system", "LTS"),
46+
resource.TestCheckResourceAttr(dataSourceName, "results.0.termination_protection_enabled", "false"),
4647
),
4748
},
4849
},

0 commit comments

Comments
 (0)