# TargetFiltersProperty

The `TargetFilters` property type specifies the target filters for the Hook.

For more information, see [CloudFormation Hook target filters](https://docs.aws.amazon.com/cloudformation-cli/latest/hooks-userguide/hooks-target-filtering.html) .

- Source: Generated at build time
- Type last changed: v2.182.0 · 5 Mar 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudformation as cloudformation } from 'aws-cdk-lib';
const targetFiltersProperty: cloudformation.CfnGuardHook.TargetFiltersProperty = {
  targets: [{
    action: 'action',
    invocationPoint: 'invocationPoint',
    targetName: 'targetName',
  }],

  // the properties below are optional
  actions: ['actions'],
  invocationPoints: ['invocationPoints'],
  targetNames: ['targetNames'],
};
```

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_cloudformation as cloudformation

target_filters_property = cloudformation.CfnGuardHook.TargetFiltersProperty(
    targets=[cloudformation.CfnGuardHook.HookTargetProperty(
        action="action",
        invocation_point="invocationPoint",
        target_name="targetName"
    )],

    # the properties below are optional
    actions=["actions"],
    invocation_points=["invocationPoints"],
    target_names=["targetNames"]
)
```

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

TargetFiltersProperty targetFiltersProperty = TargetFiltersProperty.builder()
        .targets(List.of(HookTargetProperty.builder()
                .action("action")
                .invocationPoint("invocationPoint")
                .targetName("targetName")
                .build()))

        // the properties below are optional
        .actions(List.of("actions"))
        .invocationPoints(List.of("invocationPoints"))
        .targetNames(List.of("targetNames"))
        .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.CloudFormation;

var targetFiltersProperty = new TargetFiltersProperty {
    Targets = new [] { new HookTargetProperty {
        Action = "action",
        InvocationPoint = "invocationPoint",
        TargetName = "targetName"
    } },

    // the properties below are optional
    Actions = new [] { "actions" },
    InvocationPoints = new [] { "invocationPoints" },
    TargetNames = new [] { "targetNames" }
};
```

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"

targetFiltersProperty := &TargetFiltersProperty{
	Targets: []interface{}{
		&HookTargetProperty{
			Action: jsii.String("action"),
			InvocationPoint: jsii.String("invocationPoint"),
			TargetName: jsii.String("targetName"),
		},
	},

	// the properties below are optional
	Actions: []*string{
		jsii.String("actions"),
	},
	InvocationPoints: []*string{
		jsii.String("invocationPoints"),
	},
	TargetNames: []*string{
		jsii.String("targetNames"),
	},
}
```

## Properties

- `actions`: string[] — List of actions that the hook is going to target.

- `invocationPoints`: string[] — List of invocation points that the hook is going to target.

- `targetNames`: string[] — List of type names that the hook is going to target.

- `targets`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnGuardHook.HookTargetProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudformation.CfnGuardHook.HookTargetProperty.html)[] (required) — List of hook targets.
