Skip to main content

lambda_hooks

Creates, updates, deletes or gets a lambda_hook resource or lists lambda_hooks in a region

Overview

Namelambda_hooks
TypeResource
DescriptionThis is a CloudFormation resource for the first-party AWS::Hooks::LambdaHook.
Idaws.cloudformation.lambda_hooks

Fields

NameDatatypeDescription
lambda_functionstringAmazon Resource Name (ARN), Partial ARN, name, version, or alias of the Lambda function to invoke with this hook.
hook_statusstringAttribute to specify which stacks this hook applies to or should get invoked for
target_operationsarrayWhich operations should this Hook run against? Resource changes, stacks or change sets.
failure_modestringAttribute to specify CloudFormation behavior on hook failure.
target_filtersobjectAttribute to specify which targets should invoke the hook
stack_filtersobjectFilters to allow hooks to target specific stack attributes
aliasstringThe typename alias for the hook.
hook_arnstringThe Amazon Resource Name (ARN) of the activated hook
execution_rolestringThe execution role ARN assumed by Hooks to invoke Lambda.
regionstringAWS region.

For more information, see AWS::CloudFormation::LambdaHook.

Methods

NameAccessible byRequired Params
create_resourceINSERTLambdaFunction, FailureMode, Alias, ExecutionRole, TargetOperations, HookStatus, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all lambda_hooks in a region.

SELECT
region,
lambda_function,
hook_status,
target_operations,
failure_mode,
target_filters,
stack_filters,
alias,
hook_arn,
execution_role
FROM aws.cloudformation.lambda_hooks
WHERE region = 'us-east-1';

Gets all properties from an individual lambda_hook.

SELECT
region,
lambda_function,
hook_status,
target_operations,
failure_mode,
target_filters,
stack_filters,
alias,
hook_arn,
execution_role
FROM aws.cloudformation.lambda_hooks
WHERE region = 'us-east-1' AND data__Identifier = '<HookArn>';

INSERT example

Use the following StackQL query and manifest file to create a new lambda_hook resource, using stack-deploy.

/*+ create */
INSERT INTO aws.cloudformation.lambda_hooks (
LambdaFunction,
HookStatus,
TargetOperations,
FailureMode,
Alias,
ExecutionRole,
region
)
SELECT
'{{ LambdaFunction }}',
'{{ HookStatus }}',
'{{ TargetOperations }}',
'{{ FailureMode }}',
'{{ Alias }}',
'{{ ExecutionRole }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.cloudformation.lambda_hooks
WHERE data__Identifier = '<HookArn>'
AND region = 'us-east-1';

Permissions

To operate on the lambda_hooks resource, the following permissions are required:

Create

cloudformation:ListTypes,
cloudformation:ActivateType,
cloudformation:BatchDescribeTypeConfigurations,
cloudformation:DescribeType,
cloudformation:SetTypeConfiguration,
iam:PassRole

Read

cloudformation:BatchDescribeTypeConfigurations,
cloudformation:DescribeType

Update

cloudformation:BatchDescribeTypeConfigurations,
cloudformation:DescribeType,
cloudformation:SetTypeConfiguration,
iam:PassRole

Delete

cloudformation:BatchDescribeTypeConfigurations,
cloudformation:DeactivateType,
cloudformation:DescribeType,
cloudformation:SetTypeConfiguration

List

cloudformation:ListTypes,
cloudformation:BatchDescribeTypeConfigurations,
cloudformation:DescribeType