Kumogata2

CloudFormation

Write and deploy CloudFormation templates in a Ruby DSL

Manages
AWS CloudFormation
Language
Ruby
Package
kumogata2
CLI
kumogata2
Config file
template.rb
The upstream repository is archived and has seen no activity since 2018; pin your gem version, and evaluate AWS CDK or Terraform for new CloudFormation-based projects.
template.rb
AWSTemplateFormatVersion "2010-09-09"

Parameters do
  InstanceType do
    Default "t1.micro"
    Description "Instance Type"
    Type "String"
  end
end

Resources do
  myEC2Instance do
    Type "AWS::EC2::Instance"
    Properties do
      ImageId "ami-XXXXXXXX"
      InstanceType { Ref "InstanceType" }
      KeyName "your_key_name"
    end
  end
end
In short

Kumogata2 is a command-line tool that writes AWS CloudFormation templates in a Ruby DSL instead of JSON or YAML. It converts between formats, diffs templates logically, and previews updates as CloudFormation change sets before deploying stacks.

What is Kumogata2?

Kumogata2 is a tool for AWS CloudFormation. It lets you write templates in a short Ruby DSL instead of raw JSON or YAML. It is the successor to the original Kumogata, rebuilt on aws-sdk v2 with a plugin system for template formats.

The pain it removes is verbosity. Hand-written CloudFormation JSON is long and easy to get wrong. Kumogata2 keeps the same structure, Parameters, Resources, and Outputs, but with far less noise. You also get real loops and variables when you need them. Unlike most of the codenization family, it drives everything through CloudFormation itself, not the service APIs.

Two commands make it stand out:

  • convert translates between Ruby, JSON, and YAML
  • diff compares templates logically, even against a running stack via stack:// URLs

It fits Ruby-minded teams committed to CloudFormation who want cleaner templates and safer deploys through change sets. It pairs well with API-level tools like Roadworker for DNS.

Key facts
  • Writes AWS CloudFormation templates in a compact Ruby DSL.
  • The template file is usually named template.rb.
  • convert moves templates between Ruby, JSON, and YAML.
  • Dry-run builds a real change set, the most trustworthy preview for stacks.
  • diff can compare your file against a live stack over stack:// URLs.
  • Archived since 2018; weigh CDK or Terraform for new work.
Illustration: AWS CloudFormation managed as code with Kumogata2
Getting started

Install and run Kumogata2

1

Install

Install the kumogata2 gem (Ruby required).

$ gem install kumogata2
2

Export current state

Pull the live CloudFormation configuration into a template.rb.

$ kumogata2 export my-stack
3

Dry-run, then apply

Preview the diff, then apply the change for real.

$ kumogata2 dry-run template.rb my-stack

Kumogata2 adapts the export, review, apply loop to CloudFormation's stack model. For an existing stack, run kumogata2 export to pull down its template. Convert it to the Ruby DSL with kumogata2 convert, then commit the result, for example as template.rb, to Git.

Changes are edits to the template in a branch. Check syntax with kumogata2 validate, then run kumogata2 dry-run. That creates a CloudFormation change set and prints it without executing, so you see which resources would be added, changed, or replaced. You can also run kumogata2 diff against a stack:// URL to compare with the live template. Once reviewed, kumogata2 update applies it, or deploy runs a full change set end to end.

Pro tip

Always run kumogata2 dry-run before an update. It builds a real change set, so you can spot a property change that would replace a database while there is still time to stop.

Capabilities

What Kumogata2 can do

Ruby DSL for CloudFormation

Templates keep CloudFormation's exact structure: Parameters, Resources, Outputs, and Ref. They just read as Ruby blocks, with the full language available for loops and reuse.

Change-set dry-run

kumogata2 dry-run creates a change set and shows it without executing. You see which resources would be added, changed, or replaced before an update.

Logical template diff

kumogata2 diff compares templates by meaning, not text. It accepts files, http:// URLs, or stack:// references, so you can diff your file against the live stack.

Format conversion

kumogata2 convert translates between the Ruby DSL, JSON, and YAML. Adopting the DSL for an existing stack, or leaving it later, is one command.

Full stack lifecycle

Subcommands cover create, update, deploy, delete, validate, export, and list. show-events, show-outputs, and show-resources handle inspection.

Plugin architecture

Template format handling is pluggable. New input formats can be added through gems, without changing the core tool.

Handy Kumogata2 subcommands
Beyond the basic loop, these commands make CloudFormation work safer and easier.
CommandWhat it does
convertTranslate a template between Ruby, JSON, and YAML
diffCompare two templates logically, including stack://
validateCheck template syntax before a change set
deployCreate and execute a change set in one step
show-eventsWatch stack events as an update runs
In practice

When teams reach for Kumogata2

Taming verbose CloudFormation JSON

Teams with thousands of lines of JSON convert them once and maintain the Ruby DSL instead. The structure stays identical, so CloudFormation knowledge carries over, but reviews get much shorter.

Safer stack updates with change sets

Resource replacement is CloudFormation's sharpest edge. An innocent property change can recreate a database. Running dry-run before every update surfaces replacements while there is still time to reconsider.

Auditing drift between template and stack

With diff's stack:// support, you compare the template in Git against what a stack is really running. That answers 'did someone update this outside the repo?' in one command.

Generating repetitive resources

Because templates are Ruby, a fleet of similar resources can be built with a loop instead of copy-paste. The output is still plain CloudFormation underneath.

FAQ

Kumogata2 questions, answered

How is Kumogata2 different from the original Kumogata?
Kumogata2 is the successor to kumogata. It is rebuilt around aws-sdk v2, with a plugin-based template-format system and change-set commands like deploy and dry-run. The Ruby DSL is essentially the same, so v1 templates carry over.
Do I have to rewrite my existing templates in Ruby?
No. Kumogata2 accepts JSON and YAML templates too. kumogata2 convert translates between formats in either direction. A common path is exporting a stack, converting it to the DSL, and using diff to confirm the result is logically identical.
How does dry-run work here compared to other codenize tools?
Most codenize tools compute diffs against service APIs directly. Kumogata2 instead asks CloudFormation for a change set and shows it. So the preview is exactly what CloudFormation will run, including resource replacements. That makes it a very trustworthy dry-run.
Is Kumogata2 still maintained? What should I use instead?
No. The repository is archived and last saw activity in 2018. Existing users should pin gem versions. For new projects, consider AWS CDK, which offers a similar code-to-CloudFormation model with official support, or Terraform. See our codenize-tools vs Terraform guide for the trade-offs.
Can Kumogata2 manage resources CloudFormation does not support?
No. Kumogata2 is strictly a CloudFormation front end, so its coverage equals CloudFormation's. For services you prefer to manage at the API level, like DNS, IAM, and security groups, the dedicated codenize tools such as Roadworker, Miam, and Piculet fit better.