StackFiltersProperty Struct
The StackFilters property type specifies stack level filters for a Hook.
The StackNames or StackRoles properties are optional. However, you must specify at least one of these properties.
For more information, see CloudFormation Hooks stack level filters .
Example
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 stackFiltersProperty: cloudformation.CfnGuardHook.StackFiltersProperty = {
filteringCriteria: 'filteringCriteria',
// the properties below are optional
stackNames: {
exclude: ['exclude'],
include: ['include'],
},
stackRoles: {
exclude: ['exclude'],
include: ['include'],
},
};
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
stack_filters_property = cloudformation.CfnGuardHook.StackFiltersProperty(
filtering_criteria="filteringCriteria",
# the properties below are optional
stack_names=cloudformation.CfnGuardHook.StackNamesProperty(
exclude=["exclude"],
include=["include"]
),
stack_roles=cloudformation.CfnGuardHook.StackRolesProperty(
exclude=["exclude"],
include=["include"]
)
)
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.*;
StackFiltersProperty stackFiltersProperty = StackFiltersProperty.builder()
.filteringCriteria("filteringCriteria")
// the properties below are optional
.stackNames(StackNamesProperty.builder()
.exclude(List.of("exclude"))
.include(List.of("include"))
.build())
.stackRoles(StackRolesProperty.builder()
.exclude(List.of("exclude"))
.include(List.of("include"))
.build())
.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.CloudFormation;
var stackFiltersProperty = new StackFiltersProperty {
FilteringCriteria = "filteringCriteria",
// the properties below are optional
StackNames = new StackNamesProperty {
Exclude = new [] { "exclude" },
Include = new [] { "include" }
},
StackRoles = new StackRolesProperty {
Exclude = new [] { "exclude" },
Include = new [] { "include" }
}
};
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"
stackFiltersProperty := &StackFiltersProperty{
FilteringCriteria: jsii.String("filteringCriteria"),
// the properties below are optional
StackNames: &StackNamesProperty{
Exclude: []*string{
jsii.String("exclude"),
},
Include: []*string{
jsii.String("include"),
},
},
StackRoles: &StackRolesProperty{
Exclude: []*string{
jsii.String("exclude"),
},
Include: []*string{
jsii.String("include"),
},
},
}
Properties
filteringCriteriastringfiltering_criteriastrfilteringCriteriaStringFilteringCriteriastringFilteringCriteria*string= "ALL"required#The filtering criteria.
- All stack names and stack roles (
All): The Hook will only be invoked when all specified filters match. - Any stack names and stack roles (
Any): The Hook will be invoked if at least one of the specified filters match.
stackNamesoptionalIResolvable | CfnGuardHook.StackNamesPropertystack_namesoptionaltyping.Union[IResolvable, StackNamesProperty]stackNamesoptionalIResolvableStackNamesoptionalIResolvableStackNamesoptionalinterface{}#Includes or excludes specific stacks from Hook invocations.
stackRolesoptionalIResolvable | CfnGuardHook.StackRolesPropertystack_rolesoptionaltyping.Union[IResolvable, StackRolesProperty]stackRolesoptionalIResolvableStackRolesoptionalIResolvableStackRolesoptionalinterface{}#Includes or excludes specific stacks from Hook invocations based on their associated IAM roles.