AWS CloudFormation Hooks Provide Proactive Validation of CloudFormation Operations

2022-03-12 02:58:53 By : Ms. Anna Temax

Attend QCon Plus online conference (May 10-20) and find practical inspiration from software leaders. Register

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Though quantum computers are in their infancy, their further development could make them commercially available. When that day comes, all public and private keys will be exposed to quantum threats, a massive risk for every organization. Understanding quantum computing growth and the impact it would have on cryptography is key for everyone, irrespective of their role.

Internal tools are critical pieces of software, often custom-built, and requiring significant developer bandwidth. Low-code platforms can optimize developer productivity, facilitate collaboration, and allow less technical employees to be more active in the development process.

Jendrik Jördening, Irene Dea, and Alanna Tempest take a look at the state of the art of ML/AI development and how advances in language technology (specifically differentiable programming langs) can help.

In this podcast Shane Hastie, first spoke to Chase Kocher of aim4hire about improving the recruitment process, finding the right people and finding the right job as a candidate, then to Kare Wardin, Engineering Manager for Developer Productivity at Netflix, about the challenges and opportunities when onboarding someone new in a remote environment and building developer experience that creates joy

The panelists discuss what microservices are, why companies are making the transition, how to identify the challenges when planning the move to microservices, and best practices for software quality.

Learn from practitioners driving innovation and change in software. Attend in-person on April 4-6, 2022.

Uncover emerging trends and practices from software leaders. Attend online on May 10-20, 2022.

Understand the emerging software trends you should pay attention to. Attend in-person on Oct 24-28, 2022.

InfoQ Homepage News AWS CloudFormation Hooks Provide Proactive Validation of CloudFormation Operations

AWS has announced the general availability of AWS CloudFormation Hooks which allow for custom logic prior to a create, update, or delete CloudFormation stack operation. CloudFormation hooks support versioning, public and private distribution, and can be published into multiple AWS accounts and regions.

CloudFormation Hooks provide proactive validation of CloudFormation operations by inspecting the resources that are to be provisioned. If a non-compliant resource is discovered, either a warning can be returned or the execution can be halted by failing the operation. Example use cases range from verifying that security groups will have the appropriate inbound and outbound traffic rules, restricting the usage of more expensive EC2 instances, or enforcing automatic backups be enabled for RDS instances.

The CloudFormation CLI is used to develop CloudFormation Hooks. CloudFormation Hooks are a supported extension type within the AWS CloudFormation registry. Developer plugins for hooks are available in Java and Python.

The AWS CloudFormation registry allows for management of extensions, including hooks, as both public and private resources. Public extensions are either published by AWS or by other third-parties. Extensions by AWS are always public and have their versioning controlled by AWS. Registered private extensions can be used for bespoke hooks and made available to the required AWS accounts by registering them. Publishing an extension into multiple regions can be done using AWS CloudFormation StackSets.

Generating the required hook project code can be done using the CloudFormation CLI by running the command cfn init. The next step is generating the hook schema which is a JSON-formatted text file that defines the properties and attributes for the hook. The hook handler code is then written in one of the supported developer plugin languages. Registering the hook with the private registry can be done using cfn submit --set-default.

Once complete, the hook can be enabled as follows:

When TargetStacks is set to ALL, the hook will apply to all stacks in the account during any CREATE, UPDATE, or DELETE operation. FailureMode can be set to either WARN or FAIL. The Properties object is where hook runtime properties, as defined within the hook schema, are provided.

AWS has released a number of sample hooks in both Python and Java. For example, the AWSSamples::S3BucketEncrypt::Hook sample will ensure that server-side encryption with KMS keys is enabled during the CREATE or UPDATE operations. If FAIL is set for FailureMode, then the following CloudFormation template would not be allowed to proceed as it does not specify encryption properties:

CloudFormation hooks run against all CloudFormation stacks including stacks created by CDK, SAM, AWS Amplify, and AWS Elastic Beanstalk. CloudFormation hook invocation events can be subscribed to in Amazon EventBridge by creating an event-bridge rule.

More information can be found within the AWS documentation. There are quotas in place that limit the number of hooks per account to 100, hooks per resource to 100, and the number of versions of each hook to 100. CloudFormation Hooks incur a charge by hook based on the number and duration of requests.

The industry’s only comprehensive Cloud Native Security Platform. Get a free trial now.

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

You need to Register an InfoQ account or Login or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

Real-world technical talks. No product pitches. Practical ideas to inspire you and your team. QCon London - April 4-6, In-person. QCon Plus - May 10-20, Online QCon brings together the world's most innovative senior software engineers across multiple domains to share their real-world implementation of emerging trends and practices. Find practical inspiration (not product pitches) from software leaders deep in the trenches creating software, scaling architectures and fine-tuning their technical leadership to help you make the right decisions.

InfoQ.com and all content copyright © 2006-2022 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with. Privacy Notice, Terms And Conditions, Cookie Policy