# TargetProperty

`Target` is a property of the [AWS::SSM::Association](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-association.html) resource that specifies the targets for an SSM document in Systems Manager . You can target all instances in an AWS account by specifying the `InstanceIds` key with a value of `*` . To view a JSON and a YAML example that targets all instances, see the example "Create an association for all managed instances in an AWS account " later in this page.

- 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';
const targetProperty: ssm.CfnAssociation.TargetProperty = {
  key: 'key',
  values: ['values'],
};
```

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

target_property = ssm.CfnAssociation.TargetProperty(
    key="key",
    values=["values"]
)
```

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.*;

TargetProperty targetProperty = TargetProperty.builder()
        .key("key")
        .values(List.of("values"))
        .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 targetProperty = new TargetProperty {
    Key = "key",
    Values = new [] { "values" }
};
```

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"

targetProperty := &TargetProperty{
	Key: jsii.String("key"),
	Values: []*string{
		jsii.String("values"),
	},
}
```

## Properties

- `key`: string (required) — User-defined criteria for sending commands that target managed nodes that meet the criteria.

- `values`: string[] (required) — User-defined criteria that maps to `Key` .

  For example, if you specified `tag:ServerRole` , you could specify `value:WebServer` to run a command on instances that include EC2 tags of `ServerRole,WebServer` .

  Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.
