This is a follow up to these posts:

In the previous posts, we went over some jq tips with CloudFormation. We used jq to quickly summarize CloudFormation template parameters and resources. lono summary automates that process and makes the command short and sweet.

First, you’ll need to be in a lono project. You can quickly generate one with:

lono new infra
cd infra

Let’s download and summarize the parameters for a simple CloudFormation template with a single EC2 instance.

$ lono import https://s3.amazonaws.com/cloudformation-templates-us-east-1/EC2InstanceWithSecurityGroupSample.template --name ec2
$ lono summary ec2
CloudFormation Template Summary:
Parameters:
Required:
  KeyName (AWS::EC2::KeyPair::KeyName)
Optional:
  InstanceType (String) Default: t2.small
  SSHLocation (String) Default: 0.0.0.0/0
Resources:
  1 AWS::EC2::Instance
  1 AWS::EC2::SecurityGroup

Now another example, let’s download and summarize the parameters for a CloudFormation template with a typical AutoScaling stack.

$ lono import https://s3.amazonaws.com/cloudformation-templates-us-east-1/AutoScalingMultiAZWithNotifications.template --name asg
$ lono summary asg
CloudFormation Template Summary:
Parameters:
Required:
  VpcId (AWS::EC2::VPC::Id)
  Subnets (List<AWS::EC2::Subnet::Id>)
  OperatorEMail (String)
  KeyName (AWS::EC2::KeyPair::KeyName)
Optional:
  InstanceType (String) Default: t2.small
  SSHLocation (String) Default: 0.0.0.0/0
Resources:
  2 AWS::AutoScaling::ScalingPolicy
  2 AWS::CloudWatch::Alarm
  1 AWS::AutoScaling::LaunchConfiguration
  1 AWS::ElasticLoadBalancingV2::LoadBalancer
  1 AWS::ElasticLoadBalancingV2::Listener
  1 AWS::ElasticLoadBalancingV2::TargetGroup
  1 AWS::SNS::Topic
  1 AWS::EC2::SecurityGroup
  1 AWS::AutoScaling::AutoScalingGroup

That’s it! The official documentation is at lono.cloud/reference/lono-summary. Hope that helps! 🎉

Related Post: Lono Xgraph Tutorial Introduction - Visualizing the Dependency Graph