Skip to content

Commit

Permalink
resource/aws_ssm_maintenance_window_task: Mark service_role_arn as Co…
Browse files Browse the repository at this point in the history
…mputed, add CHANGELOG for #12200

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (21.36s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (22.49s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (23.79s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (25.18s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (37.93s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (38.21s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (46.55s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (48.17s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (48.58s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (49.26s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSSSMMaintenanceWindowTask_noRole (26.04s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_disappears (26.62s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig (27.01s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters (29.35s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource (43.07s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_basic (43.41s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters (46.46s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters (51.63s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters (51.98s)
--- PASS: TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudWatch (59.12s)
```
  • Loading branch information
bflad committed Feb 12, 2021
1 parent 72cf9cc commit e7b9b5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .changelog/12200.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_ssm_maintenance_window_task: Make `service_role_arn` optional
```
1 change: 1 addition & 0 deletions aws/resource_aws_ssm_maintenance_window_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func resourceAwsSsmMaintenanceWindowTask() *schema.Resource {
"service_role_arn": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validateArn,
},

Expand Down
17 changes: 8 additions & 9 deletions aws/resource_aws_ssm_maintenance_window_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func TestAccAWSSSMMaintenanceWindowTask_noRole(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSSMMaintenanceWindowTaskExists(resourceName, &task),
),
ExpectNonEmptyPlan: true,
},
},
})
Expand Down Expand Up @@ -649,16 +648,16 @@ resource "aws_ssm_maintenance_window_task" "test" {
}

func testAccAWSSSMMaintenanceWindowTaskNoRoleConfig(rName string) string {
return fmt.Sprintf(testAccAWSSSMMaintenanceWindowTaskConfigBase(rName)+`
return fmt.Sprintf(testAccAWSSSMMaintenanceWindowTaskConfigBase(rName) + `
resource "aws_ssm_maintenance_window_task" "test" {
window_id = aws_ssm_maintenance_window.test.id
task_type = "RUN_COMMAND"
task_arn = "AWS-RunShellScript"
priority = 1
max_concurrency = "2"
max_errors = "1"
description = "This resource is for test purpose only"
max_concurrency = 2
max_errors = 1
name = "TestMaintenanceWindowTask"
description = "This resource is for test purpose only"
priority = 1
task_arn = "AWS-RunShellScript"
task_type = "RUN_COMMAND"
window_id = aws_ssm_maintenance_window.test.id
targets {
key = "WindowTargetIds"
Expand Down

0 comments on commit e7b9b5d

Please sign in to comment.