Skip to content
v2.274.0

CfnMaintenanceWindowTask L1 construct ​

The AWS::SSM::MaintenanceWindowTask resource defines information about a task for an AWS Systems Manager maintenance window.

For more information, see RegisterTaskWithMaintenanceWindow in the AWS Systems Manager API Reference .

Example ​

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;
declare const taskParameters: any;
const cfnMaintenanceWindowTask = new ssm.CfnMaintenanceWindowTask(this, 'MyCfnMaintenanceWindowTask', {
  priority: 123,
  taskArn: 'taskArn',
  taskType: 'taskType',
  windowId: 'windowId',

  // the properties below are optional
  cutoffBehavior: 'cutoffBehavior',
  description: 'description',
  loggingInfo: {
    region: 'region',
    s3Bucket: 's3Bucket',

    // the properties below are optional
    s3Prefix: 's3Prefix',
  },
  maxConcurrency: 'maxConcurrency',
  maxErrors: 'maxErrors',
  name: 'name',
  serviceRoleArn: 'serviceRoleArn',
  targets: [{
    key: 'key',
    values: ['values'],
  }],
  taskInvocationParameters: {
    maintenanceWindowAutomationParameters: {
      documentVersion: 'documentVersion',
      parameters: parameters,
    },
    maintenanceWindowLambdaParameters: {
      clientContext: 'clientContext',
      payload: 'payload',
      qualifier: 'qualifier',
    },
    maintenanceWindowRunCommandParameters: {
      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,
    },
    maintenanceWindowStepFunctionsParameters: {
      input: 'input',
      name: 'name',
    },
  },
  taskParameters: taskParameters,
});
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
# task_parameters: Any

cfn_maintenance_window_task = ssm.CfnMaintenanceWindowTask(self, "MyCfnMaintenanceWindowTask",
    priority=123,
    task_arn="taskArn",
    task_type="taskType",
    window_id="windowId",

    # the properties below are optional
    cutoff_behavior="cutoffBehavior",
    description="description",
    logging_info=ssm.CfnMaintenanceWindowTask.LoggingInfoProperty(
        region="region",
        s3_bucket="s3Bucket",

        # the properties below are optional
        s3_prefix="s3Prefix"
    ),
    max_concurrency="maxConcurrency",
    max_errors="maxErrors",
    name="name",
    service_role_arn="serviceRoleArn",
    targets=[ssm.CfnMaintenanceWindowTask.TargetProperty(
        key="key",
        values=["values"]
    )],
    task_invocation_parameters=ssm.CfnMaintenanceWindowTask.TaskInvocationParametersProperty(
        maintenance_window_automation_parameters=ssm.CfnMaintenanceWindowTask.MaintenanceWindowAutomationParametersProperty(
            document_version="documentVersion",
            parameters=parameters
        ),
        maintenance_window_lambda_parameters=ssm.CfnMaintenanceWindowTask.MaintenanceWindowLambdaParametersProperty(
            client_context="clientContext",
            payload="payload",
            qualifier="qualifier"
        ),
        maintenance_window_run_command_parameters=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
        ),
        maintenance_window_step_functions_parameters=ssm.CfnMaintenanceWindowTask.MaintenanceWindowStepFunctionsParametersProperty(
            input="input",
            name="name"
        )
    ),
    task_parameters=task_parameters
)
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;
Object taskParameters;

CfnMaintenanceWindowTask cfnMaintenanceWindowTask = CfnMaintenanceWindowTask.Builder.create(this, "MyCfnMaintenanceWindowTask")
        .priority(123)
        .taskArn("taskArn")
        .taskType("taskType")
        .windowId("windowId")

        // the properties below are optional
        .cutoffBehavior("cutoffBehavior")
        .description("description")
        .loggingInfo(LoggingInfoProperty.builder()
                .region("region")
                .s3Bucket("s3Bucket")

                // the properties below are optional
                .s3Prefix("s3Prefix")
                .build())
        .maxConcurrency("maxConcurrency")
        .maxErrors("maxErrors")
        .name("name")
        .serviceRoleArn("serviceRoleArn")
        .targets(List.of(TargetProperty.builder()
                .key("key")
                .values(List.of("values"))
                .build()))
        .taskInvocationParameters(TaskInvocationParametersProperty.builder()
                .maintenanceWindowAutomationParameters(MaintenanceWindowAutomationParametersProperty.builder()
                        .documentVersion("documentVersion")
                        .parameters(parameters)
                        .build())
                .maintenanceWindowLambdaParameters(MaintenanceWindowLambdaParametersProperty.builder()
                        .clientContext("clientContext")
                        .payload("payload")
                        .qualifier("qualifier")
                        .build())
                .maintenanceWindowRunCommandParameters(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())
                .maintenanceWindowStepFunctionsParameters(MaintenanceWindowStepFunctionsParametersProperty.builder()
                        .input("input")
                        .name("name")
                        .build())
                .build())
        .taskParameters(taskParameters)
        .build();
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 taskParameters;

var cfnMaintenanceWindowTask = new CfnMaintenanceWindowTask(this, "MyCfnMaintenanceWindowTask", new CfnMaintenanceWindowTaskProps {
    Priority = 123,
    TaskArn = "taskArn",
    TaskType = "taskType",
    WindowId = "windowId",

    // the properties below are optional
    CutoffBehavior = "cutoffBehavior",
    Description = "description",
    LoggingInfo = new LoggingInfoProperty {
        Region = "region",
        S3Bucket = "s3Bucket",

        // the properties below are optional
        S3Prefix = "s3Prefix"
    },
    MaxConcurrency = "maxConcurrency",
    MaxErrors = "maxErrors",
    Name = "name",
    ServiceRoleArn = "serviceRoleArn",
    Targets = new [] { new TargetProperty {
        Key = "key",
        Values = new [] { "values" }
    } },
    TaskInvocationParameters = new TaskInvocationParametersProperty {
        MaintenanceWindowAutomationParameters = new MaintenanceWindowAutomationParametersProperty {
            DocumentVersion = "documentVersion",
            Parameters = parameters
        },
        MaintenanceWindowLambdaParameters = new MaintenanceWindowLambdaParametersProperty {
            ClientContext = "clientContext",
            Payload = "payload",
            Qualifier = "qualifier"
        },
        MaintenanceWindowRunCommandParameters = 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
        },
        MaintenanceWindowStepFunctionsParameters = new MaintenanceWindowStepFunctionsParametersProperty {
            Input = "input",
            Name = "name"
        }
    },
    TaskParameters = taskParameters
});
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{}
var taskParameters interface{}

cfnMaintenanceWindowTask := awscdk.Aws_ssm.NewCfnMaintenanceWindowTask(this, jsii.String("MyCfnMaintenanceWindowTask"), &CfnMaintenanceWindowTaskProps{
	Priority: jsii.Number(123),
	TaskArn: jsii.String("taskArn"),
	TaskType: jsii.String("taskType"),
	WindowId: jsii.String("windowId"),

	// the properties below are optional
	CutoffBehavior: jsii.String("cutoffBehavior"),
	Description: jsii.String("description"),
	LoggingInfo: &LoggingInfoProperty{
		Region: jsii.String("region"),
		S3Bucket: jsii.String("s3Bucket"),

		// the properties below are optional
		S3Prefix: jsii.String("s3Prefix"),
	},
	MaxConcurrency: jsii.String("maxConcurrency"),
	MaxErrors: jsii.String("maxErrors"),
	Name: jsii.String("name"),
	ServiceRoleArn: jsii.String("serviceRoleArn"),
	Targets: []interface{}{
		&TargetProperty{
			Key: jsii.String("key"),
			Values: []*string{
				jsii.String("values"),
			},
		},
	},
	TaskInvocationParameters: &TaskInvocationParametersProperty{
		MaintenanceWindowAutomationParameters: &MaintenanceWindowAutomationParametersProperty{
			DocumentVersion: jsii.String("documentVersion"),
			Parameters: parameters,
		},
		MaintenanceWindowLambdaParameters: &MaintenanceWindowLambdaParametersProperty{
			ClientContext: jsii.String("clientContext"),
			Payload: jsii.String("payload"),
			Qualifier: jsii.String("qualifier"),
		},
		MaintenanceWindowRunCommandParameters: &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),
		},
		MaintenanceWindowStepFunctionsParameters: &MaintenanceWindowStepFunctionsParametersProperty{
			Input: jsii.String("input"),
			Name: jsii.String("name"),
		},
	},
	TaskParameters: taskParameters,
})

Initializer ​

ts
new CfnMaintenanceWindowTask(scope: Construct, id: string, props: CfnMaintenanceWindowTaskProps)
python
CfnMaintenanceWindowTask(scope: Construct, id: str, props: CfnMaintenanceWindowTaskProps)
java
new CfnMaintenanceWindowTask(Construct scope, String id, CfnMaintenanceWindowTaskProps props)
csharp
new CfnMaintenanceWindowTask(Construct scope, string id, CfnMaintenanceWindowTaskProps props)
go
NewCfnMaintenanceWindowTask(Scope Construct, Id *string, Props CfnMaintenanceWindowTaskProps)

Construct Props ​

cutoffBehavioroptionalstringcutoff_behavioroptionalstrcutoffBehavioroptionalStringCutoffBehavioroptionalstringCutoffBehavioroptional*string#
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
A description of the task.
loggingInfooptionalIResolvable | CfnMaintenanceWindowTask.LoggingInfoPropertylogging_infooptionaltyping.Union[IResolvable, LoggingInfoProperty]loggingInfooptionalIResolvableLoggingInfooptionalIResolvableLoggingInfooptionalinterface{}#
> `LoggingInfo` has been deprecated.
notes

To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters .

Information about an Amazon S3 bucket to write Run Command task-level logs to.

maxConcurrencyoptionalstringmax_concurrencyoptionalstrmaxConcurrencyoptionalStringMaxConcurrencyoptionalstringMaxConcurrencyoptional*string#
The maximum number of targets this task can be run for, in parallel.
notes

Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

maxErrorsoptionalstringmax_errorsoptionalstrmaxErrorsoptionalStringMaxErrorsoptionalstringMaxErrorsoptional*string#
The maximum number of errors allowed before this task stops being scheduled.
notes

Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The task name.
prioritynumberpriorityint | floatpriorityNumberPrioritydoublePriority*float64required#
The priority of the task in the maintenance window.

The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.

serviceRoleArnoptionalstringservice_role_arnoptionalstrserviceRoleArnoptionalStringServiceRoleArnoptionalstringServiceRoleArnoptional*string#
The Amazon Resource Name (ARN) of the IAM service role for AWS Systems Manager to assume when running a maintenance window task.
notes

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 in the in the AWS Systems Manager User Guide .

targetsoptionalIResolvable | IResolvable | CfnMaintenanceWindowTask.TargetProperty[]targetsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, TargetProperty]]]targetsoptionalIResolvableTargetsoptionalIResolvableTargetsoptionalinterface{}#
The targets, either instances or window target IDs.
  • Specify instances using Key=InstanceIds,Values= *instanceid1* , *instanceid2* .
  • Specify window target IDs using Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2* .
taskArnstringtask_arnstrtaskArnStringTaskArnstringTaskArn*stringrequired#
The resource that the task uses during execution.

For RUN_COMMAND and AUTOMATION task types, TaskArn is the SSM document name or Amazon Resource Name (ARN).

For LAMBDA tasks, TaskArn is the function name or ARN.

For STEP_FUNCTIONS tasks, TaskArn is the state machine ARN.

taskInvocationParametersoptionalIResolvable | CfnMaintenanceWindowTask.TaskInvocationParametersPropertytask_invocation_parametersoptionaltyping.Union[IResolvable, TaskInvocationParametersProperty]taskInvocationParametersoptionalIResolvableTaskInvocationParametersoptionalIResolvableTaskInvocationParametersoptionalinterface{}#
The parameters to pass to the task when it runs.
notes

Populate only the fields that match the task type. All other fields should be empty.

When you update a maintenance window task that has options specified in TaskInvocationParameters , you must provide again all the TaskInvocationParameters values that you want to retain. The values you do not specify again are removed. For example, suppose that when you registered a Run Command task, you specified TaskInvocationParameters values for Comment , NotificationConfig , and OutputS3BucketName . If you update the maintenance window task and specify only a different OutputS3BucketName value, the values for Comment and NotificationConfig are removed.

taskParametersoptionalanytask_parametersoptionalAnytaskParametersoptionalObjectTaskParametersoptionalobjectTaskParametersoptionalinterface{}#
> `TaskParameters` has been deprecated.
notes

To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

The parameters to pass to the task when it runs.

taskTypestringtask_typestrtaskTypeStringTaskTypestringTaskType*stringrequired#
The type of task.

Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .

windowIdstringwindow_idstrwindowIdStringWindowIdstringWindowId*stringrequired#
The ID of the maintenance window where the task is registered.

Properties ​

attrWindowTaskIdstringattr_window_task_idstrattrWindowTaskIdStringAttrWindowTaskIdstringAttrWindowTaskId*stringrequired#
The task ID.
CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringrequiredstatic#
The CloudFormation resource type name for this resource class.
Options for this resource, such as condition, update policy etc.
cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*stringrequired#
AWS resource type.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*stringrequired#
cutoffBehaviormay be undefinedstringcutoff_behaviormay be undefinedstrcutoffBehaviormay be undefinedStringCutoffBehaviormay be undefinedstringCutoffBehaviormay be undefined*string#
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
descriptionmay be undefinedstringdescriptionmay be undefinedstrdescriptionmay be undefinedStringDescriptionmay be undefinedstringDescriptionmay be undefined*string#
A description of the task.
loggingInfomay be undefinedIResolvable | CfnMaintenanceWindowTask.LoggingInfoPropertylogging_infomay be undefinedtyping.Union[IResolvable, LoggingInfoProperty]loggingInfomay be undefinedIResolvableLoggingInfomay be undefinedIResolvableLoggingInfomay be undefinedinterface{}#
> `LoggingInfo` has been deprecated.
logicalIdstringlogical_idstrlogicalIdStringLogicalIdstringLogicalId*stringrequired#
The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

maintenanceWindowTaskRefMaintenanceWindowTaskReferencemaintenance_window_task_refMaintenanceWindowTaskReferencemaintenanceWindowTaskRefMaintenanceWindowTaskReferenceMaintenanceWindowTaskRefMaintenanceWindowTaskReferenceMaintenanceWindowTaskRefMaintenanceWindowTaskReferencerequired#
A reference to a MaintenanceWindowTask resource.
maxConcurrencymay be undefinedstringmax_concurrencymay be undefinedstrmaxConcurrencymay be undefinedStringMaxConcurrencymay be undefinedstringMaxConcurrencymay be undefined*string#
The maximum number of targets this task can be run for, in parallel.
maxErrorsmay be undefinedstringmax_errorsmay be undefinedstrmaxErrorsmay be undefinedStringMaxErrorsmay be undefinedstringMaxErrorsmay be undefined*string#
The maximum number of errors allowed before this task stops being scheduled.
namemay be undefinedstringnamemay be undefinedstrnamemay be undefinedStringNamemay be undefinedstringNamemay be undefined*string#
The task name.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
prioritynumberpriorityint | floatpriorityNumberPrioritydoublePriority*float64required#
The priority of the task in the maintenance window.
refstringrefstrrefStringRefstringRef*stringrequired#
Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

serviceRoleArnmay be undefinedstringservice_role_arnmay be undefinedstrserviceRoleArnmay be undefinedStringServiceRoleArnmay be undefinedstringServiceRoleArnmay be undefined*string#
The Amazon Resource Name (ARN) of the IAM service role for AWS Systems Manager to assume when running a maintenance window task.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

targetsmay be undefinedIResolvable | IResolvable | CfnMaintenanceWindowTask.TargetProperty[]targetsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, TargetProperty]]]targetsmay be undefinedIResolvableTargetsmay be undefinedIResolvableTargetsmay be undefinedinterface{}#
The targets, either instances or window target IDs.
taskArnstringtask_arnstrtaskArnStringTaskArnstringTaskArn*stringrequired#
The resource that the task uses during execution.
taskInvocationParametersmay be undefinedIResolvable | CfnMaintenanceWindowTask.TaskInvocationParametersPropertytask_invocation_parametersmay be undefinedtyping.Union[IResolvable, TaskInvocationParametersProperty]taskInvocationParametersmay be undefinedIResolvableTaskInvocationParametersmay be undefinedIResolvableTaskInvocationParametersmay be undefinedinterface{}#
The parameters to pass to the task when it runs.
taskParametersanytask_parametersAnytaskParametersObjectTaskParametersobjectTaskParametersinterface{}required#
> `TaskParameters` has been deprecated.
taskTypestringtask_typestrtaskTypeStringTaskTypestringTaskType*stringrequired#
The type of task.
windowIdstringwindow_idstrwindowIdStringWindowIdstringWindowId*stringrequired#
The ID of the maintenance window where the task is registered.

Methods ​

addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#
Syntactic sugar for `addOverride(path, undefined)`.
1 parameter

Parameters

  • pathpathpathpathPath — The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#
Use `addResourceDependency` instead.

This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.

addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#
Use `addResourceDependency` instead.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.

addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#
Add a value to the CloudFormation Resource Metadata.
addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#
Adds an override to the synthesized CloudFormation resource.
notes · 2 parameters

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

json
"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters

  • pathpathpathpathPath — - The path of the property, you can use dot notation to override values in complex types.
  • valuevaluevaluevalueValue — - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#
Adds an override that deletes the value of a property from the resource definition.
1 parameter

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#
Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

2 parameters

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path of the property.
  • valuevaluevaluevalueValue — The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

1 parameter

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#
Sets the deletion policy of the resource based on the removal policy specified.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

arnForMaintenanceWindowTask(resource: IMaintenanceWindowTaskRef): string@staticmethod def arn_for_maintenance_window_task(resource: IMaintenanceWindowTaskRef) -> strpublic static String arnForMaintenanceWindowTask(IMaintenanceWindowTaskRef resource)public static string ArnForMaintenanceWindowTask(IMaintenanceWindowTaskRef resource)func ArnForMaintenanceWindowTask(Resource IMaintenanceWindowTaskRef) *stringstatic#
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#
getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference#
Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

1 parameter

Parameters

  • attributeNameattribute_nameattributeNameattributeNameAttributeName — The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#
Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#
Examines the CloudFormation resource and discloses attributes.
1 parameter

Parameters

  • inspectorinspectorinspectorinspectorInspector — tree inspector to collect and process attributes.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

returns

Returns: The construct as a stack element or undefined if it is not a stack element.

isCfnMaintenanceWindowTask(x: any): boolean@staticmethod def is_cfn_maintenance_window_task(x: Any) -> boolpublic static Boolean isCfnMaintenanceWindowTask(Object x)public static bool IsCfnMaintenanceWindowTask(object x)func IsCfnMaintenanceWindowTask(X interface{}) *boolstatic#
Checks whether the given object is a CfnMaintenanceWindowTask.
isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#
Check whether the given object is a CfnResource.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#
Retrieves an array of resources and stacks this resource depends on.

For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.

overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#
Overrides the auto-generated logical ID with a specific ID.
1 parameter

Parameters

  • newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId — The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#
Use `removeResourceDependency` instead

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#
Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#
Replaces one dependency with another.
2 parameters

Parameters

  • targettargettargettargetTarget — The dependency to replace.
  • newTargetnew_targetnewTargetnewTargetNewTarget — The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
returns

Returns: a string representation of this resource

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.