# CfnLambdaHookProps

Properties for defining a `CfnLambdaHook`.

Extends: CfnLambdaHookProps
Used as props by: CfnLambdaHook

- Source: Generated code
- Type last changed: v2.264.0 · 10 Aug 2026

## 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'],
  },
};
```

## Properties

- `alias`: string (required) — 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` .

- `autoUpdate`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = true — Whether to automatically update the extension in this account and Region when a new minor version is published by the extension publisher.

- `executionRole`: string (required) — The IAM role that the Hook assumes to invoke your Lambda function.

- `failureMode`: string (required) — Specifies how the Hook responds when the Lambda function invoked by the Hook returns a `FAILED` response.

  - `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.

- `hookStatus`: string (required) = "ENABLED" — Specifies if the Hook is `ENABLED` or `DISABLED` .

- `lambdaFunction`: 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.

- `loggingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLambdaHook.LoggingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.CfnLambdaHook.LoggingConfigProperty.html) — Contains logging configuration information for an extension.

- `stackFilters`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLambdaHook.StackFiltersProperty](/cdk/api/v2/docs/aws-cdk-lib.CfnLambdaHook.StackFiltersProperty.html) — Specifies the stack level filters for the Hook.

  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`

- `targetFilters`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLambdaHook.TargetFiltersProperty](/cdk/api/v2/docs/aws-cdk-lib.CfnLambdaHook.TargetFiltersProperty.html) — 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`

- `targetOperations`: string[] (required) — Specifies the list of operations the Hook is run against.

  For more information, see [Hook targets](https://docs.aws.amazon.com/cloudformation-cli/latest/hooks-userguide/hooks-concepts.html#hook-terms-hook-target) in the *CloudFormation Hooks User Guide* .

  Valid values: `STACK` | `RESOURCE` | `CHANGE_SET` | `CLOUD_CONTROL`
