Package: cloudformation-cli-hooks-extension
AWS CloudFormation CLI Hooks ExtensionThe CloudFormation CLI (cfn) allows you to author your own CFN extension providers that can be used by CloudFormation.This extension library provides more commands for managing and configuring your Resource Hooks.DocumentationPrimary documentation for the CloudFormation CLI can be found at theAWS Documentationsite.InstallationIf you are using this package to build hook providers for CloudFormation, install theCloudFormation CLI Hooks Extension- this will automatically install the theCloudFormation CLI! A Python virtual environment is recommended.pip3installcloudformation-cli-hooks-extensionUsageAll of these commands are meant to be run from inside your pre-initialized Hooks project directory. You can initialize a new project by using thecfn initcommand from theCloudFormation CLI. All of the commands use thecfn hookprefix, ex.cfn hook describe.Command: describeTo get more details about hook versions registered in your account, use thedescribecommand. This will return the following properties:DescriptionCreated atLast updated atDefault versionFailure modeTarget stacksStack filters (if any)Configured propertiesTarget typesTesting statusThe details for the default version will be returned by deafult. Optionally, the--version-idcan be passed to describe a specific version.cfnhookdescribeSample output:No version specified, using default version

Selected AWS::CloudFormation::SampleHook version 00000001

Description: Example hook
Version 00000001 Created at: 2023-09-28 04:44:14.402000+00:00
Version 00000001 Last updated at: 2023-09-28 04:44:14.402000+00:00

Current configuration (only applies to default version):
  Default version: 00000001
  Configured behavior:
    Failure mode: WARN
    Target stacks: ALL
    Stack Filters:
      Filtering Criteria: ANY
      StackNames:
        Include: ['stack-name-0', 'stack-name-1', 'stack-name-2']
        Exclude: ['stack-name-3', 'stack-name-4', 'stack-name-5']
      StackRoles:
        Exclude: ['arn:aws:iam::000000000000:role/stack-role-0', 'arn:aws:iam::000000000000:role/stack-role-1', 'arn:aws:iam::000000000000:role/stack-role-2']

  No configured properties.

This Hook is configured to target:
  preCreate:
    AWS::S3::Bucket

Testing status: NOT_TESTED
 Warning: This Type version hasn't been tested yet. Run TestType to test it.Command: set-default-versionTo set a specific version of your hooks as the default version, use theset-default-versioncommand.cfnhookset-default-version--version-id1This command return nothings, but you can then usecfn hook describeto check the default version set in your account.Command: configureTo set the type configuration of your hook, use theconfigurecommand.You will first need to save your type configuration as a json file and then specify the file path in the command.cfnhookconfigure--configuration-path./myHookTypeConfig.jsonSample output:ConfigurationArn: arn:aws:cloudformation:us-east-1:000000000000:type-configuration/hook/AWS-CloudFormation-SampleHook/defaultDevelopmentFor developing, it's strongly suggested to install the development dependencies inside a virtual environment. (This isn't required if you just want to use this tool.)python3-mvenvenvsourceenv/bin/activate
pip3install-e/path/to/cloudformation-cli-hooks-extensionInstallpytest-cov, used when running unit tests for this plugin:pip3installpytest-covYou may also want to check out theCloudFormation CLIif you wish to make edits to that. In this case, installing them in one operation works well:pip3install\-e/path/to/cloudformation-cli\-e/path/to/cloudformation-cli-hooks-extensionThat ensures neither is accidentally installed from PyPI.SecuritySeeCONTRIBUTINGfor more information.LicenseThis project is licensed under the Apache-2.0 License.