Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTMDB-373: Add new notification parameters to the mongodbatlas_alert_config resource #877

Merged
merged 5 commits into from
Oct 26, 2022

Conversation

martinstibbe
Copy link
Contributor

@martinstibbe martinstibbe commented Oct 19, 2022

Description

[Terraform] Add new notification parameters to the mongodbatlas_alert_config resource

Link to any related issue(s):
#827

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the Terraform contribution guidelines
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

go.mod Outdated
@@ -11,7 +11,7 @@ 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.16.1-0.20220823081124-819fb5448bfe
go.mongodb.org/atlas v0.16.1-0.20220922005646-8a86dd63e243
Copy link
Collaborator

Choose a reason for hiding this comment

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

[q] are there any reasons why you are not using v0.18.0 ?

Copy link
Contributor Author

@martinstibbe martinstibbe Oct 25, 2022

Choose a reason for hiding this comment

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

@andreaangiolillo I need a PR merged to master that adds MicrosoftTeamsWebhookURL, WebhookSecret ,WebhookURL to Notification structure mongodb/go-client-mongodb-atlas#320

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Collaborator

@themantissa themantissa left a comment

Choose a reason for hiding this comment

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

Just a few docs things. Thanks!


* `username` - Name of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Required for the `USER` notifications type.
* `victor_ops_api_key` - VictorOps API key. Required for the `VICTOR_OPS` notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
* `victor_ops_routing_key` - VictorOps routing key. Optional for the `VICTOR_OPS` notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
* `webhook_secret` - Authentication secret for the `WEBHOOK` notifications type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@martinstibbe is this going to be another potentially redacted value we need to tell users to ignore? Or does this still get returned as the actual secret? Also a minor change to make more inline w/ the docs (as you can have a webhook with no secret): https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#operation/createOneAlertConfigurationInOneProject

Suggested change
* `webhook_secret` - Authentication secret for the `WEBHOOK` notifications type.
* `webhook_secret` - Optional authentication secret for the `WEBHOOK` notifications type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated


* `username` - Name of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Required for the `USER` notifications type.
* `victor_ops_api_key` - VictorOps API key. Required for the `VICTOR_OPS` notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
* `victor_ops_routing_key` - VictorOps routing key. Optional for the `VICTOR_OPS` notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
* `webhook_secret` - Authentication secret for the `WEBHOOK` notifications type.
* `webhook_url` - Target URL for the `WEBHOOK` notifications type.
* `microsoft_teams_webhook_url` - Microsoft Teams channel incoming webhook URL. Required for the `MICROSOFT_TEAMS` notifications type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just adding a bit more of the info from https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#operation/createOneAlertConfigurationInOneProject. Especially that we remove if invalid as that would cause a Terraform change.

Suggested change
* `microsoft_teams_webhook_url` - Microsoft Teams channel incoming webhook URL. Required for the `MICROSOFT_TEAMS` notifications type.
* `microsoft_teams_webhook_url` - Microsoft Teams Webhook Uniform Resource Locator (URL) that MongoDB Cloud needs to send this notification via Microsoft Teams. Required if `type_name` is `MICROSOFT_TEAMS`. If the URL later becomes invalid, MongoDB Cloud sends an email to the project owners. If the key remains invalid, MongoDB Cloud removes it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@martinstibbe martinstibbe added the not_stale Not stale issue or PR label Oct 26, 2022
Copy link
Collaborator

@themantissa themantissa left a comment

Choose a reason for hiding this comment

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

LGTM!

@martinstibbe martinstibbe merged commit 21fc5f0 into release-staging-v1.5.0 Oct 26, 2022
@martinstibbe martinstibbe deleted the INTMDB-373 branch October 26, 2022 23:28
martinstibbe added a commit that referenced this pull request Nov 2, 2022
* INTMDB-405: [Terraform] Add cluster label to advanced clusters (#857)

* Update CHANGELOG.md (#849)

* INTMDB-405: Add default label if none supplied

* Add test for default label exising

* Flatten nested IF statement

* Relying on atlas api for unit validation on alert configuration (#862)

* INTMDB-334: privatelink endpoint service configurable timeout (#859)

* Made timeout for privatelink endpoint service configurable

* Updated context to be with timeout, added documentation on how the timeout works

* Updated documentation to have proper default timeout of 2h

* INTMDB-373: Add new notification parameters to the mongodbatlas_alert_config resource (#877)

* Add support for MS Teams SDK webhook

* make fmt

* Update documentation add Webhook

* Update docs

* Update to v0.18

* encryption_at_rest M10+ limit doc update (#886)

* INTMDB-224: [Terraform] Support AtlasGov with Terraform (#865)

* Add Gov variables workflow and test case

* Change test pre check to handle gov env variables

* Adjust env variable test validation

* Add provider parameter for Gov cloud and region_usage_restrictions to datasources

* Update project government test update docs

* INTMDB-370 -- PIT Restore Example (#870)

* INTMDB-369: Updated validation logic for cloud_backup_snapshot_restore_job (#813)

* Updated validation logic for cloud_backup_snapshot_restore_job

* Fixed lint errors

* Updated test-upgrade v110 to use pit restore

* Fixed var name in example for pit ts

* Updated v110 example to use cloud backup snapshot resource with pit and valid instructions

* Removed changes to v110 example and created a v146 example

* Fixed the v110 example to work with disk_size requirements and added link to new examples on the tf docs.

* Fixed documentation and moved example

* Moved example again, and fixed links in documentation

* Fixed formatting on example

* Fixed formatting to account for removal of disk size

* Correct example in test to use arrays and minGram parameter error (#891)

* INTMDB-378: Add link for How To Guide for existing container ID (#883)

* Add link for How To Guide for existing container ID

* Document corrections

* 3 remaining doc updates

* Update CHANGELOG.md

* Update CHANGELOG.md

* INTMDB-314 Cluster Tenant Upgrade (#874)

* Initial commit for cluster upgrade

* Updated to use a custom customizeDiff func

* Setting cluster_id and resource ID to the updated values in the case of a cluster upgrade

* Updated logic for determining whether upgrade is required

* Removed conflation on willUpgrade and tenant changes. Added error checking

* Updated cluster docs to denote upgrade support

* Added an example tenant upgrade

* Fixed formatting issues

* Added code to upgrade advanced_cluster

* Moved example again, for some reason

* Moved examples, got advanced-cluster tenantUpgrade working

* Fixed linter issues with advanced cluster

* removed unnecessary explicit setting of cluster_id

* Updated new examples to work with tf 0.13

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

Co-authored-by: Melissa Plunkett <[email protected]>

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

Co-authored-by: Melissa Plunkett <[email protected]>

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

Co-authored-by: Melissa Plunkett <[email protected]>

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

Co-authored-by: Melissa Plunkett <[email protected]>

* Addressed some criticisms of new tenant-upgrade examples

* Applied suggested docs changes for cluster tenant upgrade

* Apply suggestions from code review

Applied docs changes suggested for advanced-cluster tenant upgrade readme

Co-authored-by: Melissa Plunkett <[email protected]>

* Updated cluster tenant upgrade readme to match that of the advanced cluster

* Addressed last remaining README suggestions for new examples

* Fixed naming on variables and re-pausing cluster after upgrade if necessary

* Reduced nested ifs in cluster update

* No longer attempting to unpause tenant tier clusters prior to upgrade. Any updates fail

* Fixed linter error on bool init

Co-authored-by: Melissa Plunkett <[email protected]>

* Update CHANGELOG.md

Co-authored-by: martinstibbe <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>
Co-authored-by: Melissa Plunkett <[email protected]>
Zuhairahmed added a commit that referenced this pull request Nov 3, 2022
* INTMDB-405: [Terraform] Add cluster label to advanced clusters (#857)

* Update CHANGELOG.md (#849)

* INTMDB-405: Add default label if none supplied

* Add test for default label exising

* Flatten nested IF statement

* Relying on atlas api for unit validation on alert configuration (#862)

* INTMDB-334: privatelink endpoint service configurable timeout (#859)

* Made timeout for privatelink endpoint service configurable

* Updated context to be with timeout, added documentation on how the timeout works

* Updated documentation to have proper default timeout of 2h

* INTMDB-373: Add new notification parameters to the mongodbatlas_alert_config resource (#877)

* Add support for MS Teams SDK webhook

* make fmt

* Update documentation add Webhook

* Update docs

* Update to v0.18

* encryption_at_rest M10+ limit doc update (#886)

* INTMDB-224: [Terraform] Support AtlasGov with Terraform (#865)

* Add Gov variables workflow and test case

* Change test pre check to handle gov env variables

* Adjust env variable test validation

* Add provider parameter for Gov cloud and region_usage_restrictions to datasources

* Update project government test update docs

* INTMDB-370 -- PIT Restore Example (#870)

* INTMDB-369: Updated validation logic for cloud_backup_snapshot_restore_job (#813)

* Updated validation logic for cloud_backup_snapshot_restore_job

* Fixed lint errors

* Updated test-upgrade v110 to use pit restore

* Fixed var name in example for pit ts

* Updated v110 example to use cloud backup snapshot resource with pit and valid instructions

* Removed changes to v110 example and created a v146 example

* Fixed the v110 example to work with disk_size requirements and added link to new examples on the tf docs.

* Fixed documentation and moved example

* Moved example again, and fixed links in documentation

* Fixed formatting on example

* Fixed formatting to account for removal of disk size

* Correct example in test to use arrays and minGram parameter error (#891)

* INTMDB-378: Add link for How To Guide for existing container ID (#883)

* Add link for How To Guide for existing container ID

* Document corrections

* 3 remaining doc updates

* Update CHANGELOG.md

* Update CHANGELOG.md

* INTMDB-314 Cluster Tenant Upgrade (#874)

* Initial commit for cluster upgrade

* Updated to use a custom customizeDiff func

* Setting cluster_id and resource ID to the updated values in the case of a cluster upgrade

* Updated logic for determining whether upgrade is required

* Removed conflation on willUpgrade and tenant changes. Added error checking

* Updated cluster docs to denote upgrade support

* Added an example tenant upgrade

* Fixed formatting issues

* Added code to upgrade advanced_cluster

* Moved example again, for some reason

* Moved examples, got advanced-cluster tenantUpgrade working

* Fixed linter issues with advanced cluster

* removed unnecessary explicit setting of cluster_id

* Updated new examples to work with tf 0.13

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

Co-authored-by: Melissa Plunkett <[email protected]>

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

Co-authored-by: Melissa Plunkett <[email protected]>

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

Co-authored-by: Melissa Plunkett <[email protected]>

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

Co-authored-by: Melissa Plunkett <[email protected]>

* Addressed some criticisms of new tenant-upgrade examples

* Applied suggested docs changes for cluster tenant upgrade

* Apply suggestions from code review

Applied docs changes suggested for advanced-cluster tenant upgrade readme

Co-authored-by: Melissa Plunkett <[email protected]>

* Updated cluster tenant upgrade readme to match that of the advanced cluster

* Addressed last remaining README suggestions for new examples

* Fixed naming on variables and re-pausing cluster after upgrade if necessary

* Reduced nested ifs in cluster update

* No longer attempting to unpause tenant tier clusters prior to upgrade. Any updates fail

* Fixed linter error on bool init

Co-authored-by: Melissa Plunkett <[email protected]>

* Update CHANGELOG.md

* Add additional secret to workflow

* Fix failing cluster paused test (#900)

* Updated logic for when we pause a cluster

* Fixed typo on provider_instance_size_name

* Made logic on isUpgradeRequired a bit more concise

Co-authored-by: Dosty Everts <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>
Co-authored-by: Melissa Plunkett <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not_stale Not stale issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants