Skip to content

jellis777/Stack-Resource-Lister

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stack Resource Lister (Go + AWS CloudFormation)

This project is a small Go command-line tool that lists the resources inside an AWS CloudFormation stack and shows their current status.

It is built to demonstrate basic Go structure, AWS SDK usage, and interaction with AWS CloudFormation.


What This Tool Does

  1. Accepts a CloudFormation stack name as a command-line argument
  2. Calls the AWS CloudFormation API
  3. Retrieves all resources in the stack
  4. Prints each resource’s logical ID and status in a table

Example output:

Logical ID                       Status
----------                       -----------
MySNSTopic                       CREATE_COMPLETE
MyLambdaFunction                 CREATE_COMPLETE
MyLambdaRole                     CREATE_COMPLETE

Why This Exists

This project was built to practice:

  • Using the AWS SDK for Go
  • Working with CloudFormation programmatically
  • Structuring a small Go CLI tool
  • Handling AWS configuration and API calls
  • Returning structured data and formatting output

Project Structure

Stack Resource Lister
├── main/
│   └── main.go        # CLI entry point
├── stacks.go          # CloudFormation logic
├── testdata/
│   └── template.yml   # Sample CloudFormation template
├── go.mod
└── go.sum

How It Works (High Level)

  • AWS credentials and configuration are loaded using the default AWS config
  • A CloudFormation client is created using the AWS SDK for Go
  • The tool calls DescribeStackResources
  • Each resource’s logical ID and status are collected and printed

Requirements

  • Go installed

  • AWS credentials configured locally

    • (via AWS CLI, environment variables, or shared config)
  • An existing CloudFormation stack


How to Run

go run main/main.go <stack-name>

Example:

go run main/main.go my-cloudformation-stack

Notes

  • This tool assumes AWS credentials are already configured
  • It focuses on clarity and learning rather than full production features
  • Error handling is kept simple and explicit

Purpose of This Project

This project is intentionally small.

It is meant to demonstrate:

  • Basic Go application structure
  • AWS SDK usage
  • CloudFormation resource inspection
  • Clear input/output handling in a CLI tool

It is not intended to be a full product

About

This project is a small Go command-line tool that lists the resources inside an AWS CloudFormation stack and shows their current status. It is built to demonstrate basic Go structure, AWS SDK usage, and interaction with AWS CloudFormation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages