From 907f66f251ce87a3557e8d455893e364241d09e4 Mon Sep 17 00:00:00 2001 From: Abner Garcia Date: Mon, 23 Aug 2021 16:35:29 -0600 Subject: [PATCH 01/13] fixed documentattion --- ...ovider_snapshot_backup_policy.html.markdown | 3 +++ website/docs/d/cluster.html.markdown | 7 ++++--- ...ovider_snapshot_backup_policy.html.markdown | 2 ++ website/docs/r/cluster.html.markdown | 18 +++++++++--------- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/website/docs/d/cloud_provider_snapshot_backup_policy.html.markdown b/website/docs/d/cloud_provider_snapshot_backup_policy.html.markdown index e5ee2398c8..fb1bf36502 100644 --- a/website/docs/d/cloud_provider_snapshot_backup_policy.html.markdown +++ b/website/docs/d/cloud_provider_snapshot_backup_policy.html.markdown @@ -6,6 +6,9 @@ description: |- Provides a Cloud Backup Snapshot Policy Datasource. --- + + **WARNING:** This data source is deprecated, use `mongodbatlas_cloud_backup_schedule` + # mongodbatlas_cloud_provider_snapshot_backup_policy `mongodbatlas_cloud_provider_snapshot_backup_policy` provides a Cloud Backup Snapshot Backup Policy datasource. An Atlas Cloud Backup Snapshot Policy provides the current snapshot schedule and retention settings for the cluster. diff --git a/website/docs/d/cluster.html.markdown b/website/docs/d/cluster.html.markdown index a813eea57a..4d24c60d01 100644 --- a/website/docs/d/cluster.html.markdown +++ b/website/docs/d/cluster.html.markdown @@ -33,7 +33,7 @@ resource "mongodbatlas_cluster" "test" { read_only_nodes = 0 } } - provider_backup_enabled = true + cloud_backup_config = true auto_scaling_disk_gb_enabled = true //Provider Settings "block" @@ -57,7 +57,7 @@ data "mongodbatlas_cluster" "test" { In addition to all arguments above, the following attributes are exported: * `id` - The cluster ID. -* `mongo_db_version` - Version of MongoDB the cluster runs, in `major-version`.`minor-version` format. +* `mongo_db_version` - Version of MongoDB the cluster runs, in `major-version`.`minor-version` format. * `mongo_uri` - Base connection string for the cluster. Atlas only displays this field after the cluster is operational, not while it builds the cluster. * `mongo_uri_updated` - Lists when the connection string was last updated. The connection string changes, for example, if you change a replica set to a sharded cluster. * `mongo_uri_with_options` - Describes connection string for connecting to the Atlas cluster. Includes the replicaSet, ssl, and authSource query parameters in the connection string with values appropriate for the cluster. @@ -102,7 +102,8 @@ In addition to all arguments above, the following attributes are exported: * `name` - Name of the cluster as it appears in Atlas. * `mongo_db_major_version` - Indicates the version of the cluster to deploy. * `num_shards` - Indicates whether the cluster is a replica set or a sharded cluster. -* `provider_backup_enabled` - Flag indicating if the cluster uses Cloud Backup Snapshots for backups. +* `provider_backup_enabled` - **(DEPRECATED)** Flag indicating if the cluster uses Cloud Backup Snapshots for backups. +* `cloud_backup` - Flag indicating * `provider_instance_size_name` - Atlas provides different instance sizes, each with a default storage capacity and RAM size. * `provider_name` - Indicates the cloud service provider on which the servers are provisioned. * `backing_provider_name` - Indicates Cloud service provider on which the server for a multi-tenant cluster is provisioned. diff --git a/website/docs/r/cloud_provider_snapshot_backup_policy.html.markdown b/website/docs/r/cloud_provider_snapshot_backup_policy.html.markdown index 3fa57cd232..1bbd0bcef8 100644 --- a/website/docs/r/cloud_provider_snapshot_backup_policy.html.markdown +++ b/website/docs/r/cloud_provider_snapshot_backup_policy.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a Cloud Backup Snapshot Policy resource. --- +**WARNING:** This resource is deprecated, use `mongodbatlas_cloud_backup_schedule` + # mongodbatlas_cloud_provider_snapshot_backup_policy `mongodbatlas_cloud_provider_snapshot_backup_policy` provides a resource that enables you to view and modify the snapshot schedule and retention settings for an Atlas cluster with Cloud Backup enabled. A default policy is created automatically when Cloud Backup is enabled for the cluster. diff --git a/website/docs/r/cluster.html.markdown b/website/docs/r/cluster.html.markdown index 8edd48e61e..991a37238f 100644 --- a/website/docs/r/cluster.html.markdown +++ b/website/docs/r/cluster.html.markdown @@ -38,7 +38,7 @@ resource "mongodbatlas_cluster" "cluster-test" { read_only_nodes = 0 } } - provider_backup_enabled = true + cloud_backup = true auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.2" @@ -65,7 +65,7 @@ resource "mongodbatlas_cluster" "test" { read_only_nodes = 0 } } - provider_backup_enabled = true + cloud_backup = true auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.2" @@ -92,7 +92,7 @@ resource "mongodbatlas_cluster" "test" { read_only_nodes = 0 } } - provider_backup_enabled = true + cloud_backup = true auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.2" @@ -111,7 +111,7 @@ resource "mongodbatlas_cluster" "cluster-test" { name = "cluster-test-multi-region" disk_size_gb = 100 num_shards = 1 - provider_backup_enabled = true + cloud_backup = true cluster_type = "REPLICASET" //Provider Settings "block" @@ -150,7 +150,7 @@ resource "mongodbatlas_cluster" "cluster-test" { name = "cluster-test-global" disk_size_gb = 80 num_shards = 1 - provider_backup_enabled = true + cloud_backup = true cluster_type = "GEOSHARDED" //Provider Settings "block" @@ -279,11 +279,11 @@ But in order to explicitly change `provider_instance_size_name` comment the `lif * `backup_enabled` - (Optional) Legacy Backup - Set to true to enable Atlas legacy backups for the cluster. **Important** - MongoDB deprecated the Legacy Backup feature. Clusters that use Legacy Backup can continue to use it. MongoDB recommends using [Cloud Backups](https://docs.atlas.mongodb.com/backup/cloud-backup/overview/). - * Any net new Atlas clusters of any type do not support this parameter. These clusters must use Cloud Backup, `provider_backup_enabled`, to enable Cloud Backup. If you create a new Atlas cluster and set `backup_enabled` to true, the Provider will respond with an error. This change doesn’t affect existing clusters that use legacy backups. + * Any net new Atlas clusters of any type do not support this parameter. These clusters must use Cloud Backup, `cloud_backup`, to enable Cloud Backup. If you create a new Atlas cluster and set `backup_enabled` to true, the Provider will respond with an error. This change doesn’t affect existing clusters that use legacy backups. * Setting this value to false to disable legacy backups for the cluster will let Atlas delete any stored snapshots. In order to preserve the legacy backups snapshots, disable the legacy backups and enable the cloud backups in the single **terraform apply** action. ``` backup_enabled = "false" - provider_backup_enabled = "true" + cloud_backup = "true" ``` * The default value is false. M10 and above only. @@ -308,14 +308,14 @@ But in order to explicitly change `provider_instance_size_name` comment the `lif * `mongo_db_major_version` - (Optional) Version of the cluster to deploy. Atlas supports the following MongoDB versions for M10+ clusters: `3.6`, `4.0`, or `4.2`. You must set this value to `4.2` if `provider_instance_size_name` is either M2 or M5. * `num_shards` - (Optional) Selects whether the cluster is a replica set or a sharded cluster. If you use the replicationSpecs parameter, you must set num_shards. * `pit_enabled` - (Optional) - Flag that indicates if the cluster uses Continuous Cloud Backup. If set to true, provider_backup_enabled must also be set to true. -* `provider_backup_enabled` - (Optional) Flag indicating if the cluster uses Cloud Backup for backups. +* `provider_backup_enabled` - (Optional) Flag indicating if the cluster uses Cloud Backup for backups. **Deprecated** use `cloud_backup` instead. If true, the cluster uses Cloud Backup for backups. If provider_backup_enabled and backup_enabled are false, the cluster does not use Atlas backups. You cannot enable cloud backup if you have an existing cluster in the project with legacy backup enabled. ~> **IMPORTANT:** If setting to true for an existing cluster or imported cluster be sure to run terraform refresh after applying to enable modification of the Cloud Backup Snapshot Policy going forward. - +* `cloud_backup` - (Optional) * `backing_provider_name` - (Optional) Cloud service provider on which the server for a multi-tenant cluster is provisioned. This setting is only valid when providerSetting.providerName is TENANT and providerSetting.instanceSizeName is M2 or M5. From b6eb9632bffe4b0d9933c797f95ca5d53221a21a Mon Sep 17 00:00:00 2001 From: Abner Garcia Date: Tue, 24 Aug 2021 14:01:14 -0600 Subject: [PATCH 02/13] fix documentation --- website/docs/d/cluster.html.markdown | 2 +- website/docs/d/clusters.html.markdown | 7 ++++--- website/docs/r/cluster.html.markdown | 9 +++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/website/docs/d/cluster.html.markdown b/website/docs/d/cluster.html.markdown index 4d24c60d01..e35c965ad4 100644 --- a/website/docs/d/cluster.html.markdown +++ b/website/docs/d/cluster.html.markdown @@ -103,7 +103,7 @@ In addition to all arguments above, the following attributes are exported: * `mongo_db_major_version` - Indicates the version of the cluster to deploy. * `num_shards` - Indicates whether the cluster is a replica set or a sharded cluster. * `provider_backup_enabled` - **(DEPRECATED)** Flag indicating if the cluster uses Cloud Backup Snapshots for backups. -* `cloud_backup` - Flag indicating +* `cloud_backup` - Flag indicating if the cluster uses Cloud Backup Snapshots for backups. * `provider_instance_size_name` - Atlas provides different instance sizes, each with a default storage capacity and RAM size. * `provider_name` - Indicates the cloud service provider on which the servers are provisioned. * `backing_provider_name` - Indicates Cloud service provider on which the server for a multi-tenant cluster is provisioned. diff --git a/website/docs/d/clusters.html.markdown b/website/docs/d/clusters.html.markdown index 0445c1820a..8c14d7d80c 100644 --- a/website/docs/d/clusters.html.markdown +++ b/website/docs/d/clusters.html.markdown @@ -33,7 +33,7 @@ resource "mongodbatlas_cluster" "test" { read_only_nodes = 0 } } - provider_backup_enabled = true + cloud_backup = true auto_scaling_disk_gb_enabled = true //Provider Settings "block" @@ -60,7 +60,7 @@ In addition to all arguments above, the following attributes are exported: ### Cluster * `name` - Name of the cluster as it appears in Atlas. -* `mongo_db_version` - Version of MongoDB the cluster runs, in `major-version`.`minor-version` format. +* `mongo_db_version` - Version of MongoDB the cluster runs, in `major-version`.`minor-version` format. * `mongo_uri` - Base connection string for the cluster. Atlas only displays this field after the cluster is operational, not while it builds the cluster. * `mongo_uri_updated` - Lists when the connection string was last updated. The connection string changes, for example, if you change a replica set to a sharded cluster. * `mongo_uri_with_options` - Describes connection string for connecting to the Atlas cluster. Includes the replicaSet, ssl, and authSource query parameters in the connection string with values appropriate for the cluster. @@ -103,7 +103,8 @@ In addition to all arguments above, the following attributes are exported: * `encryption_at_rest_provider` - Indicates whether Encryption at Rest is enabled or disabled. * `mongo_db_major_version` - Indicates the version of the cluster to deploy. * `num_shards` - Indicates whether the cluster is a replica set or a sharded cluster. -* `provider_backup_enabled` - Flag indicating if the cluster uses Cloud Backup Snapshots for backups. +* `provider_backup_enabled` - Flag indicating if the cluster uses Cloud Backup Snapshots for backups. **DEPRECATED** Use `cloud_backup` instead. +* `cloud_backup` - Flag indicating if the cluster uses Cloud Backup Snapshots for backups. * `provider_instance_size_name` - Atlas provides different instance sizes, each with a default storage capacity and RAM size. * `provider_name` - Indicates the cloud service provider on which the servers are provisioned. * `backing_provider_name` - Indicates Cloud service provider on which the server for a multi-tenant cluster is provisioned. diff --git a/website/docs/r/cluster.html.markdown b/website/docs/r/cluster.html.markdown index 991a37238f..436d7797ff 100644 --- a/website/docs/r/cluster.html.markdown +++ b/website/docs/r/cluster.html.markdown @@ -307,15 +307,16 @@ But in order to explicitly change `provider_instance_size_name` comment the `lif * `encryption_at_rest_provider` - (Optional) Possible values are AWS, GCP, AZURE or NONE. Only needed if you desire to manage the keys, see [Encryption at Rest using Customer Key Management](https://docs.atlas.mongodb.com/security-aws-kms/) for complete documentation. You must configure encryption at rest for the Atlas project before enabling it on any cluster in the project. For complete documentation on configuring Encryption at Rest, see Encryption at Rest using Customer Key Management. Requires M10 or greater. and for legacy backups, backup_enabled, to be false or omitted. **Note: Atlas encrypts all cluster storage and snapshot volumes, securing all cluster data on disk: a concept known as encryption at rest, by default**. * `mongo_db_major_version` - (Optional) Version of the cluster to deploy. Atlas supports the following MongoDB versions for M10+ clusters: `3.6`, `4.0`, or `4.2`. You must set this value to `4.2` if `provider_instance_size_name` is either M2 or M5. * `num_shards` - (Optional) Selects whether the cluster is a replica set or a sharded cluster. If you use the replicationSpecs parameter, you must set num_shards. -* `pit_enabled` - (Optional) - Flag that indicates if the cluster uses Continuous Cloud Backup. If set to true, provider_backup_enabled must also be set to true. +* `pit_enabled` - (Optional) - Flag that indicates if the cluster uses Continuous Cloud Backup. If set to true, cloud_backup must also be set to true. * `provider_backup_enabled` - (Optional) Flag indicating if the cluster uses Cloud Backup for backups. **Deprecated** use `cloud_backup` instead. +* `cloud_backup` - (Optional) Flag indicating if the cluster uses Cloud Backup for backups. - If true, the cluster uses Cloud Backup for backups. If provider_backup_enabled and backup_enabled are false, the cluster does not use Atlas backups. + If true, the cluster uses Cloud Backup for backups. If cloud_backup and backup_enabled are false, the cluster does not use Atlas backups. You cannot enable cloud backup if you have an existing cluster in the project with legacy backup enabled. ~> **IMPORTANT:** If setting to true for an existing cluster or imported cluster be sure to run terraform refresh after applying to enable modification of the Cloud Backup Snapshot Policy going forward. -* `cloud_backup` - (Optional) + * `backing_provider_name` - (Optional) Cloud service provider on which the server for a multi-tenant cluster is provisioned. This setting is only valid when providerSetting.providerName is TENANT and providerSetting.instanceSizeName is M2 or M5. @@ -505,7 +506,7 @@ In addition to all arguments above, the following attributes are exported: - REPAIRING ### Cloud Backup Policy -Cloud Backup Policy will be added if provider_backup_enabled is enabled because MongoDB Atlas automatically creates a default policy, if not, returned values will be empty. +Cloud Backup Policy will be added if provider_backup_enabled or cloud_backup is enabled because MongoDB Atlas automatically creates a default policy, if not, returned values will be empty. * `snapshot_backup_policy` - current snapshot schedule and retention settings for the cluster. From 1ed843c499c88570261acf5414c4ed7128267d3f Mon Sep 17 00:00:00 2001 From: Abner Garcia Date: Tue, 24 Aug 2021 14:38:41 -0600 Subject: [PATCH 03/13] typo fix --- website/docs/d/cluster.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/d/cluster.html.markdown b/website/docs/d/cluster.html.markdown index e35c965ad4..197a4bb877 100644 --- a/website/docs/d/cluster.html.markdown +++ b/website/docs/d/cluster.html.markdown @@ -33,7 +33,7 @@ resource "mongodbatlas_cluster" "test" { read_only_nodes = 0 } } - cloud_backup_config = true + cloud_backup = true auto_scaling_disk_gb_enabled = true //Provider Settings "block" From 9228e1b2ff0905654d92dd1ffe1776ba2e4786b2 Mon Sep 17 00:00:00 2001 From: Abner Garcia Date: Wed, 25 Aug 2021 12:06:53 -0600 Subject: [PATCH 04/13] changed examples in documentation --- website/docs/d/global_cluster_config.html.markdown | 2 +- website/docs/d/ldap_verify.html.markdown | 2 +- website/docs/r/cloud_provider_snapshot.html.markdown | 2 +- .../docs/r/cloud_provider_snapshot_restore_job.html.markdown | 4 ++-- website/docs/r/global_cluster_config.html.markdown | 3 +-- website/docs/r/ldap_verify.html.markdown | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/website/docs/d/global_cluster_config.html.markdown b/website/docs/d/global_cluster_config.html.markdown index 3660ec0d14..1e710c1542 100644 --- a/website/docs/d/global_cluster_config.html.markdown +++ b/website/docs/d/global_cluster_config.html.markdown @@ -21,7 +21,7 @@ description: |- project_id = "" name = "" disk_size_gb = 80 - provider_backup_enabled = true + cloud_backup = true cluster_type = "GEOSHARDED" //Provider Settings "block" diff --git a/website/docs/d/ldap_verify.html.markdown b/website/docs/d/ldap_verify.html.markdown index 1814077813..1a581f8681 100644 --- a/website/docs/d/ldap_verify.html.markdown +++ b/website/docs/d/ldap_verify.html.markdown @@ -30,7 +30,7 @@ resource "mongodbatlas_cluster" "test" { provider_name = "AWS" provider_region_name = "US_EAST_2" provider_instance_size_name = "M10" - provider_backup_enabled = true //enable cloud provider snapshots + cloud_backup = true //enable cloud provider snapshots provider_encrypt_ebs_volume = false } diff --git a/website/docs/r/cloud_provider_snapshot.html.markdown b/website/docs/r/cloud_provider_snapshot.html.markdown index 0df2484fc5..69b4cc0ebd 100644 --- a/website/docs/r/cloud_provider_snapshot.html.markdown +++ b/website/docs/r/cloud_provider_snapshot.html.markdown @@ -25,7 +25,7 @@ On-demand snapshots happen immediately, unlike scheduled snapshots which occur a provider_name = "AWS" provider_region_name = "EU_WEST_2" provider_instance_size_name = "M10" - provider_backup_enabled = true // enable cloud backup snapshots + cloud_backup = true // enable cloud backup snapshots } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/website/docs/r/cloud_provider_snapshot_restore_job.html.markdown b/website/docs/r/cloud_provider_snapshot_restore_job.html.markdown index 53dd421d93..b1e3dc0864 100644 --- a/website/docs/r/cloud_provider_snapshot_restore_job.html.markdown +++ b/website/docs/r/cloud_provider_snapshot_restore_job.html.markdown @@ -33,7 +33,7 @@ description: |- provider_name = "AWS" provider_region_name = "EU_WEST_2" provider_instance_size_name = "M10" - provider_backup_enabled = true // enable cloud backup snapshots + cloud_backup = true // enable cloud backup snapshots } resource "mongodbatlas_cloud_provider_snapshot" "test" { @@ -68,7 +68,7 @@ description: |- provider_name = "AWS" provider_region_name = "EU_WEST_2" provider_instance_size_name = "M10" - provider_backup_enabled = true // enable cloud backup snapshots + cloud_backup = true // enable cloud backup snapshots } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/website/docs/r/global_cluster_config.html.markdown b/website/docs/r/global_cluster_config.html.markdown index 84248e0309..3555b0cc43 100644 --- a/website/docs/r/global_cluster_config.html.markdown +++ b/website/docs/r/global_cluster_config.html.markdown @@ -23,8 +23,7 @@ description: |- project_id = "" name = "" disk_size_gb = 80 - backup_enabled = false - provider_backup_enabled = true + cloud_backup = true cluster_type = "GEOSHARDED" //Provider Settings "block" diff --git a/website/docs/r/ldap_verify.html.markdown b/website/docs/r/ldap_verify.html.markdown index e78b32b7a2..396b20074d 100644 --- a/website/docs/r/ldap_verify.html.markdown +++ b/website/docs/r/ldap_verify.html.markdown @@ -27,7 +27,7 @@ resource "mongodbatlas_cluster" "test" { provider_name = "AWS" provider_region_name = "US_EAST_2" provider_instance_size_name = "M10" - provider_backup_enabled = true //enable cloud provider snapshots + cloud_backup = true //enable cloud provider snapshots provider_encrypt_ebs_volume = false } From f4b1e2d4044812ab0427cb2b497002bc75c14faf Mon Sep 17 00:00:00 2001 From: Abner Garcia Date: Wed, 25 Aug 2021 15:25:33 -0600 Subject: [PATCH 05/13] added deprecated tags --- website/docs/d/cluster.html.markdown | 9 +++++++++ website/docs/d/clusters.html.markdown | 6 ++++++ website/docs/r/cluster.html.markdown | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/website/docs/d/cluster.html.markdown b/website/docs/d/cluster.html.markdown index 197a4bb877..eb4929d00b 100644 --- a/website/docs/d/cluster.html.markdown +++ b/website/docs/d/cluster.html.markdown @@ -161,6 +161,9 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `version` - The current version of the plugin. ### Cloud Provider Snapshot Backup Policy + +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. + * `snapshot_backup_policy` - current snapshot schedule and retention settings for the cluster. * `snapshot_backup_policy.#.cluster_id` - Unique identifier of the Atlas cluster. @@ -172,10 +175,16 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `snapshot_backup_policy.#.update_snapshots` - Specifies it's true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously. ### Policies + +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. + * `snapshot_backup_policy.#.policies` - A list of policy definitions for the cluster. * `snapshot_backup_policy.#.policies.#.id` - Unique identifier of the backup policy. #### Policy Item + +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. + * `snapshot_backup_policy.#.policies.#.policy_item` - A list of specifications for a policy. * `snapshot_backup_policy.#.policies.#.policy_item.#.id` - Unique identifier for this policy item. * `snapshot_backup_policy.#.policies.#.policy_item.#.frequency_interval` - The frequency interval for a set of snapshots. diff --git a/website/docs/d/clusters.html.markdown b/website/docs/d/clusters.html.markdown index 8c14d7d80c..1c818ca697 100644 --- a/website/docs/d/clusters.html.markdown +++ b/website/docs/d/clusters.html.markdown @@ -166,6 +166,8 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `version` - The current version of the plugin. ### Cloud Provider Snapshot Backup Policy +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. + * `snapshot_backup_policy` - current snapshot schedule and retention settings for the cluster. * `snapshot_backup_policy.#.cluster_id` - Unique identifier of the Atlas cluster. @@ -177,10 +179,14 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `snapshot_backup_policy.#.update_snapshots` - Specifies it's true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously. ### Policies +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. + * `snapshot_backup_policy.#.policies` - A list of policy definitions for the cluster. * `snapshot_backup_policy.#.policies.#.id` - Unique identifier of the backup policy. #### Policy Item +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. + * `snapshot_backup_policy.#.policies.#.policy_item` - A list of specifications for a policy. * `snapshot_backup_policy.#.policies.#.policy_item.#.id` - Unique identifier for this policy item. * `snapshot_backup_policy.#.policies.#.policy_item.#.frequency_interval` - The frequency interval for a set of snapshots. diff --git a/website/docs/r/cluster.html.markdown b/website/docs/r/cluster.html.markdown index 436d7797ff..d0b2f0a5fe 100644 --- a/website/docs/r/cluster.html.markdown +++ b/website/docs/r/cluster.html.markdown @@ -506,6 +506,9 @@ In addition to all arguments above, the following attributes are exported: - REPAIRING ### Cloud Backup Policy + +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. + Cloud Backup Policy will be added if provider_backup_enabled or cloud_backup is enabled because MongoDB Atlas automatically creates a default policy, if not, returned values will be empty. * `snapshot_backup_policy` - current snapshot schedule and retention settings for the cluster. @@ -519,10 +522,14 @@ Cloud Backup Policy will be added if provider_backup_enabled or cloud_backup is * `snapshot_backup_policy.#.update_snapshots` - Specifies it's true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously. ### Policies +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. + * `snapshot_backup_policy.#.policies` - A list of policy definitions for the cluster. * `snapshot_backup_policy.#.policies.#.id` - Unique identifier of the backup policy. #### Policy Item +**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. + * `snapshot_backup_policy.#.policies.#.policy_item` - A list of specifications for a policy. * `snapshot_backup_policy.#.policies.#.policy_item.#.id` - Unique identifier for this policy item. * `snapshot_backup_policy.#.policies.#.policy_item.#.frequency_interval` - The frequency interval for a set of snapshots. From 57910792cafc846a18afb73f1d4d76ec02b08eee Mon Sep 17 00:00:00 2001 From: Abner Garcia Date: Wed, 25 Aug 2021 15:30:54 -0600 Subject: [PATCH 06/13] fix conflicts --- website/docs/d/ldap_verify.html.markdown | 1 - website/docs/r/cluster.html.markdown | 2 +- website/docs/r/ldap_verify.html.markdown | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/website/docs/d/ldap_verify.html.markdown b/website/docs/d/ldap_verify.html.markdown index 1a581f8681..3872933b3b 100644 --- a/website/docs/d/ldap_verify.html.markdown +++ b/website/docs/d/ldap_verify.html.markdown @@ -31,7 +31,6 @@ resource "mongodbatlas_cluster" "test" { provider_region_name = "US_EAST_2" provider_instance_size_name = "M10" cloud_backup = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_ldap_verify" "test" { diff --git a/website/docs/r/cluster.html.markdown b/website/docs/r/cluster.html.markdown index d0b2f0a5fe..c6e793813b 100644 --- a/website/docs/r/cluster.html.markdown +++ b/website/docs/r/cluster.html.markdown @@ -279,7 +279,7 @@ But in order to explicitly change `provider_instance_size_name` comment the `lif * `backup_enabled` - (Optional) Legacy Backup - Set to true to enable Atlas legacy backups for the cluster. **Important** - MongoDB deprecated the Legacy Backup feature. Clusters that use Legacy Backup can continue to use it. MongoDB recommends using [Cloud Backups](https://docs.atlas.mongodb.com/backup/cloud-backup/overview/). - * Any net new Atlas clusters of any type do not support this parameter. These clusters must use Cloud Backup, `cloud_backup`, to enable Cloud Backup. If you create a new Atlas cluster and set `backup_enabled` to true, the Provider will respond with an error. This change doesn’t affect existing clusters that use legacy backups. + * New Atlas clusters of any type do not support this parameter. These clusters must use Cloud Backup, `cloud_backup`, to enable Cloud Backup. If you create a new Atlas cluster and set `backup_enabled` to true, the Provider will respond with an error. This change doesn’t affect existing clusters that use legacy backups. * Setting this value to false to disable legacy backups for the cluster will let Atlas delete any stored snapshots. In order to preserve the legacy backups snapshots, disable the legacy backups and enable the cloud backups in the single **terraform apply** action. ``` backup_enabled = "false" diff --git a/website/docs/r/ldap_verify.html.markdown b/website/docs/r/ldap_verify.html.markdown index 396b20074d..1a4545f129 100644 --- a/website/docs/r/ldap_verify.html.markdown +++ b/website/docs/r/ldap_verify.html.markdown @@ -28,7 +28,6 @@ resource "mongodbatlas_cluster" "test" { provider_region_name = "US_EAST_2" provider_instance_size_name = "M10" cloud_backup = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_ldap_verify" "test" { From b0759e1911ca1a8887b099d22192a4ed179ded86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20L=C3=B3pez?= Date: Tue, 24 Aug 2021 14:31:23 -0600 Subject: [PATCH 07/13] docs: added other example for ldap configuration docs (#520) Co-authored-by: Edgar Lopez --- .../docs/r/ldap_configuration.html.markdown | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/website/docs/r/ldap_configuration.html.markdown b/website/docs/r/ldap_configuration.html.markdown index 57a20ee3a5..298afe5009 100644 --- a/website/docs/r/ldap_configuration.html.markdown +++ b/website/docs/r/ldap_configuration.html.markdown @@ -12,19 +12,43 @@ description: |- ## Example Usage -```hcl +```terraform resource "mongodbatlas_project" "test" { - name = "NAME OF THE PROJECT" - org_id = "ORG ID" + name = "NAME OF THE PROJECT" + org_id = "ORG ID" } resource "mongodbatlas_ldap_configuration" "test" { - project_id = mongodbatlas_project.test.id - authentication_enabled = true - hostname = "HOSTNAME" - port = 636 - bind_username = "USERNAME" - bind_password = "PASSWORD" + project_id = mongodbatlas_project.test.id + authentication_enabled = true + hostname = "HOSTNAME" + port = 636 + bind_username = "USERNAME" + bind_password = "PASSWORD" +} +``` + +## Example Usage of LDAP with user to DN mapping + +```terraform +resource "mongodbatlas_project" "test" { + name = "NAME OF THE PROJECT" + org_id = "ORG ID" +} + +resource "mongodbatlas_ldap_configuration" "test" { + project_id = mongodbatlas_project.test.id + authentication_enabled = true + hostname = "HOSTNAME" + port = 636 + bind_username = "USERNAME" + bind_password = "PASSWORD" + ca_certificate = "CA CERTIFICATE" + authz_query_template = "{USER}?memberOf?base" + user_to_dn_mapping { + match = "(.+)" + ldap_query = "DC=example,DC=com??sub?(userPrincipalName={0})" + } } ``` @@ -52,4 +76,4 @@ LDAP Configuration must be imported using project ID, e.g. $ terraform import mongodbatlas_ldap_configuration.test 5d09d6a59ccf6445652a444a ``` -For more information see: [MongoDB Atlas API Reference.](https://docs.atlas.mongodb.com/reference/api/ldaps-configuration-save) \ No newline at end of file +For more information see: [MongoDB Atlas API Reference.](https://docs.atlas.mongodb.com/reference/api/ldaps-configuration-save) From dbe3848b6f06d4ace707287f719fd1ddce13b99b Mon Sep 17 00:00:00 2001 From: Abner Garcia <84406577+abner-dou@users.noreply.github.com> Date: Wed, 25 Aug 2021 08:52:19 -0600 Subject: [PATCH 08/13] fix documentation word in resources (#523) --- website/docs/r/privatelink_endpoint.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/privatelink_endpoint.html.markdown b/website/docs/r/privatelink_endpoint.html.markdown index 1f8cf189b6..bbf8572398 100644 --- a/website/docs/r/privatelink_endpoint.html.markdown +++ b/website/docs/r/privatelink_endpoint.html.markdown @@ -32,7 +32,7 @@ resource "mongodbatlas_privatelink_endpoint" "test" { ## Argument Reference * `project_id` - Required Unique identifier for the project. -* `providerName` - (Required) Name of the cloud provider for which you want to create the private endpoint service. Atlas accepts `AWS` or `AZURE`. +* `provider_name` - (Required) Name of the cloud provider for which you want to create the private endpoint service. Atlas accepts `AWS` or `AZURE`. * `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) and [AZURE regions](https://docs.atlas.mongodb.com/reference/microsoft-azure/#microsoft-azure) From 2cc53ddd9d01af010382ef101649616281c02e4e Mon Sep 17 00:00:00 2001 From: Gustavo Bazan Date: Wed, 25 Aug 2021 15:55:27 +0100 Subject: [PATCH 09/13] feat: use golangci lint action (#528) --- .github/workflows/automated-test.yml | 2 -- .github/workflows/golangci-lint.yml | 18 ++++++++++++++++ .golangci.yml | 11 +++++++--- GNUmakefile | 12 ++++++----- README.md | 4 ++-- .../README.md | 0 .../common.go | 2 +- ...mongodbatlas_cloud_provider_access_test.go | 3 ++- .../resource_mongodbatlas_data_lake_test.go | 3 +-- ...ce_mongodbatlas_encryption_at_rest_test.go | 4 ++-- .../test-upgrades_test.go | 21 +++++++------------ 11 files changed, 48 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml rename {integration-testing => integrationtesting}/README.md (100%) rename {integration-testing => integrationtesting}/common.go (96%) rename {integration-testing => integrationtesting}/resource_mongodbatlas_cloud_provider_access_test.go (96%) rename {integration-testing => integrationtesting}/resource_mongodbatlas_data_lake_test.go (99%) rename {integration-testing => integrationtesting}/resource_mongodbatlas_encryption_at_rest_test.go (98%) rename {integration-testing => integrationtesting}/test-upgrades_test.go (99%) diff --git a/.github/workflows/automated-test.yml b/.github/workflows/automated-test.yml index fde9e323f4..a87ea19a17 100644 --- a/.github/workflows/automated-test.yml +++ b/.github/workflows/automated-test.yml @@ -12,8 +12,6 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.16 - - name: Code Lint - run: make tools && make lint - name: Website run: make tools && make website-lint - name: Test diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000000..bbfa5dda41 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,18 @@ +--- +name: golangci-lint +on: + push: + branches: + - master + pull_request: +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2.5.2 + with: + version: v1.41.1 + args: --timeout 5m0s diff --git a/.golangci.yml b/.golangci.yml index 22845ca352..ea58eddcff 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -69,7 +69,7 @@ linters-settings: settings: mnd: # don't include the "operation" and "assign" - checks: case,return + checks: [case,return] funlen: lines: 360 statements: 120 @@ -134,6 +134,11 @@ issues: text: "SA1019:" # d.GetOkExists is deprecated: usage is discouraged due to undefined behaviors and may be removed in a future version of the SDK run: - # which dirs to skip: they won't be analyzed; + tests: true + build-tags: + - e2e + - unit + - integration skip-dirs: - - vendor + - internal/mocks + modules-download-mode: readonly diff --git a/GNUmakefile b/GNUmakefile index a8b1f0db2c..681ee2e5af 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,10 +1,9 @@ -TEST?=$$(go list ./... | grep -v /integration-testing) +TEST?=$$(go list ./... | grep -v /integrationtesting) GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) PKG_NAME=mongodbatlas WEBSITE_REPO=github.com/hashicorp/terraform-website GOFLAGS=-mod=vendor -GOGC=10 GOOPTS="-p 2" GITTAG=$(shell git describe --always --tags) @@ -40,10 +39,13 @@ fmtcheck: websitefmtcheck: @sh -c "'$(CURDIR)/scripts/websitefmtcheck.sh'" +lint-fix: + @echo "==> Checking source code against linters..." + golangci-lint run --fix + lint: @echo "==> Checking source code against linters..." - # https://github.com/golangci/golangci-lint/issues/337 fixing error - golangci-lint run ./$(PKG_NAME) -v --deadline=30m + golangci-lint run tools: ## Install dev tools @echo "==> Installing dependencies..." @@ -82,4 +84,4 @@ endif terratest: fmtcheck @$(eval VERSION=acc) - go test $$(go list ./... | grep /integration-testing) -v -parallel 20 $(TESTARGS) -timeout 120m -cover -ldflags="$(LINKER_FLAGS)" + go test $$(go list ./... | grep /integrationtesting) -v -parallel 20 $(TESTARGS) -timeout 120m -cover -ldflags="$(LINKER_FLAGS)" diff --git a/README.md b/README.md index 943e972514..8128af907e 100644 --- a/README.md +++ b/README.md @@ -231,9 +231,9 @@ We'd like to thank [Akshay Karle](https://github.com/akshaykarle) for writing th # Running the integration tests -The integration tests helps the validation for resources interacting with third party providers (aws, azure or gcp) using terratest [environment setup details](integration-testing/README.md) +The integration tests helps the validation for resources interacting with third party providers (aws, azure or gcp) using terratest [environment setup details](integrationtesting/README.md) ``` - cd integration-testing + cd integrationtesting go test -tags=integration ``` diff --git a/integration-testing/README.md b/integrationtesting/README.md similarity index 100% rename from integration-testing/README.md rename to integrationtesting/README.md diff --git a/integration-testing/common.go b/integrationtesting/common.go similarity index 96% rename from integration-testing/common.go rename to integrationtesting/common.go index 351eaa7a03..8116ffbf6f 100644 --- a/integration-testing/common.go +++ b/integrationtesting/common.go @@ -1,4 +1,4 @@ -package integration_testing +package integrationtesting import "os" diff --git a/integration-testing/resource_mongodbatlas_cloud_provider_access_test.go b/integrationtesting/resource_mongodbatlas_cloud_provider_access_test.go similarity index 96% rename from integration-testing/resource_mongodbatlas_cloud_provider_access_test.go rename to integrationtesting/resource_mongodbatlas_cloud_provider_access_test.go index d72acd6b97..2469fc81dc 100644 --- a/integration-testing/resource_mongodbatlas_cloud_provider_access_test.go +++ b/integrationtesting/resource_mongodbatlas_cloud_provider_access_test.go @@ -1,6 +1,7 @@ +//go:build integration // +build integration -package integration_testing +package integrationtesting import ( "os" diff --git a/integration-testing/resource_mongodbatlas_data_lake_test.go b/integrationtesting/resource_mongodbatlas_data_lake_test.go similarity index 99% rename from integration-testing/resource_mongodbatlas_data_lake_test.go rename to integrationtesting/resource_mongodbatlas_data_lake_test.go index 08af968451..6cb35a16d4 100644 --- a/integration-testing/resource_mongodbatlas_data_lake_test.go +++ b/integrationtesting/resource_mongodbatlas_data_lake_test.go @@ -1,4 +1,4 @@ -package integration_testing +package integrationtesting import ( "fmt" @@ -86,5 +86,4 @@ func TestTerraformResourceMongoDBAtlasDataLake_basicAWS(t *testing.T) { terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_data_lake.test", fmt.Sprintf("%s--%s--%s", projectID, lakeName, s3Bucket)) terraform.Plan(t, terraformOptionsSecond) - } diff --git a/integration-testing/resource_mongodbatlas_encryption_at_rest_test.go b/integrationtesting/resource_mongodbatlas_encryption_at_rest_test.go similarity index 98% rename from integration-testing/resource_mongodbatlas_encryption_at_rest_test.go rename to integrationtesting/resource_mongodbatlas_encryption_at_rest_test.go index af86a695ba..259ab250cd 100644 --- a/integration-testing/resource_mongodbatlas_encryption_at_rest_test.go +++ b/integrationtesting/resource_mongodbatlas_encryption_at_rest_test.go @@ -1,6 +1,7 @@ +//go:build integration // +build integration -package integration_testing +package integrationtesting import ( "fmt" @@ -81,5 +82,4 @@ func TestTerraformResourceMongoDBAtlasEncryptionAtRestWithRole_basicAWS(t *testi // Run `terraform apply`. Fail the test if there are any errors. terraform.InitAndApply(t, terraformOptionsSecond) - } diff --git a/integration-testing/test-upgrades_test.go b/integrationtesting/test-upgrades_test.go similarity index 99% rename from integration-testing/test-upgrades_test.go rename to integrationtesting/test-upgrades_test.go index e774b35147..40bf57cafa 100644 --- a/integration-testing/test-upgrades_test.go +++ b/integrationtesting/test-upgrades_test.go @@ -1,4 +1,4 @@ -package integration_testing +package integrationtesting import ( "context" @@ -73,7 +73,6 @@ func TestUpgradeNetworkContainerRegionsGCP(t *testing.T) { terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_network_container.test", fmt.Sprintf("%s-%s", projectID, networkContainerID)) // Run `terraform apply`. Fail the test if there are any errors. terraform.Plan(t, terraformOptionsSecond) - } func TestUpgradeDatabaseUserLDAPAuthType(t *testing.T) { @@ -128,12 +127,11 @@ func TestUpgradeDatabaseUserLDAPAuthType(t *testing.T) { }) terraform.RunTerraformCommand(t, terraformOptionsSecond, "init", fmt.Sprintf("--plugin-dir=%s", localPluginPath)) - //Remove states + // Remove states terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_project.test", projectID) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_database_user.test", fmt.Sprintf("%s-%s-%s", projectID, userName, authDatabaseName)) // Run `terraform apply`. Fail the test if there are any errors. terraform.Plan(t, terraformOptionsSecond) - } func testAccGetMongoDBAtlasMajorVersion() string { @@ -194,12 +192,11 @@ func TestUpgradeClusterDeprecationEBSVolume(t *testing.T) { }) terraform.RunTerraformCommand(t, terraformOptionsSecond, "init", fmt.Sprintf("--plugin-dir=%s", localPluginPath)) - //Remove states + // Remove states terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_project.test", projectID) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_cluster.test", fmt.Sprintf("%s-%s", projectID, clusterNameOutput)) // Run `terraform apply`. Fail the test if there are any errors. terraform.Plan(t, terraformOptionsSecond) - } func TestUpgradePrivateEndpoint(t *testing.T) { @@ -268,14 +265,13 @@ func TestUpgradePrivateEndpoint(t *testing.T) { }) terraform.RunTerraformCommand(t, terraformOptionsSecond, "init") - //Remove states + // Remove states terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_project.test", projectID) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_private_endpoint.test", fmt.Sprintf("%s-%s-%s-%s", projectID, privateEndpoint, "AWS", "us-east-1")) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "aws_vpc_endpoint.ptfe_service", vpcEndpoint) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_private_endpoint_interface_link.test", fmt.Sprintf("%s-%s-%s", projectID, privateEndpoint, vpcEndpoint)) // Run `terraform apply`. Fail the test if there are any errors. terraform.Plan(t, terraformOptionsSecond) - } func TestUpgradeProjectIPWhitelistDeprecation(t *testing.T) { @@ -329,12 +325,11 @@ func TestUpgradeProjectIPWhitelistDeprecation(t *testing.T) { }) terraform.RunTerraformCommand(t, terraformOptionsSecond, "init", fmt.Sprintf("--plugin-dir=%s", localPluginPath)) - //Remove states + // Remove states terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_project.test", projectID) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_project_ip_access_list.test", fmt.Sprintf("%s-%s", projectID, entry)) // Run `terraform apply`. Fail the test if there are any errors. terraform.Plan(t, terraformOptionsSecond) - } func TestUpgradeDesignIDState(t *testing.T) { @@ -529,14 +524,13 @@ func TestUpgradePrivateLinkEndpointDeprecation(t *testing.T) { }) terraform.RunTerraformCommand(t, terraformOptionsSecond, "init", fmt.Sprintf("--plugin-dir=%s", localPluginPath)) - //Remove states + // Remove states terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_project.test", projectID) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_privatelink_endpoint.test", fmt.Sprintf("%s-%s-%s-%s", projectID, privateEndpoint, "AWS", "us-east-1")) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "aws_vpc_endpoint.ptfe_service", vpcEndpoint) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_privatelink_endpoint_service.test", fmt.Sprintf("%s--%s--%s--%s", projectID, privateEndpoint, vpcEndpoint, "AWS")) // Run `terraform apply`. Fail the test if there are any errors. terraform.Plan(t, terraformOptionsSecond) - } func TestUpgradeCloudBackupPolicies(t *testing.T) { @@ -587,14 +581,13 @@ func TestUpgradeCloudBackupPolicies(t *testing.T) { }) terraform.RunTerraformCommand(t, terraformOptionsSecond, "init", fmt.Sprintf("--plugin-dir=%s", localPluginPath)) - //Remove states + // Remove states terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_project.project_test", projectID) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_cluster.cluster_test", fmt.Sprintf("%s-%s", projectID, cluster)) terraform.RunTerraformCommand(t, terraformOptionsSecond, "import", "mongodbatlas_cloud_backup_schedule.test", fmt.Sprintf("%s-%s", projectID, cluster)) // Run `terraform apply`. Fail the test if there are any errors. terraform.Plan(t, terraformOptionsSecond) - } // This func means that the terraform state will be always clean to avoid error about resource already used From db6a25079a304b396d30541e5e4e9b4bd5559f9e Mon Sep 17 00:00:00 2001 From: Gustavo Bazan Date: Wed, 25 Aug 2021 16:13:51 +0100 Subject: [PATCH 10/13] task: remove misspell as a dependency (#527) --- .github/workflows/golangci-lint.yml | 2 +- .golangci.yml | 2 - GNUmakefile | 9 +++- README.md | 65 ++++++++++++++--------------- go.mod | 3 +- go.sum | 40 +++++++++++------- tools.go | 7 ---- 7 files changed, 67 insertions(+), 61 deletions(-) delete mode 100644 tools.go diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index bbfa5dda41..3a51f540f0 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,4 +15,4 @@ jobs: uses: golangci/golangci-lint-action@v2.5.2 with: version: v1.41.1 - args: --timeout 5m0s + args: --timeout 7m0s diff --git a/.golangci.yml b/.golangci.yml index ea58eddcff..a724242297 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -136,8 +136,6 @@ issues: run: tests: true build-tags: - - e2e - - unit - integration skip-dirs: - internal/mocks diff --git a/GNUmakefile b/GNUmakefile index 681ee2e5af..deedc86a7d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,10 @@ TEST?=$$(go list ./... | grep -v /integrationtesting) GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) PKG_NAME=mongodbatlas + +BINARY_NAME=terraform-provider-mongodbatlas +DESTINATION=./bin/$(BINARY_NAME) + WEBSITE_REPO=github.com/hashicorp/terraform-website GOFLAGS=-mod=vendor @@ -18,6 +22,9 @@ export SHELL := env PATH=$(PATH) /bin/bash default: build build: fmtcheck + go build -ldflags "$(LINKER_FLAGS)" -o $(DESTINATION) + +install: fmtcheck go install -ldflags="$(LINKER_FLAGS)" test: fmtcheck @@ -49,7 +56,7 @@ lint: tools: ## Install dev tools @echo "==> Installing dependencies..." - GO111MODULE=on go install github.com/client9/misspell/cmd/misspell + go install github.com/client9/misspell/cmd/misspell@latest curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) check: test lint diff --git a/README.md b/README.md index 8128af907e..984522e31b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Learn more about Atlas at [https://www.mongodb.com/cloud/atlas](https://www.mon For general information about Terraform, visit the [official website](https://www.terraform.io) and the [GitHub project page](https://github.com/hashicorp/terraform). -# Support, Bugs, Feature Requests +## Support, Bugs, Feature Requests Support for the Terraform MongoDB Atlas Provider is provided under MongoDB Atlas support plans. Please submit support questions within the Atlas UI. Support questions submitted under the Issues section of this repo will be handled on a "best effort" basis. @@ -14,43 +14,51 @@ Bugs should be filed under the Issues section of this repo. Feature requests can be submitted at https://feedback.mongodb.com/forums/924145-atlas - just select the Terraform plugin as the category or vote for an already suggested feature. -# Requirements +## Requirements - [Terraform](https://www.terraform.io/downloads.html) 0.12+ - [Go](https://golang.org/doc/install) 1.16 (to build the provider plugin) -# Developing the Provider +## Using the Provider + +To use a released provider in your Terraform environment, run [`terraform init`](https://www.terraform.io/docs/commands/init.html) and Terraform will automatically install the provider. To specify a particular provider version when installing released providers, see the [`Terraform documentation on provider versioning`](https://www.terraform.io/docs/configuration/providers.html#version-provider-versions). + +Documentation about the provider specific configuration options can be found on the [provider's website](https://www.terraform.io/docs/providers/). + +## Developing the Provider + If you wish to work on the provider, you'll first need [Go](https://golang.org/doc/install) installed on your machine (please check the [requirements](#Requirements) before proceeding). Note: This project uses [Go Modules](https://blog.golang.org/using-go-modules) making it safe to work with it outside of your existing [GOPATH](https://golang.org/doc/code.html#GOPATH). The instructions that follow assume a directory in your home directory outside of the standard GOPATH (i.e $HOME/development/terraform-providers/). Clone repository to: `$HOME/development/terraform-providers/` -``` -$ mkdir -p $HOME/development/terraform-providers/; cd $HOME/development/terraform-providers/ -$ git clone git@github.com:mongodb/terraform-provider-mongodbatlas +```bash +mkdir -p $HOME/development/terraform-providers/; cd $HOME/development/terraform-providers/ +git clone git@github.com:mongodb/terraform-provider-mongodbatlas ... ``` Enter the provider directory and run `make tools`. This will install the needed tools for the provider. -``` -$ make tools + +```bash +make tools ``` -To compile the provider, run `make build`. This will build the provider and put the provider binary in the $GOPATH/bin directory -(**if you are using `go modules`, is not necessary to move the binary to `$GOPATH/bin**). +To compile the provider, run `make build`. This will build the provider and put its binary in the ./bin directory. -``` -$ make build +```bash +make build ... -$ $GOPATH/bin/terraform-provider-mongodbatlas +# ./bin/terraform-provider-mongodbatlas ... ``` -## Using development provider in Terraform 0.14+ +### Using development provider in Terraform 0.14+ From terraform version 0.14, we can override provider use for development purposes. Just create a `.trfc` file to hold the configuration to override terraform local configuration -``` + +```hcl provider_installation { dev_overrides { @@ -60,20 +68,13 @@ provider_installation { direct {} } ``` + and set the env var `TF_CLI_CONFIG_FILE` like this: `export TF_CLI_CONFIG_FILE=PATH/TO/dev.trfc` For more explained information about "plugin override" check [Development Overrides for Provider Developers](https://www.terraform.io/docs/cli/config/config-file.html#development-overrides-for-provider-developers) -# Using the Provider - -To use a released provider in your Terraform environment, run [`terraform init`](https://www.terraform.io/docs/commands/init.html) and Terraform will automatically install the provider. To specify a particular provider version when installing released providers, see the [`Terraform documentation on provider versioning`](https://www.terraform.io/docs/configuration/providers.html#version-provider-versions). - -To instead use a custom-built provider in your Terraform environment (e.g. the provider binary from the build instructions above), follow the instructions to [install it as a plugin](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin). After placing it into your plugins directory, run `terraform init` to initialize it. - -For either installation method, documentation about the provider specific configuration options can be found on the [provider's website](https://www.terraform.io/docs/providers/). - -# Testing the Provider +### Testing the Provider In order to test the provider, you can run `make test`. You can use [meta-arguments](https://www.terraform.io/docs/configuration/providers.html) such as `alias` and `version`. The following arguments are supported in the MongoDB Atlas `provider` block: @@ -85,9 +86,9 @@ In order to test the provider, you can run `make test`. You can use [meta-argume provided, but it can also be sourced from the `MONGODB_ATLAS_PRIVATE_KEY` environment variable. -~> **Notice:** If you do not have a `public_key` and `private_key` you must create a programmatic API key to configure the provider (see [Creating Programmatic API key](#Creating-Programmatic-API-key)). If you already have one, you can continue with [Configuring environment variables](#Configuring-environment-variables) +~> **Notice:** If you do not have a `public_key` and `private_key` you must create a programmatic API key to configure the provider (see [Creating Programmatic API key](#Programmatic-API-key)). If you already have one, you can continue with [Configuring environment variables](#Configuring-environment-variables) -# Running the acceptance test +### Running the acceptance test #### Programmatic API key @@ -169,7 +170,6 @@ $ export AWS_SECURITY_GROUP_ID= ``` ~> **Notice:** For more information about the PrivateLink (for AWS only), see: https://docs.atlas.mongodb.com/reference/api/encryption-at-rest/https://docs.atlas.mongodb.com/reference/api/private-endpoint/ - ##### AZURE env variables - For `Network Peering` resource configuration: @@ -224,12 +224,7 @@ In order to run the full suite of Acceptance tests, run ``make testacc``. ``` $ make testacc ``` - -Thanks ---------------------------- -We'd like to thank [Akshay Karle](https://github.com/akshaykarle) for writing the first version of a Terraform Provider for MongoDB Atlas and paving the way for the creation of this one. - -# Running the integration tests +### Running the integration tests The integration tests helps the validation for resources interacting with third party providers (aws, azure or gcp) using terratest [environment setup details](integrationtesting/README.md) @@ -237,3 +232,7 @@ The integration tests helps the validation for resources interacting with third cd integrationtesting go test -tags=integration ``` + +## Thanks + +We'd like to thank [Akshay Karle](https://github.com/akshaykarle) for writing the first version of a Terraform Provider for MongoDB Atlas and paving the way for the creation of this one. diff --git a/go.mod b/go.mod index 2f2ca78671..e1549c902e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/mongodb/terraform-provider-mongodbatlas go 1.16 require ( - github.com/client9/misspell v0.3.4 github.com/go-test/deep v1.0.7 github.com/gruntwork-io/terratest v0.32.20 github.com/hashicorp/hcl/v2 v2.10.0 // indirect @@ -13,6 +12,6 @@ require ( github.com/mwielbut/pointy v1.1.0 github.com/spf13/cast v1.3.1 github.com/terraform-providers/terraform-provider-aws v1.60.1-0.20210625132053-af2d5c0ad54f - go.mongodb.org/realm v0.0.1 go.mongodb.org/atlas v0.11.0 + go.mongodb.org/realm v0.0.1 ) diff --git a/go.sum b/go.sum index 856843de68..2c2970a8f9 100644 --- a/go.sum +++ b/go.sum @@ -14,7 +14,6 @@ cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gc cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0 h1:WRz29PgAsVEyPSDHyk+0fpEkwEFyfhHn+JbksT6gIL4= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU= @@ -31,29 +30,23 @@ cloud.google.com/go v0.83.0 h1:bAMqZidYkmIsUqe6PtkEPT7Q+vfizScn+jfNA6jwK9c= cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigtable v1.1.0 h1:+IakvK2mFz1FbfA9Ti0JoKRPiJkORngh9xhfMbVkJqw= -cloud.google.com/go/bigtable v1.1.0/go.mod h1:B6ByKcIdYmhoyDzmOnQxyOhN6r05qnewYIxxG6L0/b4= cloud.google.com/go/bigtable v1.10.1 h1:QKcRHeAsraxIlrdCZ3LLobXKBvITqcOEnSbHG2rzL9g= cloud.google.com/go/bigtable v1.10.1/go.mod h1:cyHeKlx6dcZCO0oSQucYdauseD8kIENGuDOJPKMCVg8= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/pubsub v1.5.0/go.mod h1:ZEwJccE3z93Z2HWvstpri00jOg7oO4UZDtKhwDwqF0w= cloud.google.com/go/spanner v1.7.0/go.mod h1:sd3K2gZ9Fd0vMPLXzeCrF6fq4i63Q7aTLW/lBIfBkIk= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= @@ -94,10 +87,8 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20210623224421-7f5af5003bbb h1:9HBI5n77Z2ReBlOFk1h2JFLpY/HobH9Xaq90E7IjCpw= github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20210623224421-7f5af5003bbb/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU= @@ -108,16 +99,19 @@ github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= @@ -139,6 +133,7 @@ github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/Y github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= @@ -188,7 +183,6 @@ github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXH github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -226,6 +220,7 @@ github.com/denis-tingajkin/go-header v0.4.2/go.mod h1:eLRHAVXzE5atsKAnNRDB90WHCF github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v0.0.0-20200109221225-a4f60165b7a3/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= @@ -243,10 +238,12 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 h1:yY9rWGoXv1U5pl4gxqlULARMQD7x0QG85lqEXTWysik= github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -281,16 +278,19 @@ github.com/go-critic/go-critic v0.5.6/go.mod h1:cVjj0DfqewQVIlIAGexPCaGaZDAqGE29 github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 h1:skJKxRtNmevLqnayafdLe2AsenqRupVmzZSqrvb5caU= github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= +github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -392,6 +392,7 @@ github.com/golangci/revgrep v0.0.0-20210208091834-cd28932614b5/go.mod h1:LK+zW4M github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= @@ -415,9 +416,11 @@ github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -580,6 +583,7 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jen20/awspolicyequivalence v1.1.0 h1:cn37D6o0lXLwqx2neCokGfaB3LLNSo5CrLMLGjY609g= github.com/jen20/awspolicyequivalence v1.1.0/go.mod h1:PV1fS2xyHhCLp83vbgSMFr2drM4GzG61wkz+k4pOG3E= @@ -587,6 +591,7 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jgautheron/goconst v1.4.0/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= +github.com/jhump/protoreflect v1.6.1 h1:4/2yi5LyDPP7nN+Hiird1SAJ6YoxUm13/oxHGRnbPd8= github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= github.com/jingyugao/rowserrcheck v0.0.0-20210315055705-d907ca737bb1/go.mod h1:TOQpc2SLx6huPfoFGK3UOnEG+u02D3C1GeosjupAKCA= github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a h1:zPPuIq2jAWWPTrGt70eK/BSch+gFAGrNzecsoENgu2o= @@ -597,6 +602,7 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= @@ -617,6 +623,7 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= @@ -634,10 +641,12 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.4.0/go.mod h1:vMu2Cizjy/grP+jmsvOFDx1kYP6+PD1lqg4Yu5exl2U= github.com/kunwardeep/paralleltest v1.0.2/go.mod h1:ZPqNm1fVHPllh5LPVujzbVz1JN2GhLxSfY+oqUsvG30= @@ -750,6 +759,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nishanths/exhaustive v0.1.0/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= github.com/nishanths/predeclared v0.2.1/go.mod h1:HvkGJcA3naj4lOwnFXFDkFxVtSqQMB9sbB1usJ+xjQE= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -848,6 +858,7 @@ github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdk github.com/securego/gosec/v2 v2.7.0/go.mod h1:xNbGArrGUspJLuz3LS5XCY1EBW/0vABAl/LWfSklmiM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil/v3 v3.21.4/go.mod h1:ghfMypLDrFSWN2c9cDYFLHyynQ+QUht0cv/18ZqVczw= @@ -937,6 +948,7 @@ github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+ github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -962,13 +974,8 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= -go.mongodb.org/atlas v0.8.0/go.mod h1:MMWDsc2akjTDSG4tVQrxv/82p3QbBnqeELbtTl45sbg= -go.mongodb.org/atlas v0.10.2-0.20210727120023-4db32e8a2854 h1:Ghz/RL5s1d1U0Va6fSrbbm8z/L5q4UPRSXEngOeYDDw= -go.mongodb.org/atlas v0.10.2-0.20210727120023-4db32e8a2854/go.mod h1:MMWDsc2akjTDSG4tVQrxv/82p3QbBnqeELbtTl45sbg= go.mongodb.org/atlas v0.11.0 h1:fVVh+lFlqpGaUw2GhtETnQehV4ftucXksx6CRVdE+hI= go.mongodb.org/atlas v0.11.0/go.mod h1:MMWDsc2akjTDSG4tVQrxv/82p3QbBnqeELbtTl45sbg= -go.mongodb.org/realm v0.0.0-20210618220639-e70c919266f2 h1:3ukcBKIOun3QRMZzdVRCU/7uVhjR7XQsdD/cCH5V8So= -go.mongodb.org/realm v0.0.0-20210618220639-e70c919266f2/go.mod h1:Tru1+aHka6+4uXYigPKoNySbNWgtkfsanVddwmcqvOM= go.mongodb.org/realm v0.0.1 h1:qh47ZkEMvlukKiKqcDDox5Lmx1Tk3krxwC7W9LhVGcc= go.mongodb.org/realm v0.0.1/go.mod h1:4LzdATHVci61HSpYuqmRPISks5WQdB92u/aJRHNz9/0= go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o= @@ -1477,6 +1484,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -1493,6 +1501,7 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1555,6 +1564,7 @@ mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20210104141923-aac4ce9116a7/go.mod h1:hBpJkZE8H/sb+VRFvw2+rBpHNsTBcvSpk61hr8mzXZE= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/tools.go b/tools.go deleted file mode 100644 index b578fca5cc..0000000000 --- a/tools.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build tools - -package main - -import ( - _ "github.com/client9/misspell/cmd/misspell" -) From c666b1c4e9b8e0ec91cd0a80c18722c7ec02b12e Mon Sep 17 00:00:00 2001 From: Gustavo Bazan Date: Wed, 25 Aug 2021 17:52:45 +0100 Subject: [PATCH 11/13] task: check examples are formatted correctly (#529) --- .github/workflows/examples.yml | 38 +++++++++++++++ GNUmakefile | 26 +++++++++-- .../atlas-cloud-provider-access/aws/main.tf | 14 +++--- .../aws/variables.tf | 30 ++++++------ examples/atlas-dataLake-roles/import/main.tf | 34 +++++++------- .../atlas-dataLake-roles/import/variables.tf | 6 +-- .../atlas-dataLake-roles/import/versions.tf | 2 +- examples/atlas-dataLake-roles/main.tf | 46 +++++++++---------- examples/atlas-dataLake-roles/variables.tf | 6 +-- examples/atlas-dataLake-roles/versions.tf | 2 +- examples/atlas-encryption-at-rest/aws/main.tf | 14 +++--- .../atlas-encryption-at-rest/aws/variables.tf | 30 ++++++------ .../aws-roles.tf | 8 ++-- .../aws-roles.tf | 10 ++-- examples/azure-atlas-privatelink/main.tf | 26 +++++------ examples/azure-atlas-privatelink/versions.tf | 2 +- examples/online-archives/main.tf | 46 +++++++++---------- examples/online-archives/variables.tf | 16 +++---- examples/starter/Readme.md | 4 +- examples/starter/variables.tf | 24 +++++----- .../v090/cluster/v082/variables.tf | 4 +- .../v090/cluster/v082/versions.tf | 2 +- .../v090/cluster/v090/variables.tf | 4 +- .../v090/cluster/v090/versions.tf | 2 +- .../v090/database-user/v082/versions.tf | 2 +- .../v090/database-user/v090/versions.tf | 2 +- .../v090/private-endpoint/v080/versions.tf | 2 +- .../v090/private-endpoint/v090/versions.tf | 2 +- .../v100/cloud-backup-policies/v091/main.tf | 42 ++++++++--------- .../cloud-backup-policies/v091/variables.tf | 2 +- .../cloud-backup-policies/v091/versions.tf | 2 +- .../v100/cloud-backup-policies/v100/main.tf | 2 +- .../cloud-backup-policies/v100/variables.tf | 2 +- .../cloud-backup-policies/v100/versions.tf | 2 +- .../alert-configuration/main.tf | 2 +- .../alert-configuration/versions.tf | 2 +- .../v100/design-id-reference/network/main.tf | 24 +++++----- .../design-id-reference/network/versions.tf | 2 +- .../design-id-reference/privatelink/main.tf | 16 +++---- .../privatelink/versions.tf | 2 +- .../design-id-reference/project/versions.tf | 2 +- .../snapshot-restore/main.tf | 8 ++-- .../snapshot-restore/versions.tf | 2 +- .../ip-whitelist-accestList/v091/variables.tf | 4 +- .../ip-whitelist-accestList/v091/versions.tf | 2 +- .../ip-whitelist-accestList/v100/variables.tf | 4 +- .../ip-whitelist-accestList/v100/versions.tf | 2 +- .../privatelink-endpoint/v091/versions.tf | 2 +- .../v100/privatelink-endpoint/v100/main.tf | 6 +-- .../privatelink-endpoint/v100/versions.tf | 2 +- scripts/tflint.sh | 34 ++++++++++++++ 51 files changed, 331 insertions(+), 241 deletions(-) create mode 100644 .github/workflows/examples.yml create mode 100755 scripts/tflint.sh diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 0000000000..0e2c395d49 --- /dev/null +++ b/.github/workflows/examples.yml @@ -0,0 +1,38 @@ +name: Examples Checks +on: + push: + branches: + - main + pull_request: + paths: + - .github/workflows/examples.yml + - examples/** + +env: + AWS_DEFAULT_REGION: us-west-2 + +jobs: + validate-terraform: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + terraform_version: ["0.12.29"] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + # See also: https://github.com/actions/setup-go/pull/62 + - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV + - uses: actions/setup-go@v2 + with: + go-version: 1.16 + - uses: hashicorp/setup-terraform@v1 + with: + terraform_version: ${{ matrix.terraform_version }} + # Needed to use the output of `terraform validate -json` + terraform_wrapper: false + - name: install tflint + run: go install github.com/terraform-linters/tflint@v0.31.0 + - name: terraform + run: make tflint \ No newline at end of file diff --git a/GNUmakefile b/GNUmakefile index deedc86a7d..d82c160751 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -21,46 +21,58 @@ export SHELL := env PATH=$(PATH) /bin/bash default: build +.PHONY: build build: fmtcheck go build -ldflags "$(LINKER_FLAGS)" -o $(DESTINATION) +.PHONY: install install: fmtcheck go install -ldflags="$(LINKER_FLAGS)" +.PHONY: test test: fmtcheck go test $(TEST) -timeout=30s -parallel=4 +.PHONY: testacc testacc: fmtcheck @$(eval VERSION=acc) TF_ACC=1 go test $(TEST) -v -parallel 20 $(TESTARGS) -timeout 300m -cover -ldflags="$(LINKER_FLAGS)" +.PHONY: fmt fmt: @echo "==> Fixing source code with gofmt..." gofmt -s -w ./main.go gofmt -s -w ./$(PKG_NAME) -# Currently required by tf-deploy compile -fmtcheck: +.PHONY: fmtcheck +fmtcheck: # Currently required by tf-deploy compile @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" +.PHONY: websitefmtcheck websitefmtcheck: @sh -c "'$(CURDIR)/scripts/websitefmtcheck.sh'" +.PHONY: lint-fix lint-fix: @echo "==> Checking source code against linters..." golangci-lint run --fix +.PHONY: lint lint: @echo "==> Checking source code against linters..." golangci-lint run +.PHONY: tools tools: ## Install dev tools @echo "==> Installing dependencies..." go install github.com/client9/misspell/cmd/misspell@latest + go install github.com/terraform-linters/tflint@v0.31.0 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) +.PHONY: check check: test lint +.PHONY: test-compile test-compile: @if [ "$(TEST)" = "./..." ]; then \ echo "ERROR: Set TEST to a specific package. For example,"; \ @@ -69,6 +81,7 @@ test-compile: fi go test -c $(TEST) $(TESTARGS) +.PHONY: website website: ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." @@ -76,10 +89,12 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) endif @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) +.PHONY: website-lint website-lint: @echo "==> Checking website against linters..." @misspell -error -source=text website/ +.PHONY: website-test website-test: ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." @@ -87,8 +102,11 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) endif @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) -.PHONY: build test testacc fmt fmtcheck lint check tools test-compile website website-lint website-test - +.PHONY: terratest terratest: fmtcheck @$(eval VERSION=acc) go test $$(go list ./... | grep /integrationtesting) -v -parallel 20 $(TESTARGS) -timeout 120m -cover -ldflags="$(LINKER_FLAGS)" + +.PHONY: tflint +tflint: fmtcheck + @scripts/tflint.sh diff --git a/examples/atlas-cloud-provider-access/aws/main.tf b/examples/atlas-cloud-provider-access/aws/main.tf index ed484154fa..0844e2f2e9 100644 --- a/examples/atlas-cloud-provider-access/aws/main.tf +++ b/examples/atlas-cloud-provider-access/aws/main.tf @@ -1,13 +1,13 @@ resource "mongodbatlas_cloud_provider_access_setup" "setup_only" { - project_id = var.project_id - provider_name = var.cloud_provider_access_name + project_id = var.project_id + provider_name = var.cloud_provider_access_name } resource "mongodbatlas_cloud_provider_access_authorization" "auth_role" { - project_id = var.project_id - role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id + project_id = var.project_id + role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id - aws { - iam_assumed_role_arn = aws_iam_role.test_role.arn - } + aws { + iam_assumed_role_arn = aws_iam_role.test_role.arn + } } diff --git a/examples/atlas-cloud-provider-access/aws/variables.tf b/examples/atlas-cloud-provider-access/aws/variables.tf index 2ad464a594..0690616ebf 100644 --- a/examples/atlas-cloud-provider-access/aws/variables.tf +++ b/examples/atlas-cloud-provider-access/aws/variables.tf @@ -1,25 +1,25 @@ // mongo -variable project_id { - type = string +variable "project_id" { + type = string } -variable cloud_provider_access_name { - type = string - default = "AWS" +variable "cloud_provider_access_name" { + type = string + default = "AWS" } -variable public_key { - type = string +variable "public_key" { + type = string } -variable private_key { - type = string +variable "private_key" { + type = string } // aws -variable access_key { - type = string +variable "access_key" { + type = string } -variable secret_key { - type = string +variable "secret_key" { + type = string } -variable aws_region { - type = string +variable "aws_region" { + type = string } \ No newline at end of file diff --git a/examples/atlas-dataLake-roles/import/main.tf b/examples/atlas-dataLake-roles/import/main.tf index 9ec48c5778..d7d93104e3 100644 --- a/examples/atlas-dataLake-roles/import/main.tf +++ b/examples/atlas-dataLake-roles/import/main.tf @@ -1,30 +1,30 @@ resource "mongodbatlas_project" "test" { - name = var.project_name - org_id = var.org_id + name = var.project_name + org_id = var.org_id } resource "mongodbatlas_cloud_provider_access_setup" "setup_only" { - project_id = mongodbatlas_project.test.id - provider_name = "AWS" + project_id = mongodbatlas_project.test.id + provider_name = "AWS" } resource "mongodbatlas_cloud_provider_access_authorization" "auth_role" { - project_id = mongodbatlas_project.test.id - role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id + project_id = mongodbatlas_project.test.id + role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id - aws { - iam_assumed_role_arn = aws_iam_role.test_role.arn - } + aws { + iam_assumed_role_arn = aws_iam_role.test_role.arn + } } resource "mongodbatlas_data_lake" "test" { - project_id = mongodbatlas_project.test.id - name = var.data_lake_name - aws_role_id = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id - aws_test_s3_bucket = var.test_s3_bucket - data_process_region = { - cloud_provider = "AWS" - region = var.data_lake_region - } + project_id = mongodbatlas_project.test.id + name = var.data_lake_name + aws_role_id = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id + aws_test_s3_bucket = var.test_s3_bucket + data_process_region = { + cloud_provider = "AWS" + region = var.data_lake_region + } } diff --git a/examples/atlas-dataLake-roles/import/variables.tf b/examples/atlas-dataLake-roles/import/variables.tf index 50baf8955f..047c110e18 100644 --- a/examples/atlas-dataLake-roles/import/variables.tf +++ b/examples/atlas-dataLake-roles/import/variables.tf @@ -6,9 +6,9 @@ variable "private_key" { description = "The private API key for MongoDB Atlas" default = "" } -variable base_url { - type = string - default = "" +variable "base_url" { + type = string + default = "" } variable "project_name" { description = "Atlas project name" diff --git a/examples/atlas-dataLake-roles/import/versions.tf b/examples/atlas-dataLake-roles/import/versions.tf index 6527b9bdf9..c9a511ab23 100644 --- a/examples/atlas-dataLake-roles/import/versions.tf +++ b/examples/atlas-dataLake-roles/import/versions.tf @@ -4,7 +4,7 @@ terraform { source = "hashicorp/aws" } mongodbatlas = { - source = "mongodb/mongodbatlas" + source = "mongodb/mongodbatlas" version = "0.1.0-dev" } } diff --git a/examples/atlas-dataLake-roles/main.tf b/examples/atlas-dataLake-roles/main.tf index 043d7aaccc..41bf1f7b80 100644 --- a/examples/atlas-dataLake-roles/main.tf +++ b/examples/atlas-dataLake-roles/main.tf @@ -1,50 +1,50 @@ resource "mongodbatlas_project" "test" { - name = var.project_name - org_id = var.org_id + name = var.project_name + org_id = var.org_id } resource "mongodbatlas_cloud_provider_access_setup" "setup_only" { - project_id = mongodbatlas_project.test.id - provider_name = "AWS" + project_id = mongodbatlas_project.test.id + provider_name = "AWS" } resource "mongodbatlas_cloud_provider_access_authorization" "auth_role" { - project_id = mongodbatlas_project.test.id - role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id + project_id = mongodbatlas_project.test.id + role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id - aws { - iam_assumed_role_arn = aws_iam_role.test_role.arn - } + aws { + iam_assumed_role_arn = aws_iam_role.test_role.arn + } } resource "mongodbatlas_data_lake" "test" { - project_id = mongodbatlas_project.test.id - name = var.data_lake_name - aws_role_id = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id - aws_test_s3_bucket = var.test_s3_bucket - data_process_region = { - cloud_provider = "AWS" - region = var.data_lake_region - } + project_id = mongodbatlas_project.test.id + name = var.data_lake_name + aws_role_id = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id + aws_test_s3_bucket = var.test_s3_bucket + data_process_region = { + cloud_provider = "AWS" + region = var.data_lake_region + } } output "project_id" { - value = mongodbatlas_project.test.id + value = mongodbatlas_project.test.id } output "role_id" { - value = mongodbatlas_cloud_provider_access_setup.setup_only.role_id + value = mongodbatlas_cloud_provider_access_setup.setup_only.role_id } output "role_name" { - value = aws_iam_role.test_role.name + value = aws_iam_role.test_role.name } output "policy_name" { - value = aws_iam_role_policy.test_policy.name + value = aws_iam_role_policy.test_policy.name } output "data_lake_name" { - value = mongodbatlas_data_lake.test.name + value = mongodbatlas_data_lake.test.name } output "s3_bucket" { - value = mongodbatlas_data_lake.test.aws_test_s3_bucket + value = mongodbatlas_data_lake.test.aws_test_s3_bucket } diff --git a/examples/atlas-dataLake-roles/variables.tf b/examples/atlas-dataLake-roles/variables.tf index 92d5937960..2aec951bc5 100644 --- a/examples/atlas-dataLake-roles/variables.tf +++ b/examples/atlas-dataLake-roles/variables.tf @@ -6,9 +6,9 @@ variable "private_key" { description = "The private API key for MongoDB Atlas" default = "" } -variable base_url { - type = string - default = "" +variable "base_url" { + type = string + default = "" } variable "project_name" { diff --git a/examples/atlas-dataLake-roles/versions.tf b/examples/atlas-dataLake-roles/versions.tf index 6527b9bdf9..c9a511ab23 100644 --- a/examples/atlas-dataLake-roles/versions.tf +++ b/examples/atlas-dataLake-roles/versions.tf @@ -4,7 +4,7 @@ terraform { source = "hashicorp/aws" } mongodbatlas = { - source = "mongodb/mongodbatlas" + source = "mongodb/mongodbatlas" version = "0.1.0-dev" } } diff --git a/examples/atlas-encryption-at-rest/aws/main.tf b/examples/atlas-encryption-at-rest/aws/main.tf index 5461bc7fa9..3e216a47df 100644 --- a/examples/atlas-encryption-at-rest/aws/main.tf +++ b/examples/atlas-encryption-at-rest/aws/main.tf @@ -1,15 +1,15 @@ resource "mongodbatlas_cloud_provider_access_setup" "setup_only" { - project_id = var.project_id - provider_name = var.cloud_provider_access_name + project_id = var.project_id + provider_name = var.cloud_provider_access_name } resource "mongodbatlas_cloud_provider_access_authorization" "auth_role" { - project_id = var.project_id - role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id + project_id = var.project_id + role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id - aws { - iam_assumed_role_arn = aws_iam_role.test_role.arn - } + aws { + iam_assumed_role_arn = aws_iam_role.test_role.arn + } } resource "mongodbatlas_encryption_at_rest" "test" { diff --git a/examples/atlas-encryption-at-rest/aws/variables.tf b/examples/atlas-encryption-at-rest/aws/variables.tf index 3f8ad3450e..3c25cafed4 100644 --- a/examples/atlas-encryption-at-rest/aws/variables.tf +++ b/examples/atlas-encryption-at-rest/aws/variables.tf @@ -1,27 +1,27 @@ // mongo -variable project_id { - type = string +variable "project_id" { + type = string } -variable cloud_provider_access_name { - type = string - default = "AWS" +variable "cloud_provider_access_name" { + type = string + default = "AWS" } -variable public_key { - type = string +variable "public_key" { + type = string } -variable private_key { - type = string +variable "private_key" { + type = string } // aws -variable access_key { - type = string +variable "access_key" { + type = string } -variable secret_key { - type = string +variable "secret_key" { + type = string } -variable aws_region { - type = string +variable "aws_region" { + type = string } // encryption at rest diff --git a/examples/atlas-encryptionAtRest-roles-one-step-workaround/aws-roles.tf b/examples/atlas-encryptionAtRest-roles-one-step-workaround/aws-roles.tf index 9363d31ca8..c775f10203 100644 --- a/examples/atlas-encryptionAtRest-roles-one-step-workaround/aws-roles.tf +++ b/examples/atlas-encryptionAtRest-roles-one-step-workaround/aws-roles.tf @@ -1,7 +1,7 @@ resource "mongodbatlas_cloud_provider_access" "test" { - project_id = var.project_id - provider_name = "AWS" - + project_id = var.project_id + provider_name = "AWS" + #(Optional) Since we update the `iam_assumed_role_arn` resource using an HTTP call and not by the `mongodbatlas_cloud_provider_access` resource argument, #the lifecycle argument was added so that terraform would ignore changes of the `iam_assumed_role_arn` argument in future terraform applies. lifecycle { @@ -57,7 +57,7 @@ EOF # sleep 10 - Waits ten seconds to make sure that all AWS servers are updated with the new IAM Role. resource "null_resource" "link_role_arn_to_cloud_provider_access" { provisioner "local-exec" { - command = < Format Checking Example: $DIR <===\e[0m"; echo + terraform fmt -check + # Terraform syntax checks + # echo; echo -e "\e[1;35m===> Validating Example: $DIR <===\e[0m"; echo + # TODO: INTMDB-249 + # tflint \ + # --enable-rule=terraform_deprecated_interpolation \ + # --enable-rule=terraform_deprecated_index \ + # --enable-rule=terraform_unused_declarations \ + # --enable-rule=terraform_comment_syntax \ + # --enable-rule=terraform_required_version + popd +done \ No newline at end of file From 3f8089287749f84226cf3e59962932676878f5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20L=C3=B3pez?= Date: Wed, 25 Aug 2021 13:13:43 -0600 Subject: [PATCH 12/13] INTMDB-236: Updated the cluster configuration (#526) * refactor: refactorized the examples for the cluster in tests/docs/examples * comment Co-authored-by: Edgar Lopez --- .../Atlas_Database_Users/atlas_cluster.tf | 1 - .../aws-atlas-privatelink/atlas-cluster.tf | 1 - .../test-upgrade/v090/cluster/v082/main.tf | 1 - .../test-upgrade/v090/cluster/v090/main.tf | 1 - .../v100/cloud-backup-policies/v091/main.tf | 1 - .../snapshot-restore/main.tf | 1 - ...ud_provider_snapshot_backup_policy_test.go | 1 - ...loud_provider_snapshot_restore_job_test.go | 1 - ...oud_provider_snapshot_restore_jobs_test.go | 2 - ...ngodbatlas_cloud_provider_snapshot_test.go | 1 - ...godbatlas_cloud_provider_snapshots_test.go | 2 - .../data_source_mongodbatlas_cluster_test.go | 15 +- .../data_source_mongodbatlas_clusters_test.go | 15 +- ...ud_provider_snapshot_backup_policy_test.go | 2 - ...loud_provider_snapshot_restore_job_test.go | 4 - ...ngodbatlas_cloud_provider_snapshot_test.go | 1 - .../resource_mongodbatlas_cluster_test.go | 207 ++++++++++++++---- ...esource_mongodbatlas_database_user_test.go | 1 - .../resource_mongodbatlas_ldap_verify_test.go | 1 - ...source_mongodbatlas_online_archive_test.go | 17 +- ...resource_mongodbatlas_search_index_test.go | 28 ++- .../r/global_cluster_config.html.markdown | 14 +- website/docs/r/network_peering.html.markdown | 69 ++++-- 23 files changed, 288 insertions(+), 99 deletions(-) diff --git a/examples/Atlas_Database_Users/atlas_cluster.tf b/examples/Atlas_Database_Users/atlas_cluster.tf index 0a211c2a4a..f0bf60ecb4 100644 --- a/examples/Atlas_Database_Users/atlas_cluster.tf +++ b/examples/Atlas_Database_Users/atlas_cluster.tf @@ -18,7 +18,6 @@ resource "mongodbatlas_cluster" "cluster" { provider_name = "AWS" disk_size_gb = 10 provider_instance_size_name = "M10" - provider_encrypt_ebs_volume = true } output "atlasclusterstring" { value = mongodbatlas_cluster.cluster.connection_strings diff --git a/examples/aws-atlas-privatelink/atlas-cluster.tf b/examples/aws-atlas-privatelink/atlas-cluster.tf index 1c263f974e..af64c0e2e7 100644 --- a/examples/aws-atlas-privatelink/atlas-cluster.tf +++ b/examples/aws-atlas-privatelink/atlas-cluster.tf @@ -17,7 +17,6 @@ resource "mongodbatlas_cluster" "cluster-atlas" { //Provider settings provider_name = "AWS" disk_size_gb = 10 - provider_encrypt_ebs_volume = true provider_instance_size_name = "M10" } output "atlasclusterstring" { diff --git a/examples/test-upgrade/v090/cluster/v082/main.tf b/examples/test-upgrade/v090/cluster/v082/main.tf index c514558902..e669619270 100644 --- a/examples/test-upgrade/v090/cluster/v082/main.tf +++ b/examples/test-upgrade/v090/cluster/v082/main.tf @@ -17,7 +17,6 @@ resource "mongodbatlas_cluster" "test" { // Provider Settings "block" provider_name = "AWS" provider_disk_iops = 300 - provider_encrypt_ebs_volume = false provider_instance_size_name = "M30" provider_region_name = "EU_CENTRAL_1" } diff --git a/examples/test-upgrade/v090/cluster/v090/main.tf b/examples/test-upgrade/v090/cluster/v090/main.tf index c514558902..e669619270 100644 --- a/examples/test-upgrade/v090/cluster/v090/main.tf +++ b/examples/test-upgrade/v090/cluster/v090/main.tf @@ -17,7 +17,6 @@ resource "mongodbatlas_cluster" "test" { // Provider Settings "block" provider_name = "AWS" provider_disk_iops = 300 - provider_encrypt_ebs_volume = false provider_instance_size_name = "M30" provider_region_name = "EU_CENTRAL_1" } diff --git a/examples/test-upgrade/v100/cloud-backup-policies/v091/main.tf b/examples/test-upgrade/v100/cloud-backup-policies/v091/main.tf index ab47b5cfa7..218a7dc439 100644 --- a/examples/test-upgrade/v100/cloud-backup-policies/v091/main.tf +++ b/examples/test-upgrade/v100/cloud-backup-policies/v091/main.tf @@ -15,7 +15,6 @@ resource "mongodbatlas_cluster" "cluster_test" { provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot_backup_policy" "test" { diff --git a/examples/test-upgrade/v100/design-id-reference/snapshot-restore/main.tf b/examples/test-upgrade/v100/design-id-reference/snapshot-restore/main.tf index e0ec2395c5..dc1936b5d3 100644 --- a/examples/test-upgrade/v100/design-id-reference/snapshot-restore/main.tf +++ b/examples/test-upgrade/v100/design-id-reference/snapshot-restore/main.tf @@ -12,7 +12,6 @@ resource "mongodbatlas_cluster" "my_cluster" { provider_region_name = "US_EAST_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go index 079b7d9612..5d74de9616 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go @@ -41,7 +41,6 @@ func testAccMongoDBAtlasDataSourceCloudProviderSnapshotBackupPolicyConfig(projec provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot_backup_policy" "test" { diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_job_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_job_test.go index 28a13ebff3..66d8e963bf 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_job_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_job_test.go @@ -49,7 +49,6 @@ func testAccMongoDBAtlasDataSourceCloudProviderSnapshotRestoreJobConfig(projectI provider_region_name = "US_EAST_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_jobs_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_jobs_test.go index d4377641fb..a26f884929 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_jobs_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_restore_jobs_test.go @@ -76,7 +76,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotRestoreJobsConfig(projectID, cluste provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { @@ -114,7 +113,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotRestoreJobsConfigWithPagination(pro provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_test.go index 430d1c4ba2..6f25b79c20 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshot_test.go @@ -49,7 +49,6 @@ func testAccMongoDBAtlasDataSourceCloudProviderSnapshotConfig(projectID, cluster provider_region_name = "US_EAST_2" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshots_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshots_test.go index e1aaf9dad4..e1be1d2a2e 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshots_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_provider_snapshots_test.go @@ -71,7 +71,6 @@ func testAccMongoDBAtlasDataSourceCloudProviderSnapshotsConfig(projectID, cluste provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { @@ -100,7 +99,6 @@ func testAccMongoDBAtlasDataSourceCloudProviderSnapshotsConfigWithPagination(pro provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/mongodbatlas/data_source_mongodbatlas_cluster_test.go b/mongodbatlas/data_source_mongodbatlas_cluster_test.go index 44f72cbcb3..247ef2c795 100644 --- a/mongodbatlas/data_source_mongodbatlas_cluster_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cluster_test.go @@ -55,17 +55,24 @@ func testAccDataSourceMongoDBAtlasClusterConfig(projectID, name, backupEnabled s project_id = "%s" name = "%s" disk_size_gb = 100 - num_shards = 1 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + provider_backup_enabled = %s auto_scaling_disk_gb_enabled = true // Provider Settings "block" provider_name = "AWS" - provider_encrypt_ebs_volume = false provider_instance_size_name = "M40" - provider_region_name = "US_EAST_2" labels { key = "key 1" diff --git a/mongodbatlas/data_source_mongodbatlas_clusters_test.go b/mongodbatlas/data_source_mongodbatlas_clusters_test.go index 1954f46772..fdff9a3b3d 100644 --- a/mongodbatlas/data_source_mongodbatlas_clusters_test.go +++ b/mongodbatlas/data_source_mongodbatlas_clusters_test.go @@ -52,17 +52,24 @@ func testAccDataSourceMongoDBAtlasClustersConfig(projectID, name, backupEnabled project_id = "%s" name = "%s" disk_size_gb = 10 - num_shards = 1 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + provider_backup_enabled = %s auto_scaling_disk_gb_enabled = true // Provider Settings "block" provider_name = "AWS" - provider_encrypt_ebs_volume = false provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" labels { key = "key 1" diff --git a/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go b/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go index 656e21371d..68b37d3cf8 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_backup_policy_test.go @@ -208,7 +208,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotBackupPolicyConfig(projectID, clust provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot_backup_policy" "test" { @@ -268,7 +267,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotBackupPolicyConfigWithoutRestoreDay provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot_backup_policy" "test" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_restore_job_test.go b/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_restore_job_test.go index f421fd495b..c1e62e5334 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_restore_job_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_restore_job_test.go @@ -196,7 +196,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotRestoreJobConfigAutomated(projectID provider_region_name = "US_EAST_1" provider_instance_size_name = "M10" provider_backup_enabled = true - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { @@ -231,7 +230,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotRestoreJobConfigDownload(projectID, provider_region_name = "US_EAST_1" provider_instance_size_name = "M10" provider_backup_enabled = true // enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { @@ -265,7 +263,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotRestoreJobConfigPointInTime(project provider_region_name = "US_EAST_1" provider_instance_size_name = "M10" provider_backup_enabled = true - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cluster" "my_cluster" { @@ -278,7 +275,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotRestoreJobConfigPointInTime(project provider_region_name = "US_EAST_1" provider_instance_size_name = "M10" provider_backup_enabled = true // enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_test.go b/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_test.go index 48eb3f7397..e7826a4df8 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_provider_snapshot_test.go @@ -164,7 +164,6 @@ func testAccMongoDBAtlasCloudProviderSnapshotConfig(projectID, clusterName, desc provider_region_name = "EU_CENTRAL_1" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_cloud_provider_snapshot" "test" { diff --git a/mongodbatlas/resource_mongodbatlas_cluster_test.go b/mongodbatlas/resource_mongodbatlas_cluster_test.go index b119089a88..cd6ee7579c 100644 --- a/mongodbatlas/resource_mongodbatlas_cluster_test.go +++ b/mongodbatlas/resource_mongodbatlas_cluster_test.go @@ -1104,9 +1104,19 @@ func testAccMongoDBAtlasClusterConfigAWS(projectID, name string, backupEnabled, project_id = "%[1]s" name = "%[2]s" disk_size_gb = 100 - num_shards = 1 - replication_factor = 3 - provider_backup_enabled = %[3]t + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "EU_CENTRAL_1" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + + cloud_backup = %[3]t pit_enabled = %[3]t auto_scaling_disk_gb_enabled = %[4]t mongo_db_major_version = "4.0" @@ -1114,7 +1124,6 @@ func testAccMongoDBAtlasClusterConfigAWS(projectID, name string, backupEnabled, // Provider Settings "block" provider_name = "AWS" provider_instance_size_name = "M30" - provider_region_name = "EU_CENTRAL_1" } `, projectID, name, backupEnabled, autoDiskGBEnabled) } @@ -1125,18 +1134,26 @@ func testAccMongoDBAtlasClusterConfigAWSNVMEInstance(projectID, name, backupEnab project_id = "%[1]s" name = "%[2]s" disk_size_gb = 100 - num_shards = 1 - replication_factor = 3 + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "EU_CENTRAL_1" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + provider_backup_enabled = %[3]s pit_enabled = %[3]s mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "AWS" - provider_encrypt_ebs_volume = false provider_volume_type = "PROVISIONED" provider_instance_size_name = "M40_NVME" - provider_region_name = "EU_CENTRAL_1" } `, projectID, name, backupEnabled) } @@ -1147,7 +1164,18 @@ func testAccMongoDBAtlasClusterConfigAdvancedConf(projectID, name, autoscalingEn project_id = "%s" name = "%s" disk_size_gb = 10 - replication_factor = 3 + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "EU_CENTRAL_1" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + backup_enabled = false auto_scaling_disk_gb_enabled = %s mongo_db_major_version = "4.0" @@ -1155,7 +1183,6 @@ func testAccMongoDBAtlasClusterConfigAdvancedConf(projectID, name, autoscalingEn // Provider Settings "block" provider_name = "AWS" provider_instance_size_name = "M10" - provider_region_name = "EU_CENTRAL_1" advanced_configuration { fail_index_key_too_long = %t @@ -1178,7 +1205,18 @@ func testAccMongoDBAtlasClusterConfigAdvancedConfPartial(projectID, name, autosc project_id = "%s" name = "%s" disk_size_gb = 10 - replication_factor = 3 + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "EU_CENTRAL_1" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + backup_enabled = false auto_scaling_disk_gb_enabled = %s mongo_db_major_version = "4.0" @@ -1200,10 +1238,19 @@ func testAccMongoDBAtlasClusterConfigAzure(projectID, name, backupEnabled string resource "mongodbatlas_cluster" "basic_azure" { project_id = "%s" name = "%s" - num_shards = 1 - replication_factor = 3 - provider_backup_enabled = %s + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + + cloud_backup = %s auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.0" @@ -1222,17 +1269,25 @@ func testAccMongoDBAtlasClusterConfigGCP(projectID, name, backupEnabled string) project_id = "%s" name = "%s" disk_size_gb = 40 - num_shards = 1 - replication_factor = 3 - provider_backup_enabled = %s + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_4" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + + cloud_backup = %s auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "GCP" provider_instance_size_name = "M30" - provider_region_name = "US_EAST_4" } `, projectID, name, backupEnabled) } @@ -1243,17 +1298,25 @@ func testAccMongoDBAtlasClusterConfigGCPWithBiConnector(projectID, name, backupE project_id = "%s" name = "%s" disk_size_gb = 40 - num_shards = 1 - replication_factor = 3 - provider_backup_enabled = %s + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_4" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + + cloud_backup = %s auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "GCP" provider_instance_size_name = "M30" - provider_region_name = "US_EAST_4" bi_connector_config { enabled = %t } @@ -1392,18 +1455,25 @@ func testAccMongoDBAtlasClusterAWSConfigdWithLabels(projectID, name, backupEnabl resource "mongodbatlas_cluster" "aws_with_labels" { project_id = "%s" name = "%s" - num_shards = 1 disk_size_gb = 10 - replication_factor = 3 + backup_enabled = %s auto_scaling_disk_gb_enabled = false mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "AWS" - provider_encrypt_ebs_volume = false provider_instance_size_name = "%s" - provider_region_name = "%s" + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "%s" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } %s } `, projectID, name, backupEnabled, tier, region, labelsConf) @@ -1448,7 +1518,6 @@ func testAccMongoDBAtlasClusterConfigWithPrivateEndpointLink(awsAccessKey, awsSe provider_region_name = "${upper(replace("%[5]s", "-", "_"))}" provider_instance_size_name = "M10" provider_backup_enabled = true // enable cloud provider snapshots - provider_encrypt_ebs_volume = true depends_on = ["mongodbatlas_privatelink_endpoint_service.test"] } `, awsAccessKey, awsSecretKey, projectID, providerName, region, vpcID, subnetID, securityGroupID, clusterName) @@ -1478,7 +1547,17 @@ func testAccMongoDBAtlasClusterConfigAzureWithNetworkPeering(projectID, provider project_id = "%[1]s" name = "%[7]s" - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "%[9]s" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.0" @@ -1486,7 +1565,6 @@ func testAccMongoDBAtlasClusterConfigAzureWithNetworkPeering(projectID, provider provider_name = "%[2]s" provider_disk_type_name = "P6" provider_instance_size_name = "M10" - provider_region_name = "%[9]s" depends_on = ["mongodbatlas_network_peering.test"] } @@ -1528,16 +1606,24 @@ func testAccMongoDBAtlasClusterConfigGCPWithNetworkPeering(gcpProjectID, gcpRegi project_id = "%[3]s" name = "%[6]s" disk_size_gb = 5 - num_shards = 1 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "%[7]s" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "%[4]s" provider_instance_size_name = "M10" - provider_region_name = "%[7]s" depends_on = ["google_compute_network_peering.gcp_peering"] } @@ -1550,14 +1636,23 @@ func testAccMongoDBAtlasClusterConfigAzureWithContainerID(projectID, clusterName project_id = "%[1]s" name = "%[2]s" - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "%[4]s" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = false mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "%[3]s" provider_instance_size_name = "M10" - provider_region_name = "%[4]s" } resource "mongodbatlas_network_peering" "test" { @@ -1586,14 +1681,23 @@ func testAccMongoDBAtlasClusterConfigAWSWithContainerID(awsAccessKey, awsSecretK name = "%[4]s" disk_size_gb = 5 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "%[6]s" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = false mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "%[5]s" provider_instance_size_name = "M10" - provider_region_name = "%[6]s" } resource "aws_default_vpc" "default" { @@ -1634,16 +1738,24 @@ func testAccMongoDBAtlasClusterConfigGCPWithContainerID(gcpProjectID, gcpRegion, project_id = "%[3]s" name = "%[4]s" disk_size_gb = 5 - num_shards = 1 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "%[6]s" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.0" // Provider Settings "block" provider_name = "%[5]s" provider_instance_size_name = "M10" - provider_region_name = "%[6]s" } resource "mongodbatlas_network_peering" "test" { @@ -1673,9 +1785,18 @@ func testAccMongoDBAtlasClusterConfigAWSWithAutoscaling( project_id = "%[1]s" name = "%[2]s" disk_size_gb = 100 - num_shards = 1 - replication_factor = 3 - provider_backup_enabled = %[3]s + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "EU_CENTRAL_1" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + cloud_backup = %[3]s auto_scaling_disk_gb_enabled = %[4]s auto_scaling_compute_enabled = %[5]s auto_scaling_compute_scale_down_enabled = %[6]s @@ -1683,9 +1804,7 @@ func testAccMongoDBAtlasClusterConfigAWSWithAutoscaling( //Provider Settings "block" provider_name = "AWS" - provider_encrypt_ebs_volume = false provider_instance_size_name = "%[8]s" - provider_region_name = "EU_CENTRAL_1" provider_auto_scaling_compute_min_instance_size = "%[7]s" provider_auto_scaling_compute_max_instance_size = "%[8]s" diff --git a/mongodbatlas/resource_mongodbatlas_database_user_test.go b/mongodbatlas/resource_mongodbatlas_database_user_test.go index 4688c6df1d..7a46cacb54 100644 --- a/mongodbatlas/resource_mongodbatlas_database_user_test.go +++ b/mongodbatlas/resource_mongodbatlas_database_user_test.go @@ -848,7 +848,6 @@ func testAccMongoDBAtlasDatabaseUserWithScopes(username, password, projectName, provider_region_name = "US_EAST_2" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_database_user" "test" { diff --git a/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go b/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go index fbd3853b1e..68ba0fed78 100644 --- a/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go +++ b/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go @@ -204,7 +204,6 @@ func testAccMongoDBAtlasLDAPVerifyConfig(projectName, orgID, clusterName, hostna provider_region_name = "US_EAST_2" provider_instance_size_name = "M10" provider_backup_enabled = true //enable cloud provider snapshots - provider_encrypt_ebs_volume = false } resource "mongodbatlas_ldap_verify" "test" { diff --git a/mongodbatlas/resource_mongodbatlas_online_archive_test.go b/mongodbatlas/resource_mongodbatlas_online_archive_test.go index fda2801389..e21902a140 100644 --- a/mongodbatlas/resource_mongodbatlas_online_archive_test.go +++ b/mongodbatlas/resource_mongodbatlas_online_archive_test.go @@ -20,17 +20,24 @@ const ( project_id = "%s" name = "%s" disk_size_gb = 10 - num_shards = 1 - replication_factor = 3 - provider_backup_enabled = %s + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + + cloud_backup = %s auto_scaling_disk_gb_enabled = true // Provider Settings "block" provider_name = "AWS" - provider_encrypt_ebs_volume = false provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" labels { key = "ArchiveTest" diff --git a/mongodbatlas/resource_mongodbatlas_search_index_test.go b/mongodbatlas/resource_mongodbatlas_search_index_test.go index df6dba4884..73fd8040fa 100644 --- a/mongodbatlas/resource_mongodbatlas_search_index_test.go +++ b/mongodbatlas/resource_mongodbatlas_search_index_test.go @@ -131,14 +131,24 @@ func testAccMongoDBAtlasSearchIndexConfig(projectID, clusterName string) string project_id = "%[1]s" name = "%[2]s" disk_size_gb = 10 - replication_factor = 3 + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + backup_enabled = false auto_scaling_disk_gb_enabled = false // Provider Settings "block" provider_name = "AWS" provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" } @@ -163,14 +173,24 @@ func testAccMongoDBAtlasSearchIndexConfigAdvanced(projectID, clusterName string) project_id = "%[1]s" name = "%[2]s" disk_size_gb = 10 - replication_factor = 3 + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + backup_enabled = false auto_scaling_disk_gb_enabled = false // Provider Settings "block" provider_name = "AWS" provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" } diff --git a/website/docs/r/global_cluster_config.html.markdown b/website/docs/r/global_cluster_config.html.markdown index 3555b0cc43..5b530a8e32 100644 --- a/website/docs/r/global_cluster_config.html.markdown +++ b/website/docs/r/global_cluster_config.html.markdown @@ -76,9 +76,18 @@ description: |- resource "mongodbatlas_cluster" "cluster-test" { project_id = "" name = "cluster-test" - num_shards = 1 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_1" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + backup_enabled = true auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.0" @@ -87,7 +96,6 @@ resource "mongodbatlas_cluster" "cluster-test" { provider_name = "AWS" disk_size_gb = 100 provider_instance_size_name = "M40" - provider_region_name = "US_EAST_1" } resource "mongodbatlas_global_cluster_config" "config" { diff --git a/website/docs/r/network_peering.html.markdown b/website/docs/r/network_peering.html.markdown index 2292e43683..44448999ef 100644 --- a/website/docs/r/network_peering.html.markdown +++ b/website/docs/r/network_peering.html.markdown @@ -115,15 +115,24 @@ resource "mongodbatlas_cluster" "test" { name = "terraform-manually-test" num_shards = 1 disk_size_gb = 5 - - replication_factor = 3 + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_4" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.2" # Provider Settings "block" provider_name = "GCP" provider_instance_size_name = "M10" - provider_region_name = "US_EAST_4" depends_on = ["google_compute_network_peering.peering"] } @@ -169,9 +178,18 @@ resource "mongodbatlas_network_peering" "test" { resource "mongodbatlas_cluster" "test" { project_id = local.project_id name = "terraform-manually-test" - num_shards = 1 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.2" @@ -179,7 +197,6 @@ resource "mongodbatlas_cluster" "test" { provider_name = "AZURE" provider_disk_type_name = "P4" provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" depends_on = ["mongodbatlas_network_peering.test"] } @@ -197,15 +214,24 @@ resource "mongodbatlas_cluster" "test" { project_id = local.project_id name = "terraform-test" disk_size_gb = 5 + + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } - replication_factor = 3 auto_scaling_disk_gb_enabled = false mongo_db_major_version = "4.2" //Provider Settings "block" provider_name = "AWS" provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" } # the following assumes an AWS provider is configured @@ -244,17 +270,25 @@ resource "aws_vpc_peering_connection_accepter" "aws_peer" { resource "mongodbatlas_cluster" "test" { project_id = local.project_id name = "terraform-manually-test" - num_shards = 1 disk_size_gb = 5 - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = true mongo_db_major_version = "4.2" //Provider Settings "block" provider_name = "GCP" provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" } # Create the peering connection request @@ -294,14 +328,23 @@ resource "mongodbatlas_cluster" "test" { project_id = local.project_id name = "cluster-azure" - replication_factor = 3 + cluster_type = "REPLICASET" + replication_specs { + num_shards = 1 + regions_config { + region_name = "US_EAST_2" + electable_nodes = 3 + priority = 7 + read_only_nodes = 0 + } + } + auto_scaling_disk_gb_enabled = false mongo_db_major_version = "4.2" //Provider Settings "block" provider_name = "AZURE" provider_instance_size_name = "M10" - provider_region_name = "US_EAST_2" } # Create the peering connection request From dee26747fd64b466d911034b97fe3a83fcd64b0d Mon Sep 17 00:00:00 2001 From: Abner Garcia Date: Wed, 25 Aug 2021 16:50:54 -0600 Subject: [PATCH 13/13] fix deprecated docs --- website/docs/d/cluster.html.markdown | 6 +++--- website/docs/d/clusters.html.markdown | 6 +++--- website/docs/r/cluster.html.markdown | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/website/docs/d/cluster.html.markdown b/website/docs/d/cluster.html.markdown index eb4929d00b..7d7e319e8f 100644 --- a/website/docs/d/cluster.html.markdown +++ b/website/docs/d/cluster.html.markdown @@ -162,7 +162,7 @@ Contains a key-value pair that tags that the cluster was created by a Terraform ### Cloud Provider Snapshot Backup Policy -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. * `snapshot_backup_policy` - current snapshot schedule and retention settings for the cluster. @@ -176,14 +176,14 @@ Contains a key-value pair that tags that the cluster was created by a Terraform ### Policies -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. * `snapshot_backup_policy.#.policies` - A list of policy definitions for the cluster. * `snapshot_backup_policy.#.policies.#.id` - Unique identifier of the backup policy. #### Policy Item -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. * `snapshot_backup_policy.#.policies.#.policy_item` - A list of specifications for a policy. * `snapshot_backup_policy.#.policies.#.policy_item.#.id` - Unique identifier for this policy item. diff --git a/website/docs/d/clusters.html.markdown b/website/docs/d/clusters.html.markdown index 1c818ca697..f3684c512a 100644 --- a/website/docs/d/clusters.html.markdown +++ b/website/docs/d/clusters.html.markdown @@ -166,7 +166,7 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `version` - The current version of the plugin. ### Cloud Provider Snapshot Backup Policy -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. * `snapshot_backup_policy` - current snapshot schedule and retention settings for the cluster. @@ -179,13 +179,13 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `snapshot_backup_policy.#.update_snapshots` - Specifies it's true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously. ### Policies -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. * `snapshot_backup_policy.#.policies` - A list of policy definitions for the cluster. * `snapshot_backup_policy.#.policies.#.id` - Unique identifier of the backup policy. #### Policy Item -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` datasource instead. * `snapshot_backup_policy.#.policies.#.policy_item` - A list of specifications for a policy. * `snapshot_backup_policy.#.policies.#.policy_item.#.id` - Unique identifier for this policy item. diff --git a/website/docs/r/cluster.html.markdown b/website/docs/r/cluster.html.markdown index c6e793813b..3f146067fd 100644 --- a/website/docs/r/cluster.html.markdown +++ b/website/docs/r/cluster.html.markdown @@ -507,7 +507,7 @@ In addition to all arguments above, the following attributes are exported: ### Cloud Backup Policy -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. Cloud Backup Policy will be added if provider_backup_enabled or cloud_backup is enabled because MongoDB Atlas automatically creates a default policy, if not, returned values will be empty. @@ -522,13 +522,13 @@ Cloud Backup Policy will be added if provider_backup_enabled or cloud_backup is * `snapshot_backup_policy.#.update_snapshots` - Specifies it's true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously. ### Policies -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. * `snapshot_backup_policy.#.policies` - A list of policy definitions for the cluster. * `snapshot_backup_policy.#.policies.#.id` - Unique identifier of the backup policy. #### Policy Item -**WARNING:** This property is going to be deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. +**WARNING:** This property is deprecated, use `mongodbatlas_cloud_backup_schedule` resource instead. * `snapshot_backup_policy.#.policies.#.policy_item` - A list of specifications for a policy. * `snapshot_backup_policy.#.policies.#.policy_item.#.id` - Unique identifier for this policy item.