TargetProperty Struct
The Target property type specifies targets (either instances or window target IDs).
You specify instances by using Key=InstanceIds,Values=< *instanceid1* >,< *instanceid2* > . You specify window target IDs using Key=WindowTargetIds,Values=< *window-target-id-1* >,< *window-target-id-2* > for a maintenance window task in AWS Systems Manager .
Target is a property of the AWS::SSM::MaintenanceWindowTask property type.
To use
resource-groups:Nameas the key for a maintenance window target, specify the resource group as aAWS::SSM::MaintenanceWindowTargettype, and use theReffunction to specify the target forAWS::SSM::MaintenanceWindowTask. For an example, see Create a Run Command task that targets instances using a resource group name in AWS::SSM::MaintenanceWindowTask Examples .
| Source | |
|---|---|
| Type last changed |
Example
// 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';
const targetProperty: ssm.CfnMaintenanceWindowTask.TargetProperty = {
key: 'key',
values: ['values'],
};
# 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
target_property = ssm.CfnMaintenanceWindowTask.TargetProperty(
key="key",
values=["values"]
)
// 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.*;
TargetProperty targetProperty = TargetProperty.builder()
.key("key")
.values(List.of("values"))
.build();
// 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 targetProperty = new TargetProperty {
Key = "key",
Values = new [] { "values" }
};
// 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"
targetProperty := &TargetProperty{
Key: jsii.String("key"),
Values: []*string{
jsii.String("values"),
},
}
Properties
notes
Key can be InstanceIds or WindowTargetIds . For more information about how to target instances within a maintenance window task, see About 'register-task-with-maintenance-window' Options and Values in the AWS Systems Manager User Guide .
notes
For example, if you specify InstanceIds , you can specify i-1234567890abcdef0,i-9876543210abcdef0 to run a command on two EC2 instances. For more information about how to target instances within a maintenance window task, see About 'register-task-with-maintenance-window' Options and Values in the AWS Systems Manager User Guide .