GithubHelp home page GithubHelp logo

tapewriter's Introduction

Tapewriter(EC2 tag management tool)

Overview

Tapewriter is a tool to manage EC2 Tags.

Description

EC2 Tags managed from JSON file.

This tool can be the following usage.

  • current tag export
  • tags
    • update
    • append
    • delete

Requirement

  • python 2.7~
  • boto
  • ansicolor

Install

$ git clone xxx

Usage

options

-a --aws_access_key KEY           (default: ~/.aws/credentials or ~/.boto or /etc/boto.cfg)
-s --aws_secret_key KEY           (default: ~/.aws/credentials or ~/.boto or /etc/boto.cfg)
-c --credentials CREDENTIALS_FILE (default: ~/.aws/credentials or ~/.boto or /etc/boto.cfg)
-p --profile PROFILE_NAME         (default: default)
-r --region REGION_NAME           (default: all region, description: エクスポート対象となるregionを指定)
   --export EXPORT_FILE_NAME      (default: STDOUT, description: エクスポートの実行)
   --apply FILE_NAME              (default: None, description: タグを適用)
   --filter FILTER                (default: {}, description: エクスポート時に指定したタグのフィルタリングを実施)
   --dry-run                      (default: false, description: dry-run)

run

export to file from all region

$ tapewriter --export example.json

export to stdout from all region

$ tapewriter --export

export to stdout(use tag filter)

$ tapewriter --export --filter '{"Env":"dev", "Role":"app"}'

specified region

$ tapewriter -r ap-northeast-1 --export

specified credentials

$ tapewriter -c ./my_credential

check apply tag

$ tapewriter -r ap-northeast-1 --apply example.json --dry-run

apply tag

$ tapewriter -r ap-northeast-1 --apply example.json

JSON Format

{
  "instances": [
    {
      "id": "i-11111111",
      "region": "ap-northeast-1",
      "tags": {
        "Env": "dev",
        "Hostname": "www",
        "Name": "hoge"
      }
    },
    {
      "id": "i-22222222",
      "region": "ap-northeast-1",
      "tags": {
        "Env": "dev",
        "Hostname": "db",
        "Name": "fuga"
      }
    },
    {
      "id": "i-33333333",
      "region": "us-east-1",
      "tags": {
        "Env": "release",
        "Name": "piyo"
      }
    }
  ]
}

Notice

  • The following regions will be excluded.
    • cn-north-1
    • us-gov-west-1
  • Operation is slow, if using export to all regions. This problem will be resolved, You use -r or --region option.

Licence

MIT

Author

og732

tapewriter's People

Watchers

James Cloos avatar Masaki Ogawa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.