github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/website/source/docs/providers/aws/r/ssm_maintenance_window_task.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_ssm_maintenance_window_task" 4 sidebar_current: "docs-aws-resource-ssm-maintenance-window-task" 5 description: |- 6 Provides an SSM Maintenance Window Task resource 7 --- 8 9 # aws_ssm_maintenance_window_task 10 11 Provides an SSM Maintenance Window Task resource 12 13 ## Example Usage 14 15 ```hcl 16 resource "aws_ssm_maintenance_window" "window" { 17 name = "maintenance-window-%s" 18 schedule = "cron(0 16 ? * TUE *)" 19 duration = 3 20 cutoff = 1 21 } 22 23 resource "aws_ssm_maintenance_window_task" "task" { 24 window_id = "${aws_ssm_maintenance_window.window.id}" 25 task_type = "RUN_COMMAND" 26 task_arn = "AWS-RunShellScript" 27 priority = 1 28 service_role_arn = "arn:aws:iam::187416307283:role/service-role/AWS_Events_Invoke_Run_Command_112316643" 29 max_concurrency = "2" 30 max_errors = "1" 31 targets { 32 key = "InstanceIds" 33 values = ["${aws_instance.instance.id}"] 34 } 35 task_parameters { 36 name = "commands" 37 values = ["pwd"] 38 } 39 } 40 41 resource "aws_instance" "instance" { 42 ami = "ami-4fccb37f" 43 44 instance_type = "m1.small" 45 } 46 ``` 47 48 ## Argument Reference 49 50 The following arguments are supported: 51 52 * `window_id` - (Required) The Id of the maintenance window to register the task with. 53 * `max_concurrency` - (Required) The maximum number of targets this task can be run for in parallel. 54 * `max_errors` - (Required) The maximum number of errors allowed before this task stops being scheduled. 55 * `task_type` - (Required) The type of task being registered. The only allowed value is `RUN_COMMAND`. 56 * `task_arn` - (Required) The ARN of the task to execute. 57 * `service_role_arn` - (Required) The role that should be assumed when executing the task. 58 * `targets` - (Required) The targets (either instances or window target ids). Instances are specified using Key=InstanceIds,Values=instanceid1,instanceid2. Window target ids are specified using Key=WindowTargetIds,Values=window target id1, window target id2. 59 * `priority` - (Optional) The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel. 60 * `logging_info` - (Optional) A structure containing information about an Amazon S3 bucket to write instance-level logs to. Documented below. 61 * `task_parameters` - (Optional) A structure containing information about parameters required by the particular `task_arn`. Documented below. 62 63 `logging_info` supports the following: 64 65 * `s3_bucket_name` - (Required) 66 * `s3_region` - (Required) 67 * `s3_bucket_prefix` - (Optional) 68 69 `task_parameters` supports the following: 70 71 * `name` - (Required) 72 * `values` - (Required) 73 74 ## Attributes Reference 75 76 The following attributes are exported: 77 78 * `id` - The ID of the maintenance window task.