diff --git a/aws/resource_aws_ssm_maintenance_window_task_test.go b/aws/resource_aws_ssm_maintenance_window_task_test.go index c3532bc19f2..1197f02a50e 100644 --- a/aws/resource_aws_ssm_maintenance_window_task_test.go +++ b/aws/resource_aws_ssm_maintenance_window_task_test.go @@ -156,7 +156,7 @@ func TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters(t *testin func TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters(t *testing.T) { var task ssm.MaintenanceWindowTask resourceName := "aws_ssm_maintenance_window_task.target" - serviceRoleResourceName := "aws_iam_role.ssm_role" + serviceRoleResourceName := "aws_iam_role.test" s3BucketResourceName := "aws_s3_bucket.foo" name := acctest.RandString(10) @@ -312,66 +312,44 @@ func testAccAWSSSMMaintenanceWindowTaskImportStateIdFunc(resourceName string) re } } -func testAccAWSSSMMaintenanceWindowTaskBasicConfig(rName string) string { +func testAccAWSSSMMaintenanceWindowTaskConfigBase(rName string) string { return fmt.Sprintf(` -resource "aws_ssm_maintenance_window" "foo" { - name = "maintenance-window-%[1]s" - schedule = "cron(0 16 ? * TUE *)" - duration = 3 +resource "aws_ssm_maintenance_window" "test" { cutoff = 1 + duration = 3 + name = %[1]q + schedule = "cron(0 16 ? * TUE *)" } -resource "aws_ssm_maintenance_window_task" "target" { - window_id = "${aws_ssm_maintenance_window.foo.id}" - task_type = "RUN_COMMAND" - task_arn = "AWS-RunShellScript" - priority = 1 - service_role_arn = "${aws_iam_role.ssm_role.arn}" - max_concurrency = "2" - max_errors = "1" - - targets { - key = "InstanceIds" - values = ["${aws_instance.foo.id}"] - } - - task_parameters { - name = "commands" - values = ["pwd"] - } -} - -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-4fccb37f" instance_type = "m1.small" } -resource "aws_iam_role" "ssm_role" { - name = "ssm-role-%[1]s" - +resource "aws_iam_role" "test" { + name = %[1]q assume_role_policy = <