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

fix: INTMDB-1017 - Updated alert configuration schema with required params #1421

Merged

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Aug 28, 2023

Description

This PR updates the alert config fields in MetricThreshold and Matcher to be required
Follow up PR on CLOUDP-197223: add required param to open api doc for required fields in MetricThreshold and Matcher](https://github.com/10gen/mms/pull/80991).

Error:

╷
│ Error: error creating Alert Configuration information: %s
│
│   with mongodbatlas_alert_configuration.default,
│   on main.tf line 587, in resource "mongodbatlas_alert_configuration" "default":
│  587: resource "mongodbatlas_alert_configuration" "default" {
│
│ POST https://cloud-dev.mongodb.com/api/atlas/v1.0/groups/64ec69f04c5f4423e05af8b3/alertConfigs: 400 (request "MISSING_ATTRIBUTE") The required attribute fieldName was not specified.

Link to any related issue(s):

Type of change:

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

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the 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

These params are now required in the schema:

 Error: Missing Configuration for Required Attribute
│
│   with mongodbatlas_alert_configuration.default,
│   on main.tf line 603, in resource "mongodbatlas_alert_configuration" "default":
│  603:     field_name = null
│
│ Must set a configuration value for the matcher[0].field_name attribute as the provider has marked it as required.
│
│ Refer to the provider documentation or contact the provider developers for additional information about configurable attributes that are required.
╵
╷
│ Error: Missing Configuration for Required Attribute
│
│   with mongodbatlas_alert_configuration.default,
│   on main.tf line 604, in resource "mongodbatlas_alert_configuration" "default":
│  604:     operator   = null
│
│ Must set a configuration value for the matcher[0].operator attribute as the provider has marked it as required.
│
│ Refer to the provider documentation or contact the provider developers for additional information about configurable attributes that are required.
╵
╷
│ Error: Missing Configuration for Required Attribute
│
│   with mongodbatlas_alert_configuration.default,
│   on main.tf line 605, in resource "mongodbatlas_alert_configuration" "default":
│  605:     value      = null
│
│ Must set a configuration value for the matcher[0].value attribute as the provider has marked it as required.
│
│ Refer to the provider documentation or contact the provider developers for additional information about configurable attributes that are required.
╵
╷
│ Error: Missing Configuration for Required Attribute
│
│   with mongodbatlas_alert_configuration.default,
│   on main.tf line 610, in resource "mongodbatlas_alert_configuration" "default":
│  610:     metric_name = null
│
│ Must set a configuration value for the metric_threshold_config[0].metric_name attribute as the provider has marked it as required.
│
│ Refer to the provider documentation or contact the provider developers for additional information about configurable attributes that are required.

@andreaangiolillo andreaangiolillo marked this pull request as ready for review August 28, 2023 15:40
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner August 28, 2023 15:40
@AgustinBettati
Copy link
Member

AgustinBettati commented Aug 28, 2023

Would make sure to update documentation if it does not reflect the updated schema already

@andreaangiolillo
Copy link
Collaborator Author

@AgustinBettati updated doc. Thanks for the reminder 💯

@AgustinBettati
Copy link
Member

Thanks for addressing! Is it possible that notification.type_name still needs doc adjustment?

@andreaangiolillo
Copy link
Collaborator Author

@AgustinBettati yep, updated

Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

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

LGTM!

@andreaangiolillo andreaangiolillo merged commit f44531b into CLOUDP-189585-plugin-framework-migration Aug 28, 2023
@andreaangiolillo andreaangiolillo deleted the INTMDB-1017_1_12_0 branch August 28, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants