-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
changing an aws_ssm_maintenance_window_task that has priority 0 results in a "Member must not be null" priority constraint error from the API #17871
Comments
… error on update when priority is not set or 0 Reference: #17871 Priority is optional, but it is currently configured in every test configuration which is why this was not found before. To minimize the changes to verify this bug and timebox effort as part of triage, submitting one preferred style test that covers the behavior. Previously: ``` === CONT TestAccAWSSSMMaintenanceWindowTask_Description resource_aws_ssm_maintenance_window_task_test.go:114: Step 3/3 error: Error running apply: exit status 1 Error: Error updating Maintenance Window (mw-02f66f1bc3df08b83) Task (4c1a1e3e-c449-4e2d-882c-5f8a23a2104d): ValidationException: Value null at 'Priority' failed to satisfy constraint: Member must not be null status code: 400, request id: fc15f736-7e53-49bb-8d5d-11f35ba98a30 on terraform_plugin_test.tf line 58, in resource "aws_ssm_maintenance_window_task" "test": 58: resource "aws_ssm_maintenance_window_task" "test" { --- FAIL: TestAccAWSSSMMaintenanceWindowTask_Description (22.29s) ``` Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (36.64s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_Description (36.65s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (20.12s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (21.04s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (21.13s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (49.73s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (39.99s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (50.76s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (53.64s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (23.05s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (36.64s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (48.68s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_Description (45.57s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (28.64s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (28.72s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (28.97s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (52.58s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (49.44s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (54.30s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (60.93s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (31.03s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (46.25s) ```
Hi @tzvifriedman 👋 Thank you for submitting this and sorry you ran into trouble here. This is a small bug in the resource, which can be fixed up with this change: #17885 |
I had a hunch that validation was the issue, but I do not have the Go knowledge to confirm. Thanks for the quick turnaround! |
… error on update when priority is not set or 0 (#17885) Reference: #17871 Priority is optional, but it is currently configured in every test configuration which is why this was not found before. To minimize the changes to verify this bug and timebox effort as part of triage, submitting one preferred style test that covers the behavior. Previously: ``` === CONT TestAccAWSSSMMaintenanceWindowTask_Description resource_aws_ssm_maintenance_window_task_test.go:114: Step 3/3 error: Error running apply: exit status 1 Error: Error updating Maintenance Window (mw-02f66f1bc3df08b83) Task (4c1a1e3e-c449-4e2d-882c-5f8a23a2104d): ValidationException: Value null at 'Priority' failed to satisfy constraint: Member must not be null status code: 400, request id: fc15f736-7e53-49bb-8d5d-11f35ba98a30 on terraform_plugin_test.tf line 58, in resource "aws_ssm_maintenance_window_task" "test": 58: resource "aws_ssm_maintenance_window_task" "test" { --- FAIL: TestAccAWSSSMMaintenanceWindowTask_Description (22.29s) ``` Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (36.64s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_Description (36.65s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (20.12s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (21.04s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (21.13s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (49.73s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (39.99s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (50.76s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (53.64s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (23.05s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (36.64s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (48.68s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_Description (45.57s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (28.64s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (28.72s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (28.97s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (52.58s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (49.44s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (54.30s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (60.93s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (31.03s) --- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (46.25s) ```
This has been released in version 3.31.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v0.13.4
AWS provider 3.23
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
�Terraform v0.13.4
Initializing plugins and modules...
module.default_mx.aws_ssm_maintenance_window_task.datadog_mute[0]: Modifying... [id=7ee87613-fafe-42cf-90b9-21e46b7f569a]
Error: Error updating Maintenance Window (mw-0206570beb23779d2) Task (7ee87613-fafe-42cf-90b9-21e46b7f569a): ValidationException: Value null at 'Priority' failed to satisfy constraint: Member must not be null
status code: 400, request id: 6a6385ca-410f-47e2-a9c9-6663afac6208
on ../../../base/mx_window/main.tf line 119, in resource "aws_ssm_maintenance_window_task" "datadog_mute":
119: resource "aws_ssm_maintenance_window_task" "datadog_mute" {
I don't actually have access to the full debug logs at this point, since I'm on TFE and I'm not sure how to get access to the full debug log...
Panic Output
Expected Behavior
I'm just changing the contents of the script commands, and the plan is successful. It is supposed to change the commands and it lists the priority as 0.
Actual Behavior
The apply should change the commands and leave the priority as 0. Instead, on apply, the API seems to think that value is actually null.
I have three tasks in this MX Window, and I can actually bypass this issue by setting the priorities to 1, 2, and 3; obviously this is not ideal. There's something about the 0 that is making AWS think it's trying to pass null.
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: