# MaintenanceWindowRunCommandParametersProperty

The `MaintenanceWindowRunCommandParameters` property type specifies the parameters for a `RUN_COMMAND` task type for a maintenance window task in AWS Systems Manager .

This means that these parameters are the same as those for the `SendCommand` API call. For more information about `SendCommand` parameters, see [SendCommand](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_SendCommand.html) in the *AWS Systems Manager API Reference* .

For information about available parameters in SSM Command documents, you can view the content of the document itself in the Systems Manager console. For information, see [Viewing SSM command document content](https://docs.aws.amazon.com/systems-manager/latest/userguide/viewing-ssm-document-content.html) in the *AWS Systems Manager User Guide* .

`MaintenanceWindowRunCommandParameters` is a property of the [TaskInvocationParameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-maintenancewindowtask-taskinvocationparameters.html) property type.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ssm as ssm } from 'aws-cdk-lib';

declare const parameters: any;
const maintenanceWindowRunCommandParametersProperty: ssm.CfnMaintenanceWindowTask.MaintenanceWindowRunCommandParametersProperty = {
  cloudWatchOutputConfig: {
    cloudWatchLogGroupName: 'cloudWatchLogGroupName',
    cloudWatchOutputEnabled: false,
  },
  comment: 'comment',
  documentHash: 'documentHash',
  documentHashType: 'documentHashType',
  documentVersion: 'documentVersion',
  notificationConfig: {
    notificationArn: 'notificationArn',

    // the properties below are optional
    notificationEvents: ['notificationEvents'],
    notificationType: 'notificationType',
  },
  outputS3BucketName: 'outputS3BucketName',
  outputS3KeyPrefix: 'outputS3KeyPrefix',
  parameters: parameters,
  serviceRoleArn: 'serviceRoleArn',
  timeoutSeconds: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ssm as ssm

# parameters: Any

maintenance_window_run_command_parameters_property = ssm.CfnMaintenanceWindowTask.MaintenanceWindowRunCommandParametersProperty(
    cloud_watch_output_config=ssm.CfnMaintenanceWindowTask.CloudWatchOutputConfigProperty(
        cloud_watch_log_group_name="cloudWatchLogGroupName",
        cloud_watch_output_enabled=False
    ),
    comment="comment",
    document_hash="documentHash",
    document_hash_type="documentHashType",
    document_version="documentVersion",
    notification_config=ssm.CfnMaintenanceWindowTask.NotificationConfigProperty(
        notification_arn="notificationArn",

        # the properties below are optional
        notification_events=["notificationEvents"],
        notification_type="notificationType"
    ),
    output_s3_bucket_name="outputS3BucketName",
    output_s3_key_prefix="outputS3KeyPrefix",
    parameters=parameters,
    service_role_arn="serviceRoleArn",
    timeout_seconds=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ssm.*;

Object parameters;

MaintenanceWindowRunCommandParametersProperty maintenanceWindowRunCommandParametersProperty = MaintenanceWindowRunCommandParametersProperty.builder()
        .cloudWatchOutputConfig(CloudWatchOutputConfigProperty.builder()
                .cloudWatchLogGroupName("cloudWatchLogGroupName")
                .cloudWatchOutputEnabled(false)
                .build())
        .comment("comment")
        .documentHash("documentHash")
        .documentHashType("documentHashType")
        .documentVersion("documentVersion")
        .notificationConfig(NotificationConfigProperty.builder()
                .notificationArn("notificationArn")

                // the properties below are optional
                .notificationEvents(List.of("notificationEvents"))
                .notificationType("notificationType")
                .build())
        .outputS3BucketName("outputS3BucketName")
        .outputS3KeyPrefix("outputS3KeyPrefix")
        .parameters(parameters)
        .serviceRoleArn("serviceRoleArn")
        .timeoutSeconds(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SSM;

var parameters;

var maintenanceWindowRunCommandParametersProperty = new MaintenanceWindowRunCommandParametersProperty {
    CloudWatchOutputConfig = new CloudWatchOutputConfigProperty {
        CloudWatchLogGroupName = "cloudWatchLogGroupName",
        CloudWatchOutputEnabled = false
    },
    Comment = "comment",
    DocumentHash = "documentHash",
    DocumentHashType = "documentHashType",
    DocumentVersion = "documentVersion",
    NotificationConfig = new NotificationConfigProperty {
        NotificationArn = "notificationArn",

        // the properties below are optional
        NotificationEvents = new [] { "notificationEvents" },
        NotificationType = "notificationType"
    },
    OutputS3BucketName = "outputS3BucketName",
    OutputS3KeyPrefix = "outputS3KeyPrefix",
    Parameters = parameters,
    ServiceRoleArn = "serviceRoleArn",
    TimeoutSeconds = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var parameters interface{}

maintenanceWindowRunCommandParametersProperty := &MaintenanceWindowRunCommandParametersProperty{
	CloudWatchOutputConfig: &CloudWatchOutputConfigProperty{
		CloudWatchLogGroupName: jsii.String("cloudWatchLogGroupName"),
		CloudWatchOutputEnabled: jsii.Boolean(false),
	},
	Comment: jsii.String("comment"),
	DocumentHash: jsii.String("documentHash"),
	DocumentHashType: jsii.String("documentHashType"),
	DocumentVersion: jsii.String("documentVersion"),
	NotificationConfig: &NotificationConfigProperty{
		NotificationArn: jsii.String("notificationArn"),

		// the properties below are optional
		NotificationEvents: []*string{
			jsii.String("notificationEvents"),
		},
		NotificationType: jsii.String("notificationType"),
	},
	OutputS3BucketName: jsii.String("outputS3BucketName"),
	OutputS3KeyPrefix: jsii.String("outputS3KeyPrefix"),
	Parameters: parameters,
	ServiceRoleArn: jsii.String("serviceRoleArn"),
	TimeoutSeconds: jsii.Number(123),
}
```

## Properties

- `cloudWatchOutputConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMaintenanceWindowTask.CloudWatchOutputConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.CfnMaintenanceWindowTask.CloudWatchOutputConfigProperty.html) — Configuration options for sending command output to Amazon CloudWatch Logs.

- `comment`: string — Information about the command or commands to run.

- `documentHash`: string — The SHA-256 or SHA-1 hash created by the system when the document was created.

  SHA-1 hashes have been deprecated.

- `documentHashType`: string — The SHA-256 or SHA-1 hash type.

  SHA-1 hashes are deprecated.

- `documentVersion`: string — The AWS Systems Manager document (SSM document) version to use in the request.

  You can specify `$DEFAULT` , `$LATEST` , or a specific version number. If you run commands by using the AWS CLI, then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

  `--document-version "\$DEFAULT"`

  `--document-version "\$LATEST"`

  `--document-version "3"`

- `notificationConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMaintenanceWindowTask.NotificationConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.CfnMaintenanceWindowTask.NotificationConfigProperty.html) — Configurations for sending notifications about command status changes on a per-managed node basis.

- `outputS3BucketName`: string — The name of the Amazon Simple Storage Service (Amazon S3) bucket.

- `outputS3KeyPrefix`: string — The S3 bucket subfolder.

- `parameters`: any — The parameters for the `RUN_COMMAND` task execution.

  The supported parameters are the same as those for the `SendCommand` API call. For more information, see [SendCommand](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_SendCommand.html) in the *AWS Systems Manager API Reference* .

- `serviceRoleArn`: string — The Amazon Resource Name (ARN) of the IAM service role for AWS Systems Manager to assume when running a maintenance window task.

  If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run `RegisterTaskWithMaintenanceWindow` .

  However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see [Setting up Maintenance Windows](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html) in the in the *AWS Systems Manager User Guide* .

- `timeoutSeconds`: number — If this time is reached and the command hasn't already started running, it doesn't run.
