CfnLambdaHookProps Struct
Properties for defining a CfnLambdaHook.
| Source | |
|---|---|
| Type last changed |
Example
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 cfnLambdaHookProps: cdk.CfnLambdaHookProps = {
alias: 'alias',
executionRole: 'executionRole',
failureMode: 'failureMode',
hookStatus: 'hookStatus',
lambdaFunction: 'lambdaFunction',
targetOperations: ['targetOperations'],
// the properties below are optional
autoUpdate: false,
loggingConfig: {
logGroupName: 'logGroupName',
logRoleArn: 'logRoleArn',
},
stackFilters: {
filteringCriteria: 'filteringCriteria',
// the properties below are optional
stackNames: {
exclude: ['exclude'],
include: ['include'],
},
stackRoles: {
exclude: ['exclude'],
include: ['include'],
},
},
targetFilters: {
targets: [{
action: 'action',
invocationPoint: 'invocationPoint',
targetName: 'targetName',
}],
// the properties below are optional
actions: ['actions'],
invocationPoints: ['invocationPoints'],
targetNames: ['targetNames'],
},
};
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
cfn_lambda_hook_props = cdk.CfnLambdaHookProps(
alias="alias",
execution_role="executionRole",
failure_mode="failureMode",
hook_status="hookStatus",
lambda_function="lambdaFunction",
target_operations=["targetOperations"],
# the properties below are optional
auto_update=False,
logging_config=cdk.CfnLambdaHook.LoggingConfigProperty(
log_group_name="logGroupName",
log_role_arn="logRoleArn"
),
stack_filters=cdk.CfnLambdaHook.StackFiltersProperty(
filtering_criteria="filteringCriteria",
# the properties below are optional
stack_names=cdk.CfnLambdaHook.StackNamesProperty(
exclude=["exclude"],
include=["include"]
),
stack_roles=cdk.CfnLambdaHook.StackRolesProperty(
exclude=["exclude"],
include=["include"]
)
),
target_filters=cdk.CfnLambdaHook.TargetFiltersProperty(
targets=[cdk.CfnLambdaHook.HookTargetProperty(
action="action",
invocation_point="invocationPoint",
target_name="targetName"
)],
# the properties below are optional
actions=["actions"],
invocation_points=["invocationPoints"],
target_names=["targetNames"]
)
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
CfnLambdaHookProps cfnLambdaHookProps = CfnLambdaHookProps.builder()
.alias("alias")
.executionRole("executionRole")
.failureMode("failureMode")
.hookStatus("hookStatus")
.lambdaFunction("lambdaFunction")
.targetOperations(List.of("targetOperations"))
// the properties below are optional
.autoUpdate(false)
.loggingConfig(LoggingConfigProperty.builder()
.logGroupName("logGroupName")
.logRoleArn("logRoleArn")
.build())
.stackFilters(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())
.targetFilters(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())
.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;
var cfnLambdaHookProps = new CfnLambdaHookProps {
Alias = "alias",
ExecutionRole = "executionRole",
FailureMode = "failureMode",
HookStatus = "hookStatus",
LambdaFunction = "lambdaFunction",
TargetOperations = new [] { "targetOperations" },
// the properties below are optional
AutoUpdate = false,
LoggingConfig = new LoggingConfigProperty {
LogGroupName = "logGroupName",
LogRoleArn = "logRoleArn"
},
StackFilters = 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" }
}
},
TargetFilters = 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" }
}
};
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"
cfnLambdaHookProps := &CfnLambdaHookProps{
Alias: jsii.String("alias"),
ExecutionRole: jsii.String("executionRole"),
FailureMode: jsii.String("failureMode"),
HookStatus: jsii.String("hookStatus"),
LambdaFunction: jsii.String("lambdaFunction"),
TargetOperations: []*string{
jsii.String("targetOperations"),
},
// the properties below are optional
AutoUpdate: jsii.Boolean(false),
LoggingConfig: &LoggingConfigProperty{
LogGroupName: jsii.String("logGroupName"),
LogRoleArn: jsii.String("logRoleArn"),
},
StackFilters: &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"),
},
},
},
TargetFilters: &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
The type name alias for the Hook. This alias must be unique per account and Region.
The alias must be in the form Name1::Name2::Name3 and must not begin with AWS . For example, Private::Lambda::MyTestHook .
autoUpdateoptionalboolean | IResolvableauto_updateoptionaltyping.Union[bool, IResolvable]autoUpdateoptionalBooleanAutoUpdateoptionalboolAutoUpdateoptionalinterface{} = true #Whether to automatically update the extension in this account and Region when a new minor version is published by the extension publisher.
executionRolestringexecution_rolestrexecutionRoleStringExecutionRolestringExecutionRole*string required #The IAM role that the Hook assumes to invoke your Lambda function.
Specifies how the Hook responds when the Lambda function invoked by the Hook returns a `FAILED` response.
notes
FAIL: Prevents the action from proceeding. This is helpful for enforcing strict compliance or security policies.WARN: Issues warnings to users but allows actions to continue. This is useful for non-critical validations or informational checks.
hookStatusstringhook_statusstrhookStatusStringHookStatusstringHookStatus*string = "ENABLED" required #Specifies if the Hook is `ENABLED` or `DISABLED` .
lambdaFunctionstringlambda_functionstrlambdaFunctionStringLambdaFunctionstringLambdaFunction*string required #Specifies the Lambda function for the Hook. You can use:.
- The full Amazon Resource Name (ARN) without a suffix.
- A qualified ARN with a version or alias suffix.
loggingConfigoptionalIResolvable | CfnLambdaHook.logging_configoptionaltyping.Union[IResolvable, LoggingConfigProperty]loggingConfigoptionalIResolvableLoggingConfigoptionalIResolvableLoggingConfigoptionalinterface{} #Contains logging configuration information for an extension.
stackFiltersoptionalIResolvable | CfnLambdaHook.stack_filtersoptionaltyping.Union[IResolvable, StackFiltersProperty]stackFiltersoptionalIResolvableStackFiltersoptionalIResolvableStackFiltersoptionalinterface{} #Specifies the stack level filters for the Hook.
notes
Example stack level filter in JSON:
"StackFilters": {"FilteringCriteria": "ALL", "StackNames": {"Exclude": [ "stack-1", "stack-2"]}}
Example stack level filter in YAML:
StackFilters: FilteringCriteria: ALL StackNames: Exclude: - stack-1 - stack-2
targetFiltersoptionalIResolvable | CfnLambdaHook.target_filtersoptionaltyping.Union[IResolvable, TargetFiltersProperty]targetFiltersoptionalIResolvableTargetFiltersoptionalIResolvableTargetFiltersoptionalinterface{} #Specifies the target filters for the Hook.
Example target filter in JSON:
"TargetFilters": {"Actions": [ "CREATE", "UPDATE", "DELETE" ]}
Example target filter in YAML:
TargetFilters: Actions: - CREATE - UPDATE - DELETE
targetOperationsstring[]target_operationstyping.List[str]targetOperationsList<String>TargetOperationsstring[]TargetOperations*[]*string required #Specifies the list of operations the Hook is run against.
notes
For more information, see Hook targets in the CloudFormation Hooks User Guide .
Valid values: STACK | RESOURCE | CHANGE_SET | CLOUD_CONTROL