Skip to content

Commit

Permalink
v1.8.0 staging (#1018)
Browse files Browse the repository at this point in the history
* INTMDB-454: New Data Source to GET Org Id (#973)

* Add support for mongodbatlas_roles_org_id

* Add Documentation for roles_org_id

* Update go library

* Add mongodbatlas_roles_org_id to datasource and resource to provide org_id

* doc clean up / link to new API docs

* formatting fix + update links to new API docs

* formatting + update link to new API docs

* formatting

Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-409: Deprecation Announcement  (#988)

* Chore(deps): Bump github.com/gruntwork-io/terratest (#978)

Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.6 to 0.41.7.
- [Release notes](https://github.com/gruntwork-io/terratest/releases)
- [Commits](gruntwork-io/terratest@v0.41.6...v0.41.7)

---
updated-dependencies:
- dependency-name: github.com/gruntwork-io/terratest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Chore(deps): Bump actions/stale from 6 to 7 (#977)

Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v6...v7)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* v1.7.0 Pre-Release (#980)

* Delete mongodbatlas.erb (#962)

* INTMDB-523: Rename exportJobID to exportID to match go client (#976)

* Updated version of atlas api client used, renamed bucketID to exportJobID

* Reverted changes to bucketID and updated exportJobID to exportID

* INTMDB-521: AWS Secrets Manager to Auth into Terraform Atlas Provider (#975)

* Add support for assume_role

* Add documentation for assume_role feature

* Add AWS parameters Env vars

* Update index.html.markdown

* Doc clean up

* typo

* Add regional behavior to endpoint sts client

* Add sts_endpoint parameter

* Update website/docs/index.html.markdown

* formatting

* formatting2

* Removed commented code

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update .github_changelog_generator

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* Revert "v1.7.0 Pre-Release (#980)" (#982)

This reverts commit 7a57d21.

* Add deprecation notices

* Additional deprecation details

* Add more detail

* Update resource_mongodbatlas_private_ip_mode.go

* Update resource_mongodbatlas_private_ip_mode.go

* Update resource_mongodbatlas_private_ip_mode.go

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-482: Add deprecation relating to NEW_RELIC, FLOWDOCK (#989)

* Chore(deps): Bump github.com/gruntwork-io/terratest (#978)

Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.6 to 0.41.7.
- [Release notes](https://github.com/gruntwork-io/terratest/releases)
- [Commits](gruntwork-io/terratest@v0.41.6...v0.41.7)

---
updated-dependencies:
- dependency-name: github.com/gruntwork-io/terratest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Chore(deps): Bump actions/stale from 6 to 7 (#977)

Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v6...v7)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* v1.7.0 Pre-Release (#980)

* Delete mongodbatlas.erb (#962)

* INTMDB-523: Rename exportJobID to exportID to match go client (#976)

* Updated version of atlas api client used, renamed bucketID to exportJobID

* Reverted changes to bucketID and updated exportJobID to exportID

* INTMDB-521: AWS Secrets Manager to Auth into Terraform Atlas Provider (#975)

* Add support for assume_role

* Add documentation for assume_role feature

* Add AWS parameters Env vars

* Update index.html.markdown

* Doc clean up

* typo

* Add regional behavior to endpoint sts client

* Add sts_endpoint parameter

* Update website/docs/index.html.markdown

* formatting

* formatting2

* Removed commented code

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update .github_changelog_generator

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* Revert "v1.7.0 Pre-Release (#980)" (#982)

This reverts commit 7a57d21.

* V1.7.0 staging (#984)

* Delete mongodbatlas.erb (#962)

* INTMDB-523: Rename exportJobID to exportID to match go client (#976)

* Updated version of atlas api client used, renamed bucketID to exportJobID

* Reverted changes to bucketID and updated exportJobID to exportID

* INTMDB-521: AWS Secrets Manager to Auth into Terraform Atlas Provider (#975)

* Add support for assume_role

* Add documentation for assume_role feature

* Add AWS parameters Env vars

* Update index.html.markdown

* Doc clean up

* typo

* Add regional behavior to endpoint sts client

* Add sts_endpoint parameter

* Update website/docs/index.html.markdown

* formatting

* formatting2

* Removed commented code

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update .github_changelog_generator

* Update CHANGELOG.md

* Changelog Cleanup

* 1.7.0 Upgrade and Information Guide

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* AWS_SM_Doc_Adds (#986)

* Adding Instructions to dev versions of provider (#987)

* Add deprecation relating to NEW_RELIC, FLOWDOCK

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-530: Add import example for Encryption at Rest (#992)

* Chore(deps): Bump github.com/gruntwork-io/terratest (#978)

Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.6 to 0.41.7.
- [Release notes](https://github.com/gruntwork-io/terratest/releases)
- [Commits](gruntwork-io/terratest@v0.41.6...v0.41.7)

---
updated-dependencies:
- dependency-name: github.com/gruntwork-io/terratest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Chore(deps): Bump actions/stale from 6 to 7 (#977)

Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v6...v7)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* v1.7.0 Pre-Release (#980)

* Delete mongodbatlas.erb (#962)

* INTMDB-523: Rename exportJobID to exportID to match go client (#976)

* Updated version of atlas api client used, renamed bucketID to exportJobID

* Reverted changes to bucketID and updated exportJobID to exportID

* INTMDB-521: AWS Secrets Manager to Auth into Terraform Atlas Provider (#975)

* Add support for assume_role

* Add documentation for assume_role feature

* Add AWS parameters Env vars

* Update index.html.markdown

* Doc clean up

* typo

* Add regional behavior to endpoint sts client

* Add sts_endpoint parameter

* Update website/docs/index.html.markdown

* formatting

* formatting2

* Removed commented code

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update .github_changelog_generator

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* Revert "v1.7.0 Pre-Release (#980)" (#982)

This reverts commit 7a57d21.

* V1.7.0 staging (#984)

* Delete mongodbatlas.erb (#962)

* INTMDB-523: Rename exportJobID to exportID to match go client (#976)

* Updated version of atlas api client used, renamed bucketID to exportJobID

* Reverted changes to bucketID and updated exportJobID to exportID

* INTMDB-521: AWS Secrets Manager to Auth into Terraform Atlas Provider (#975)

* Add support for assume_role

* Add documentation for assume_role feature

* Add AWS parameters Env vars

* Update index.html.markdown

* Doc clean up

* typo

* Add regional behavior to endpoint sts client

* Add sts_endpoint parameter

* Update website/docs/index.html.markdown

* formatting

* formatting2

* Removed commented code

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update .github_changelog_generator

* Update CHANGELOG.md

* Changelog Cleanup

* 1.7.0 Upgrade and Information Guide

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* AWS_SM_Doc_Adds (#986)

* Adding Instructions to dev versions of provider (#987)

* doc formatting edits (#990)

* doc formatting (#991)

* Add import example for Encryption at Rest

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-468: Hide current_certificate when X.509 Authentication Database Users are Created (#985)

* Chore(deps): Bump github.com/gruntwork-io/terratest (#978)

Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.6 to 0.41.7.
- [Release notes](https://github.com/gruntwork-io/terratest/releases)
- [Commits](gruntwork-io/terratest@v0.41.6...v0.41.7)

---
updated-dependencies:
- dependency-name: github.com/gruntwork-io/terratest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Chore(deps): Bump actions/stale from 6 to 7 (#977)

Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v6...v7)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Initial attempt at moving certificate out of ID

* Find latest ID

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* federated_settings_org_config import example fix (#996)

* example fix

* log to file add

* formating

* formatting updates

* Example fix Resource: mongodbatlas_federated_settings_org_config

* Change logic of invitation create read delete when it has been accepted (#1012)

* INTMDB-346: Feature add: add support for programmatic API keys (#974)

* Initial version

* Add support for api key test cases

* Update documents

* Update website/docs/r/api_key.html.markdown

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update website/docs/d/api_keys.html.markdown

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update website/docs/d/api_key.html.markdown

Co-authored-by: Zuhair Ahmed <[email protected]>

* initial addition of tests

* Update project api keys tests

* Commented code removal

* Update Docs rename resource

* Add warning and update reference link to new docs

* Update reference links to new docs

* Update reference link to new docs

* formatting

* link fix

Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-472: Update_snapshots doesn't save at TF state with mongodbatlas_cloud_backup_schedule resource (#1014)

* skip update_snapshots on read as API does not return current value

* Doc update

* Update website/docs/r/cloud_backup_schedule.html.markdown

Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-455: bi_connector settings in mongodbatlas_advanced_cluster fix (#1010)

* Add support for migrating bi_connector to bi_connector_config

* Add deprecated parameter pathway for upgrade  and test

* INTMDB-519: mongodbatlas_third_party_integration - api_token keeps updating on every apply (#1011)

* Add additional overrides for obfuscated API values set to parameters

* Add username to sensitive values

* Add WebHook secret and URL to manage drift

* INTMDB-448: custom_db_role error  (#1009)

* example fix

* log to file add

* formating

* formatting updates

* Add mutex to prevent concurrent API calls datasource simplify count as it picks up other tests

Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-543: LDAP Config and LDAP Verify Resources Fix (#1004)

* Update for breaking change in mongodb go library

* go mod tidy

* Update error logging and constant

* INTMDB-427: Cloud backup schedule, export fix (#968)

* Addressing failures on cloud backup schedule

* Updated condition for updating export request

* INTMDB-341: Fix search_index update (#964)

* Fixed casing on search_index attribute casing in update. Updated formatting on test json

* More formatting of string based tf configs

* INTMDB-488: Analytics node tier new features (#994)

* Chore(deps): Bump github.com/gruntwork-io/terratest (#978)

Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.6 to 0.41.7.
- [Release notes](https://github.com/gruntwork-io/terratest/releases)
- [Commits](gruntwork-io/terratest@v0.41.6...v0.41.7)

---
updated-dependencies:
- dependency-name: github.com/gruntwork-io/terratest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Chore(deps): Bump actions/stale from 6 to 7 (#977)

Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v6...v7)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* v1.7.0 Pre-Release (#980)

* Delete mongodbatlas.erb (#962)

* INTMDB-523: Rename exportJobID to exportID to match go client (#976)

* Updated version of atlas api client used, renamed bucketID to exportJobID

* Reverted changes to bucketID and updated exportJobID to exportID

* INTMDB-521: AWS Secrets Manager to Auth into Terraform Atlas Provider (#975)

* Add support for assume_role

* Add documentation for assume_role feature

* Add AWS parameters Env vars

* Update index.html.markdown

* Doc clean up

* typo

* Add regional behavior to endpoint sts client

* Add sts_endpoint parameter

* Update website/docs/index.html.markdown

* formatting

* formatting2

* Removed commented code

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update .github_changelog_generator

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* Revert "v1.7.0 Pre-Release (#980)" (#982)

This reverts commit 7a57d21.

* V1.7.0 staging (#984)

* Delete mongodbatlas.erb (#962)

* INTMDB-523: Rename exportJobID to exportID to match go client (#976)

* Updated version of atlas api client used, renamed bucketID to exportJobID

* Reverted changes to bucketID and updated exportJobID to exportID

* INTMDB-521: AWS Secrets Manager to Auth into Terraform Atlas Provider (#975)

* Add support for assume_role

* Add documentation for assume_role feature

* Add AWS parameters Env vars

* Update index.html.markdown

* Doc clean up

* typo

* Add regional behavior to endpoint sts client

* Add sts_endpoint parameter

* Update website/docs/index.html.markdown

* formatting

* formatting2

* Removed commented code

Co-authored-by: Zuhair Ahmed <[email protected]>

* Update .github_changelog_generator

* Update CHANGELOG.md

* Changelog Cleanup

* 1.7.0 Upgrade and Information Guide

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* AWS_SM_Doc_Adds (#986)

* Adding Instructions to dev versions of provider (#987)

* doc formatting edits (#990)

* doc formatting (#991)

* Initial analytics scaling

* Add Documentation updates for analytics_auto_scaling

* Update advanced_cluster.html.markdown

* Add testing for analytics scaling

* example fix

* log to file add

* formating

* formatting updates

* Add mutex to custom db role API call to avoid overlapping API calls

* Add back test mutex fixed API concurrency issue

* Rollback 448 changes pushed to incorrect branch

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>

* INTMDB-382: Improve the importing of default alert configurations for a project (#993)

* Added alert_configurations data_source

* Added documentation on how to use data_source_alert_configuration outputs, as well as the new data source for all alert configurations

* Removed duplicate function declaration

* Resolving lint errors around looping

* Added example for importing atlas-alert-configurations en masse

* Got tests passing, added documentation for alert_configuration data_source

* Fixed alert_configurations test

* Updated readme to include instructions for creating the data source

* Fixed spacing and added a link to the full example on the data source docs

* INTMDB-400: Feature add: Enable support for Snapshot Distribution (#979)

* Add CopySettings support

* Add feature for snapshot replication

* Update go.mod

* Update go.sum

* Update go.mod

* Add example for resource with snapshot distribution

* Add recommended if else approach bring go-client to latest master to pickup empty struct

* Add note about deleteCopiedBackups

* INTMDB-464 Ignorable replication_specs & region_configs (#961)

* Started work on state migration

* Got StateUpgrader for v0 to v1 working & added test

* Updated flattenAdvancedReplicationSpecs algorithm to ensure order is maintained between api & tf state

* Fixed lint issues

* Migrated replication_spec migration code to be encompassed by bi connector migration

* INTMDB-547: 1005 - Enhance docs for mongodbatlas cloud_backup_schedule (#1007)

* Updates documenation for mongodbatlas_cloud_backup_schedule by adding more information about possible values for frequency_type, frequency_interval, retention_unit and retention_value.

* Updates documenation for mongodbatlas_cloud_backup_schedule by adding more information about possible values for frequency_type, frequency_interval, retention_unit and retention_value.

* Adds comments to the examples for more context

* Removes unnecessary colons.

* Fixed spelling mistake

* Fix BI Connector documentation snippet (#1017)

This change adjusts the BI Connector documentation snippet by:

- Replacing the reference to `bi_connector` with `bi_connector_config`
- Wrapping the `secondary` string in double quotes
- Fixing inconsistent spacing

* INTMDB-397: oplogMinRetentionHours + NVMe Cluster Class Warning Doc Update (#1016)

* Chore(deps): Bump github.com/gruntwork-io/terratest (#1013)

Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.7 to 0.41.9.
- [Release notes](https://github.com/gruntwork-io/terratest/releases)
- [Commits](gruntwork-io/terratest@v0.41.7...v0.41.9)

---
updated-dependencies:
- dependency-name: github.com/gruntwork-io/terratest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add support for oplog_min_retention_hours

* Update website/docs/r/advanced_cluster.html.markdown

* Update website/docs/r/cluster.html.markdown

* Update mongodbatlas/resource_mongodbatlas_cluster.go

Co-authored-by: Wojciech Trocki <[email protected]>

* Restructure suggested code

* restructure

* Allow zero for oplog_min_retention_hours

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zuhair Ahmed <[email protected]>
Co-authored-by: Wojciech Trocki <[email protected]>

* Update Changelog

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Edward Mallia <[email protected]>
Co-authored-by: Matt Thompson <[email protected]>
Co-authored-by: Wojciech Trocki <[email protected]>
  • Loading branch information
7 people authored Jan 23, 2023
1 parent 447c4fe commit b636fdb
Show file tree
Hide file tree
Showing 92 changed files with 4,915 additions and 376 deletions.
4 changes: 2 additions & 2 deletions .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
future-release=v1.7.0
since-tag=v1.6.1
future-release=v1.8.0
since-tag=v1.7.0
date-format=%B %d, %Y
base=CHANGELOG.md
47 changes: 46 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Changelog

## [v1.8.0](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.8.0) (2023-1-23)

[Full Changelog](https://github.com/mongodb/terraform-provider-mongodbatlas/compare/v1.7.0...v1.8.0)

**Enhancements:**

- Snapshot Distribution Support [\#979](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/979) - INTMDB-400
- Programmatically Create API Keys [\#974](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/974) - INTMDB-346
- Retrieve Org Id from API Keys [\#973](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/973) - INTMDB-454
- Analytics Node Tier New Features Support [\#994](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/994) - INTMDB-488
- Improve Default Alerts and Example Creation [\#993](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/993) - INTMDB-382
- oplogMinRetentionHours Paramter Support in advanced_cluster and cluster [\#1016](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1016) - INTMDB-397
- Expand documentation for mongodbatlas_cloud_backup_schedule to include information about valid values for frequency_interval [\#1007](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1007) - INTMDB-547

**Depreciations:**

- cloud_provider_snapshot, cloud_provider_snapshot_backup_policy, cloud_provider_snapshot_restore_job, and private_ip_mode are now deprecated and will be removed from codebase as of v1.9 release [\#988](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/988) - INTMDB-409
- NEW_RELIC and FLOWDOCK mongodbatlas_third_party_integration resource are now deprecated and will be removed from codebase as of v1.9 release [\#989](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/989) - INTMDB-482

**Bug Fixes:**

- Hide current_certificate when X.509 Authentication Database Users are Created [\#985](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/985) - INTMDB-468
- Import example added for encryption_at_rest resource [\#992](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/992) - INTMDB-530
- Resource cloud_backup_snapshot_export_job variable name change [\#976](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/976) - INTMDB-523
- Invitation handling after user accepts invitation fix [\#1012](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1012) - INTMDB-511
- Update_snapshots doesn't save at TF state with mongodbatlas_cloud_backup_schedule resource fix [\#974](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/974) - INTMDB-472
- bi_connector settings in mongodbatlas_advanced_cluster fix (breaking changes) [\#1010](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1010) - INTMDB-455
- mongodbatlas_third_party_integration api_token keeps updating on every apply fix [\#1011](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1011) - INTMDB-519
- custom_db_role error fix [\#1009](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1009) - INTMDB-448
- LDAP Config and LDAP Verify Resources Fix [\#1004](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1004) - INTMDB-543
- Cloud backup schedule, export fix [\#968](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/968) - INTMDB-427
- resource_mongodbatlas_search_index_test fix [\#964](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/964) - INTMDB-341
- Cannot ignore changes for replication_specs when autoscaling enabled fix [\#961](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/961) - INTMDB-464
- BI Connector documentation fix [\#1017](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1017)
- federated_settings_org_config import example fix [\#996](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/996)

**Closed Issues:**
- Documentation: Expand documentation for mongodbatlas\_cloud\_backup\_schedule to include information about valid values for frequency\_interval [\#1005](https://github.com/mongodb/terraform-provider-mongodbatlas/issues/1005)
- Serverless instance returns incorrect connection string [\#934](https://github.com/mongodb/terraform-provider-mongodbatlas/issues/934)
- Terraform apply failed with Error: Provider produced inconsistent final plan This is a bug in the provider, which should be reported in the provider's own issue tracker. [\#926](https://github.com/mongodb/terraform-provider-mongodbatlas/issues/926)

**Merged Pull Requests:**

- Chore\(deps\): Bump github.com/gruntwork-io/terratest from 0.41.7 to 0.41.9 [\#1013](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1013) ([dependabot[bot]](https://github.com/apps/dependabot))

## [v1.7.0](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.7.0) (2022-12-23)

[Full Changelog](https://github.com/mongodb/terraform-provider-mongodbatlas/compare/v1.6.1...v1.7.0)
Expand Down Expand Up @@ -134,7 +179,7 @@

[Full Changelog](https://github.com/mongodb/terraform-provider-mongodbatlas/compare/v1.4.5...v1.4.6)

**Fixed**
**Enhancements and Bug Fixes:**
- INTMDB-387 - Enable Azure NVME for Atlas Dedicated clusters [\#833](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/833)
- INTMDB-342 - Update TestAccDataSourceMongoDBAtlasPrivateEndpointRegionalMode_basic test to use a new project to prevent conflicts [\#837](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/837)
- INTMDB-347 - Cloud_backup is not being correctly imported - issue [\#768](https://github.com/mongodb/terraform-provider-mongodbatlas/issues/768)
Expand Down
2 changes: 2 additions & 0 deletions examples/atlas-alert-configurations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sh
alert-configurations.tf
32 changes: 32 additions & 0 deletions examples/atlas-alert-configurations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Using the data source
Example exists in `alert-configurations-data.tf`. To use this example exactly:
- Copy directory to local disk
- Add a `terraform.tfvars`
- Add your `project_id`
- Run `terraform apply`

### Create alert resources and import them into state file
```
terraform output -raw alert_imports > import-alerts.sh
terraform output -raw alert_resources > alert-configurations.tf
chmod +x ./import-alerts.sh
./import-alerts.sh
terraform apply
```

## Contingency Plans
If unhappy with the resource file or imports, here are some things that can be done:

### Remove targeted resources from the appropriate files and remove the alet_configuration from state
- Manually remove the resource (ex: `mongodbatlas_alert_configuration.CLUSTER_MONGOS_IS_MISSING_2`) from the `tf` file, and then remove it from state, ex:
```
terraform state rm mongodbatlas_alert_configuration.CLUSTER_MONGOS_IS_MISSING_2
```

### Remove all alert_configurations from state
- Delete the `tf` file that was used for import, and then:
```
terraform state list | grep ^mongodbatlas_alert_configuration. | awk '{print "terraform state rm " $1}' > state-rm-alerts.sh
chmod +x state-rm-alerts.sh
./state-rm-alerts.sh
```
29 changes: 29 additions & 0 deletions examples/atlas-alert-configurations/alert-configurations-data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
data "mongodbatlas_alert_configurations" "import" {
project_id = var.project_id

output_type = ["resource_hcl", "resource_import"]
}

locals {
alerts = data.mongodbatlas_alert_configurations.import.results

alert_resources = compact([
for i, alert in local.alerts :
alert.output == null ? null :
length(alert.output) < 1 == null ? null : alert.output[0].value
])

alert_imports = compact([
for i, alert in local.alerts :
alert.output == null ? null :
length(alert.output) < 2 == null ? null : alert.output[1].value
])
}

output "alert_resources" {
value = join("\n", local.alert_resources)
}

output "alert_imports" {
value = join("", local.alert_imports)
}
4 changes: 4 additions & 0 deletions examples/atlas-alert-configurations/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
provider "mongodbatlas" {
public_key = var.public_key
private_key = var.private_key
}
10 changes: 10 additions & 0 deletions examples/atlas-alert-configurations/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variable "public_key" {
description = "Public API key to authenticate to Atlas"
}
variable "private_key" {
description = "Private API key to authenticate to Atlas"
}
variable "project_id" {
description = "Atlas project name"
default = ""
}
8 changes: 8 additions & 0 deletions examples/atlas-alert-configurations/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
}
}
required_version = ">= 0.13"
}
17 changes: 9 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ require (
github.com/mwielbut/pointy v1.1.0
github.com/spf13/cast v1.5.0
github.com/terraform-providers/terraform-provider-aws v1.60.1-0.20210625132053-af2d5c0ad54f
go.mongodb.org/atlas v0.19.0
go.mongodb.org/atlas v0.21.0
go.mongodb.org/realm v0.1.0
golang.org/x/exp v0.0.0-20221208152030-732eee02a75a
)

require (
Expand Down Expand Up @@ -111,16 +112,16 @@ require (
github.com/vmihailenco/tagparser v0.1.1 // indirect
github.com/zclconf/go-cty v1.12.1 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/mod v0.6.0 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/tools v0.1.3 // indirect
golang.org/x/tools v0.2.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.48.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
20 changes: 18 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,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-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k=
go.mongodb.org/atlas v0.12.0/go.mod h1:wVCnHcm/7/IfTjEB6K8K35PLG70yGz8BdkRwX0oK9/M=
go.mongodb.org/atlas v0.19.0 h1:gvezG9d0KsSDaExEdTtcGqZHRvvVazzuEcBUpBXxmlg=
go.mongodb.org/atlas v0.19.0/go.mod h1:PFk1IGhiGjFXHGVspOK7i1U2nnPjK8wAjYwQf6FoVf4=
go.mongodb.org/atlas v0.21.0 h1:7Wi8Yy3hJGAyMvb8vZZjoYaQ89l58GCmIx5ppxtrrqc=
go.mongodb.org/atlas v0.21.0/go.mod h1:XTjsxWgoOSwaZrQUvhTEuwjymxnF0r12RPibZuW1Uts=
go.mongodb.org/realm v0.1.0 h1:zJiXyLaZrznQ+Pz947ziSrDKUep39DO4SfA0Fzx8M4M=
go.mongodb.org/realm v0.1.0/go.mod h1:4Vj6iy+Puo1TDERcoh4XZ+pjtwbOzPpzqy3Cwe8ZmDM=
go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o=
Expand Down Expand Up @@ -963,6 +963,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0=
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand All @@ -974,6 +976,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
golang.org/x/exp v0.0.0-20221208152030-732eee02a75a h1:4iLhBPcpqFmylhnkbY3W0ONLUYYkDAW9xMFLfxgsvCw=
golang.org/x/exp v0.0.0-20221208152030-732eee02a75a/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down Expand Up @@ -1001,6 +1005,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I=
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -1057,6 +1063,8 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1164,9 +1172,13 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e h1:w36l2Uw3dRan1K3TyXriXvY+6T56GNmlKGcqiQUJDfM=
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1177,6 +1189,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -1283,6 +1297,8 @@ golang.org/x/tools v0.1.2-0.20210512205948-8287d5da45e4/go.mod h1:o0xws9oXOQQZyj
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
89 changes: 89 additions & 0 deletions mongodbatlas/data_source_mongodbatlas_accesslist_api_key.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package mongodbatlas

import (
"context"
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)

func dataSourceMongoDBAtlasAccessListAPIKey() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceMongoDBAtlasAccessListAPIKeyRead,
Schema: map[string]*schema.Schema{
"org_id": {
Type: schema.TypeString,
Required: true,
},
"api_key_id": {
Type: schema.TypeString,
Required: true,
},
"ip_address": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.IsIPAddress,
},
"cidr_block": {
Type: schema.TypeString,
Computed: true,
},
"created": {
Type: schema.TypeString,
Computed: true,
},
"access_count": {
Type: schema.TypeInt,
Computed: true,
},
"last_used": {
Type: schema.TypeString,
Computed: true,
},
"last_used_address": {
Type: schema.TypeString,
Computed: true,
},
},
}
}

func dataSourceMongoDBAtlasAccessListAPIKeyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
// Get client connection.
conn := meta.(*MongoDBClient).Atlas

orgID := d.Get("org_id").(string)
apiKeyID := d.Get("api_key_id").(string)
ipAddress := d.Get("ip_address").(string)
accessListAPIKey, _, err := conn.AccessListAPIKeys.Get(ctx, orgID, apiKeyID, ipAddress)
if err != nil {
return diag.FromErr(fmt.Errorf("error getting access list api key information: %s", err))
}

if err := d.Set("cidr_block", accessListAPIKey.CidrBlock); err != nil {
return diag.FromErr(fmt.Errorf("error setting `cidr_block`: %s", err))
}

if err := d.Set("last_used_address", accessListAPIKey.LastUsedAddress); err != nil {
return diag.FromErr(fmt.Errorf("error setting `last_used_address`: %s", err))
}

if err := d.Set("last_used", accessListAPIKey.LastUsed); err != nil {
return diag.FromErr(fmt.Errorf("error setting `last_used`: %s", err))
}

if err := d.Set("created", accessListAPIKey.Created); err != nil {
return diag.FromErr(fmt.Errorf("error setting `created`: %s", err))
}

if err := d.Set("access_count", accessListAPIKey.Count); err != nil {
return diag.FromErr(fmt.Errorf("error setting `access_count`: %s", err))
}

d.SetId(resource.UniqueId())

return nil
}
Loading

0 comments on commit b636fdb

Please sign in to comment.