Skip to main content

Read any resource in your AWS Account. You can generate terraform code for them, too.

Project description

balcony

Build and publish a Docker image to ghcr.io

Build and Deploy Documentation website

balcony is a modern CLI tool that with some killer features:

  • Auto-fill the required parameters for AWS API calls
  • Read the JSON data of any AWS resource in your account
  • Generate Terraform Import Blocks
  • Generate actual .tf Terraform Resource code

balcony uses read-only operations, it does not take any action on the used AWS account.

Visit the Documentation Website

Installation

Visit Installation & QuickStart Page to get started using balcony

pip3 install balcony

You can also use uv to get balcony.

brew install uv

uvx balcony info
# see options
balcony

# list available resources of ec2
balcony aws ec2 

# read a resource
balcony aws s3 Buckets

# show documentation
balcony aws iam Policy --list

# generate terraform import blocks for a resource
balcony terraform-import s3 Buckets

Features

Read any AWS Resource

balcony aws <service> <resource-name> --paginate command reads all resources of a given type in your AWS account.

Related Docs: QuickStart


Filter and Exclude by Tags

  • aws-jmespath-utils dependency is used to enable JMESPath expressions to filter and exclude resources by tags
  • Following expressions are used to select anything: (=, *=, =*, *=*)
    • You can leave one side empty or put a * there to discard that sides value

Filter tags

  • Select everything

    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].filter_tags(`["="]`, @).Tags'
    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].filter_tags(`["*="]`, @).Tags'
    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].filter_tags(`["=*"]`, @).Tags'
    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].filter_tags(`["*=*"]`, @).Tags'
    
  • Find named EC2 Instances

    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].filter_tags(`["Name="]`, @)'
    
  • Find AWS MAP migration tagged EC2 Instances

    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].filter_tags(`["map-migrated="]`, @)'
    

Exclude tags

  • Exclude everything

    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].exclude_tags(`["="]`, @).Tags'
    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].exclude_tags(`["*="]`, @).Tags'
    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].exclude_tags(`["=*"]`, @).Tags'
    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].exclude_tags(`["*=*"]`, @).Tags'  
    
  • Find un-named EC2 Instances

    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].exclude_tags(`["Name="]`, @)'
    
  • Find AWS MAP migration un-tagged EC2 Instances

    balcony aws ec2 Instances -js 'DescribeInstances[].Reservations[].Instances[].exclude_tags(`["map-migrated="]`, @)'
    

Generate Terraform Import Blocks

Terraform v1.5 introduced import blocks that allows users to define their imports as code.

balcony terraform-import <service> <resource-name> command generates these import blocks for you.

balcony terraform-import --list to see the list of supported resources.

Related Docs: Generate Terraform Import Blocks Related Docs: Balcony Terraform Import Support Matrix


Generate actual Terraform Resource Code

If you have:

  • initialized terraform project
  • import_blocks.tf file that's generated with balcony terraform-import command

you can run terraform plan -generate-config-out=generated.tf to generate actual .tf resource code.

This feature is achieved with the balcony-terraform-import Docker Image.

Related Docs: Generate Terraform Code with Docker Image


Interactive Wizard to create balcony import configurations

Balcony doesn't know how to create terraform import blocks for all of the AWS resources.

It can be taught how to do it by creating import-configurations yaml files, but it's a manual process. This is where the interactive wizard comes in.

Interactive Wizards asks you required questions to automatically create the import-configurations yaml files.

Related Docs: Terraform Import Configuration Wizard

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

balcony-0.3.10.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

balcony-0.3.10-py3-none-any.whl (68.0 kB view details)

Uploaded Python 3

File details

Details for the file balcony-0.3.10.tar.gz.

File metadata

  • Download URL: balcony-0.3.10.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for balcony-0.3.10.tar.gz
Algorithm Hash digest
SHA256 8e081d3f778a51e2cc1c6d586ed8c89a6fbdb872b25a1a2c2e4b9ab026d2f27b
MD5 4bda87fab8721cab497c4d88fefd1504
BLAKE2b-256 fd29753d0f3a4b381f6e31adfde996a460c5a81387db4bc5ec26959716d5433b

See more details on using hashes here.

File details

Details for the file balcony-0.3.10-py3-none-any.whl.

File metadata

  • Download URL: balcony-0.3.10-py3-none-any.whl
  • Upload date:
  • Size: 68.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for balcony-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 eebc0c4361dacfaba92472c4639b6d2516146acb5b7f03d82190dc2b7894d68e
MD5 1a4f5f79df840b433b7032e3498de1d2
BLAKE2b-256 d82f995a8ad16590af960b0e3f0d7c1407f0251b73a58f245015d56d4a2c5881

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page