Bulk AWS resource tagging utility.
Project description
AWS Tag
Bulk AWS resource tagging utility. Tag AWS resources using a single interface with filter support to operate on a subset of resources.
Installation
Install the package using pip. Alternatively, you can also use pipx, which installs the package in an isolated environment and adds the package to the system path.
pip install aws-tag
Usage
There are four different operations that can be performed using this tool. Each operation (except import) supports filtering resources by name and tag values. Read filters and operators section for more details.
Available AWS Services
Services are selected using the --service
flag. The following services are currently supported.
--service <service-parameter>
Service | Parameter |
---|---|
API Gateway | agw |
DynamoDB | dynamodb |
Elastic Block Store | ebs |
EC2 | ec2 |
ECR | ecr |
ElastiCache | elasticache |
Kinesis Data Analytics | kda |
Kinesis Data Firehose | kdf |
Kinesis Data Stream | kds |
KMS | kms |
Lambda | lambda |
CloudWatch Logs | logs |
RDS | rds |
S3 | s3 |
SNS | sns |
SQS | sqs |
Filters and Operators
Filters are used to filter resources by name and tag values. Filters are specified using the following format:
--filter <key><operator><value>
Keys are the resource name or tag key. For tag keys just use the tag key as key. For resource names use the special
@name
key. Operators are used to specify the comparison operator. See the table below.
Operator | Description |
---|---|
= |
Equals |
!= |
Not equal |
~ |
Contains |
!~ |
Does not contain |
-- |
Does not exist |
^ |
Starts with |
!^ |
Does not start with |
$ |
Ends with |
!$ |
Does not end with |
Note that --
operator is used to check if a tag does not exist and has no value
associated with it. Please check
examples below.
List Resources
Find resources that have team=data
and environment=production
tags.
aws-tag list --service dynamodb --filter 'team=data' --filter 'environment=production'
Find resources that does not have a team
tag.
aws-tag list --service ec2 --filter 'team--'
Tag Resources
Add subteam=intelligence
tag for resources that have team=data
tag and resource name starting with intel-
.
aws-tag tag --service kds --filter 'team=data' --filter '@name^intel-' --tag 'subteam=intelligence'
Add environment=staging
tag for resources that have team=data
tag and resource name ending
with staging
.
aws-tag tag --service kdf --filter 'team=data' --filter '@name$staging' --tag 'environment=staging'
Export Tags
Export the tags of the resources that have team=data
tag to a csv file.
aws-tag export --service ebs --filter 'team=data' --file tags.csv
Export the team
and Name
tags for the resources that have team=data
tag to a csv file.
aws-tag export --service ebs --filter 'team=data' --export-tag 'team' --export-tag 'Name' --file tags.csv
Import Tags
Import the tags from a csv file and tag those resources.
aws-tag import --file tags.csv
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
Built Distribution
File details
Details for the file aws-tag-0.1.1.tar.gz
.
File metadata
- Download URL: aws-tag-0.1.1.tar.gz
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b099115b41c638e3488c007a7e8d46e381aa034486105436707064227a5f142b |
|
MD5 | 4b4fcf5b5a7cdce75c93ca7bfbd92240 |
|
BLAKE2b-256 | 76dcc1d5210b51ac3c99eaea6e874007640e91444d9f840f889942bfe74ba7ef |
File details
Details for the file aws_tag-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: aws_tag-0.1.1-py3-none-any.whl
- Upload date:
- Size: 44.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebe3d37f1a58f3da92bea249978a1216d4ee5cabfd1a298808d12bede778035c |
|
MD5 | 541204f5c389e8484575aba72a52a3c7 |
|
BLAKE2b-256 | a9ac1e842c69f22ee587f563d07dbc6acdfe8b25e063d287abeae18b88b54754 |