cobra_cli_go

command module
v0.0.0-...-341deac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

Cobra CLI

Example of cobra go cli interacting with AWS API for automation tasks

Structure

|____cmd
|      |____root_command.go -> root command definition
|____LICENSE -> licence
|____Makefile -> installation Makefile
|____config.yaml -> defining aws config profile and region
|____templates
|      |____distributed_file_system.yaml -> keeps cloudformation stacks
|____aws
|      |____version.go -> command to determine version of tool
|      |____session.go -> creates an aws session
|      |____cloudformation.go -> cloudformation aws client
|      |____ec2.go -> ec2 aws client
|____main.go

Install Devops-tool

  1. Prerequisites

Go installation https://golang.org/doc/install

  1. Go to project root (currently installation is for mac)

make install

  1. You will need a user with relevant permissions to interact with the tool. Setup aws with the user's credentials

aws configure --profile <your_profile>

  1. Add <your_profile> to config.yaml

  2. To interact with devops-tool examples

devops-tool help
devops-tool create-efs help
devops-tool delete-efs help

Example creating efs:
devops-tool create-efs -k efskeypair -s efsstack -v vpc-703***09 -m ami-035b3c7efe6d061d5 -n=subnet-49b**02,subnet-55d***79 -c CAPABILITY_NAMED_IAM

Example deleting efs:
devops-tool delete-efs -k efskeypair -s efsstack

Notes

Bug:

pem file created will need to have chmod modified chmod 400 efskeypair.pem before connecting to ec2 instance

Demo Video:

Watch the video

Architecture

Alt text

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL