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

NameResourceAccessible byRequired Params
create_resourcelambda_hooksINSERTLambdaFunction, FailureMode, Alias, ExecutionRole, TargetOperations, HookStatus, region
delete_resourcelambda_hooksDELETEIdentifier, region
update_resourcelambda_hooksUPDATEIdentifier, PatchDocument, region
list_resourceslambda_hooks_list_onlySELECTregion
get_resourcelambda_hooksSELECTIdentifier, region

SELECT examples

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 awscc.cloudformation.lambda_hooks
WHERE
region = 'us-east-1' AND
Identifier = '{{ hook_arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.cloudformation.lambda_hooks (
LambdaFunction,
HookStatus,
TargetOperations,
FailureMode,
Alias,
ExecutionRole,
region
)
SELECT
'{{ lambda_function }}',
'{{ hook_status }}',
'{{ target_operations }}',
'{{ failure_mode }}',
'{{ alias }}',
'{{ execution_role }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.cloudformation.lambda_hooks
SET PatchDocument = string('{{ {
"LambdaFunction": lambda_function,
"HookStatus": hook_status,
"TargetOperations": target_operations,
"FailureMode": failure_mode,
"TargetFilters": target_filters,
"StackFilters": stack_filters,
"ExecutionRole": execution_role
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ hook_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.cloudformation.lambda_hooks
WHERE
Identifier = '{{ hook_arn }}' AND
region = 'us-east-1';

Permissions

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

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