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

resource/aws_ssm_maintenance_window_task: Prevent ValidationException error on update when priority is not set or 0 #17885

Merged
merged 3 commits into from
Mar 4, 2021

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Mar 2, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #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)

… 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)
```
@bflad bflad added the bug Addresses a defect in current functionality. label Mar 2, 2021
@bflad bflad requested a review from a team as a code owner March 2, 2021 17:05
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/ssm Issues and PRs that pertain to the ssm service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Mar 2, 2021
Copy link
Member

@breathingdust breathingdust left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 🚀

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (20.09s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (21.43s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (22.38s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (22.81s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (35.46s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_Description (35.99s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (37.79s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (38.46s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (40.73s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (41.01s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (48.84s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (15.51s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (15.64s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (15.66s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (15.67s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_Description (27.73s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (27.98s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (28.54s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (31.33s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (31.62s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (31.79s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (34.95s)

@bflad bflad merged commit 9458ef9 into main Mar 4, 2021
@bflad bflad deleted the b-aws_ssm_maintenance_window_task-priority-null branch March 4, 2021 19:33
@github-actions github-actions bot added this to the v3.31.0 milestone Mar 4, 2021
github-actions bot pushed a commit that referenced this pull request Mar 4, 2021
@ghost
Copy link

ghost commented Mar 5, 2021

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!

@ghost
Copy link

ghost commented Apr 4, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ssm Issues and PRs that pertain to the ssm service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants