# StackNamesProperty

Specifies the stack names for the `StackFilters` property type to include or exclude specific stacks from Hook invocations.

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

- Source: Generated at build time
- Type last changed: v2.168.0 · 20 Nov 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const stackNamesProperty: cdk.CfnGuardHook.StackNamesProperty = {
  exclude: ['exclude'],
  include: ['include'],
};
```

Python:

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

stack_names_property = cdk.CfnGuardHook.StackNamesProperty(
    exclude=["exclude"],
    include=["include"]
)
```

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

StackNamesProperty stackNamesProperty = StackNamesProperty.builder()
        .exclude(List.of("exclude"))
        .include(List.of("include"))
        .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;

var stackNamesProperty = new StackNamesProperty {
    Exclude = new [] { "exclude" },
    Include = new [] { "include" }
};
```

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 cdk "github.com/aws/aws-cdk-go/awscdk"

stackNamesProperty := &StackNamesProperty{
	Exclude: []*string{
		jsii.String("exclude"),
	},
	Include: []*string{
		jsii.String("include"),
	},
}
```

## Properties

- `exclude`: string[] — The stack names to exclude.

  All stacks except those listed here will invoke the Hook.

- `include`: string[] — The stack names to include.

  Only the stacks specified in this list will invoke the Hook.
