Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

bkdinoop/awstagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS TAGGER

This is a simple python script to create and remove aws-tag for any resource in a particular AWS region. Configuration file and Information file are the two file where user have to define the aws details. In configuration file we need to mention region,access-key,secret-key,operation (add or remove the give tags) and information file. In information file, we have to define the resource and tagging details.

Dependecy : boto, python2.7

Config File

It contains information for aws and file name. Operation is a keyword where we have to mention, whether you need to remove or add the tags to resource

Each line should have one value,

  1. Region should be specified with variable 'region', single colon ':', region value.
  2. Access key should be specified with variable 'ak', single colon ":" , accesskey value.
  3. Secret key should be specified with variable 'sk', single colon ":" , secretkey value.
  4. Filename should be specified with variable 'filename', single colon ":" , filename value.
  5. Operation should be specified with variable 'operation', single colon ":", add or remove, here we have to mention whether we need to add or remove the tags in aws.

#Please refer the sample config file given in repository

Information file

Values should be stored in a manner that scripts should understand. Line starting with '#' symbol are treated as comment.

Values should be given in below format:

  1. res-id,tag-key:tag-value,tag1-key:tag1-value,tag2-key:tag2-value,... ,tag10-key:tag10-value
  2. Resource-id should be given first then tag values related to the resource id, all are seperated by comma.
  3. Every tagkey and tag value should be seperated by colon
  4. Each tag-key-value pair are seperated by comma.

How to run the script

Main Script file is awstag.py, which depends on a config file where you specify the aws and file details

  1. Create a text file where you have to store res-id and tagging values.
  2. Create a config file, here we have to mention the aws details, what operation you need to do and file path where tagging and resource id is mentioned
  3. Run the python script
$ python awstag.py

##############################################################
#Config file should be in same folder where the python script is there
#Config should contain aws region, aws credential details and tagging information filename
#########################################################
  
Enter the config file-name : 
  1. It will prompt for config file like above

All resource id will be tagged

#eNjoy tagging

About

Simple aws resource tagger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages