`ls` but for your AWS VPC(s)

lsvpc

A simple AWS VPC listing tool to provide quick introspection on the makeup of a VPC

basic example

One really cool use of this tool is to run:

watch -c lsvpc -color

To produce a live-updating display of the status of your vpcs:

lsvpc and watch

Installation and running

From Source

sudo make install

which will install the executable into /usr/local/bin/. To install in a different directory, such as /usr/bin/, simply override the INSTALL variable:

sudo INSTALL=/usr/bin/ make install

If go has been installed using the tarball, the go binary is probably not reachable the sudoers secure_path, and the path variable will need to be overridden when invoking sudo:

sudo env "PATH=$PATH" make install

which will install the lsvpc binary into /usr/local/bin/

Fetching with go get

Alternatively, you don't need to actually clone this source, and with golang installed, you may simply call:

go get github.com/tjames-stig/lsvpc
sudo GOBIN=/usr/local/bin/ go install github.com/tjames-stig/lsvpc

to install lsvpc into /usr/local/bin/. GOBIN can be set to be the value of where you want the executable to be installed

Or you may simply tell go to run the binary using the repository path:

go run github.com/tjames-stig/lsvpc

Usage

Configuration and Permissions

This tool can make use of named profiles for authentication. Be sure to export AWS_PROFILE=<profile_name> before executing this tool so that it can access awscli credentials. It will otherwise seek credentials in the order specified here. The SharedConfig option for sessions is enabled, and it will automatically seek environment variables, shared config/credential files or instance metadata for sdk credentials.

If sdk library is unable to find a default region from credentials or environment variables, lsvpc will default to using us-east-1 for its operation.

Below are all of the SDK actions this tool uses, be sure that your aws credentials have IAM permissions for them:

ec2:DescribeEgressOnlyInternetGateways
ec2:DescribeInstances
ec2:DescribeInstanceStatus
ec2:DescribeInternetGateways
ec2:DescribeNatGateways
ec2:DescribeNetworkInterfaces
ec2:DescribeRegions
ec2:DescribeRouteTables
ec2:DescribeSubnets
ec2:DescribeTransitGatewayVpcAttachments
ec2:DescribeVolumes
ec2:DescribeVpcEndpoints
ec2:DescribeVpcPeeringConnections
ec2:DescribeVpcs
ec2:DescribeVpnGateways

Execution

Executing lsvpc with no arguments produces a colored readout of vpc resources detected in the default region of your aws profile

Parameters

-a, -all - Prints data for all regions in account

-nocolor - Suppresses color output. In general, lsvpc will also supress color if its output is piped

-color - Force color output. Overrides nocolor, and will print color even if lsvpc's output is being sent through a pipe

-nospace - Suppresses line spacing between entries.

-r, -region - Specify a region to print data for.

Owner
Comments
  • Implement Verbose

    Implement Verbose

    Implement a verbose option, which displays endpoints and instance enis/volumes

    this PR is chained off of 3 other PRs, and merging this will merge all the other changes from the previous

    closes #4

  • Nest interface endpoint enis under vpc endpoints

    Nest interface endpoint enis under vpc endpoints

    This PR is chained on top of my other two prs, so merging this will apply the others as well.

    Nest enis underneath vpc endpoints when they are associated with vpc endpoints

    closes #8

  • Implement JSON

    Implement JSON

    This branches off the previous depointerify pullrequest, so merging this and ignoring that PR will be a valid change.

    This is the first implementation of the json output for this command. The schema has not been set in stone yet, so there shouldn't be any major commitment of external tooling to this json format yet.

    closes #2

  • Depointerify internal data structure

    Depointerify internal data structure

    For various technical reasons, Datastructures obtained via api methods are actually pointers that are cumbersome to use and display. This PR will convert the lsvpc-specific internal representation of data from aws string pointers and int pointers to normal strings and ints.

    Also Name tags truncation has been disabled.

  • Sort lsvpc data structures internally

    Sort lsvpc data structures internally

    One of the bits of technical debt that accumulated is that lsvpc plays fast and loose with map data structures in order to perform complex stitching of data mapped in from multiple api calls, however the problem with maps is that they are not trivially sortable, and we are left with a core data model that is not inherently canonical.

    The first step towards producing a canonical data output of lsvpc is by being able to sort the constituent parts of the lsvpc data structure. This will be carried out by using a new struct definition heirarchy that uses lists instead of maps to use for final presentation of data. I dont want to abandon the maps-on-maps implementation because it is so handy for doing complex data stitching, so an intermediate stage where the data is sorted and presented as lists-of-lists will be implemented

    This sorting will also make printing logic immensely easier, and will also prepare the data for json marshalling.

  • Minimize 'details' option

    Minimize 'details' option

    Please provide a way to minimize details (such as MAC address, EBS info such as 'gp2' or '/dev/xvda1') for easier reading. Maybe make this the default with a '--more-info' or '--verbose' flag to turn it off and print everything?

Integrate AWS EKS Anywhere cluster with AWS Services
 Integrate AWS EKS Anywhere cluster with AWS Services

This article provides step-by-step instruction on integrating AWS EKS Anywhere with AWS Services so the applications running on customer data center can securely connect with these services.

Mar 6, 2022
Apis para la administracion de notifiaciones, utilizando servicios como AWS SNS y AWS SQS

notificacion_api Servicio para envío de notificaciónes por difusión en AWS SNS Especificaciones Técnicas Tecnologías Implementadas y Versiones Golang

Jan 7, 2022
AWS credential_process utility to assume AWS IAM Roles with Yubikey Touch and Authenticator App TOPT MFA to provide temporary session credentials; With encrypted caching and support for automatic credential refresh.
AWS credential_process utility to assume AWS IAM Roles with Yubikey Touch and Authenticator App TOPT MFA to provide temporary session credentials; With encrypted caching and support for automatic credential refresh.

AWS credential_process utility to assume AWS IAM Roles with Yubikey Touch and Authenticator App TOPT MFA to provide temporary session credentials; With encrypted caching and support for automatic credential refresh.

Dec 20, 2022
A package for access aws service using AWS SDK for Golang

goaws ?? A package for access aws service using AWS SDK for Golang Advantage with goaws package Example for get user list IAM with AWS SDK for Golang

Nov 25, 2021
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.

tutor-pet API Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure. Macro architecture: Code architecture: Pre-Re

Aug 17, 2022
Aws-parameter-bulk - Export AWS SSM Parameter Store values in bulk to .env files

aws-parameter-bulk Utility to read parameters from AWS Systems Manager (SSM) Par

Oct 18, 2022
Feb 7, 2022
Aws-cognito-demo-go - Source code for AWS Cognito in Go

AWS Cognito Demo in Go Source code for YouTube series, AWS Cognito in Go - https

Dec 10, 2022
Una prueba técnica: Servicio Golang REST API local, sobre Docker, gRPC, AWS Serverless y sobre Kubernetes en AWS EC2

Una prueba técnica: Servicio Golang REST API local, sobre Docker, gRPC, AWS Serverless y sobre Kubernetes en AWS EC2

May 7, 2022
Aws-cdk-go-examples - Example projects using the AWS CDK by Golang

aws-cdk-go-examples Example projects using the AWS CDK by Golang Useful commands

Nov 24, 2022
Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises
Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises

AWS, Turn off my Account, please Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises Resource

Oct 25, 2022
efsu is for accessing AWS EFS from your machine without a VPN

efsu: VPN-less access to AWS EFS efsu is for accessing AWS EFS from your machine without a VPN. It achieves this by deploying a Lambda function and sh

Mar 11, 2022
A "passwordless" login experience for your AWS RDS
A

RDS Auth Proxy A two-layer proxy for connecting into RDS postgres databases based on IAM authentication. This tool allows you to keep your databases f

Dec 28, 2022
Automatically roll your AWS IAM access key (aws_access_key_id) and secret key (aws_secret_access_key).

roll-it Keep your AWS Credentials fresh ?? on Windows, Mac, Linux (arm or x86)! What it Does Programmatically rotate your AWS IAM access keys and secr

Jan 6, 2023
Unofficial but convenient Go wrapper around the NVD API

NVD API The NVD API is an unofficial Go wrapper around the NVD API. Supports: CVE CPE How to use The following shows how to basically use the wrapper

Nov 1, 2021
Prig is for Processing Records In Go. Like AWK, but snobbish.

Prig: the snobbish AWK Prig is for Processing Records In Go. It's like AWK, but snobbish (Go! static typing!). It's also faster to execute, and if you

Sep 20, 2022
AWS SDK for the Go programming language.

AWS SDK for Go aws-sdk-go is the official AWS SDK for the Go programming language. Checkout our release notes for information about the latest bug fix

Dec 31, 2022
Simple tool to search tagged resources between all AWS resouces

Welcome to Cloud Inventory Tags ?? Simple tool to search tagged resources around all AWS Account Installation MacOS / OSX

Jan 26, 2022
Assume AWS IAM roles from GitHub Actions workflows with no stored secrets
Assume AWS IAM roles from GitHub Actions workflows with no stored secrets

AWS IAM roles for GitHub Actions workflows Background and rationale GitHub Actions are a pretty nice solution for CI/CD. Where they fall short is inte

Feb 12, 2022