Skip to main content

hook_versions

Creates, updates, deletes or gets a hook_version resource or lists hook_versions in a region

Overview

Namehook_versions
TypeResource
DescriptionPublishes new or first hook version to AWS CloudFormation Registry.
Idaws.cloudformation.hook_versions

Fields

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the type, here the HookVersion. This is used to uniquely identify a HookVersion resource
type_arnstringThe Amazon Resource Name (ARN) of the type without the versionID.
execution_role_arnstringThe Amazon Resource Name (ARN) of the IAM execution role to use to register the type. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. CloudFormation then assumes that execution role to provide your resource type with the appropriate credentials.
is_default_versionbooleanIndicates if this type version is the current default version
logging_configobjectSpecifies logging configuration information for a type.
schema_handler_packagestringA url to the S3 bucket containing the schema handler package that contains the schema, event handlers, and associated files for the type you want to register.
For information on generating a schema handler package for the type you want to register, see submit in the CloudFormation CLI User Guide.
type_namestringThe name of the type being registered.
We recommend that type names adhere to the following pattern: company_or_organization::service::type.
version_idstringThe ID of the version of the type represented by this hook instance.
visibilitystringThe scope at which the type is visible and usable in CloudFormation operations.
Valid values include:
PRIVATE: The type is only visible and usable within the account in which it is registered. Currently, AWS CloudFormation marks any types you register as PRIVATE.
PUBLIC: The type is publically visible and usable within any Amazon account.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTSchemaHandlerPackage, TypeName, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all hook_versions in a region.

SELECT
region,
arn,
type_arn,
execution_role_arn,
is_default_version,
logging_config,
schema_handler_package,
type_name,
version_id,
visibility
FROM aws.cloudformation.hook_versions
WHERE region = 'us-east-1';

Gets all properties from an individual hook_version.

SELECT
region,
arn,
type_arn,
execution_role_arn,
is_default_version,
logging_config,
schema_handler_package,
type_name,
version_id,
visibility
FROM aws.cloudformation.hook_versions
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

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

/*+ create */
INSERT INTO aws.cloudformation.hook_versions (
SchemaHandlerPackage,
TypeName,
region
)
SELECT
'{{ SchemaHandlerPackage }}',
'{{ TypeName }}',
'{{ region }}';

DELETE example

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

Permissions

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

Create

cloudformation:DescribeType,
cloudformation:DescribeTypeRegistration,
cloudformation:RegisterType,
iam:PassRole,
s3:GetObject,
s3:ListBucket,
kms:Decrypt

Read

cloudformation:DescribeType

Delete

cloudformation:DeregisterType,
cloudformation:DescribeType

List

cloudformation:ListTypes,
cloudformation:ListTypeVersions