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
Metadata
Release files for aws-tag 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aws-tag-0.1.1.tar.gz | 26.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aws_tag-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.3 kB
Release files / aws-tag-0.1.1.tar.gz
| Download URL | aws-tag-0.1.1.tar.gz |
|---|---|
| Size | 26.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b099115b41c638e3488c007a7e8d46e381aa034486105436707064227a5f142b
|
|
BLAKE2b-256 checksum How to use checksums |
76dcc1d5210b51ac3c99eaea6e874007640e91444d9f840f889942bfe74ba7ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.4
|
Release files / aws_tag-0.1.1-py3-none-any.whl
| Download URL | aws_tag-0.1.1-py3-none-any.whl |
|---|---|
| Size | 44.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebe3d37f1a58f3da92bea249978a1216d4ee5cabfd1a298808d12bede778035c
|
|
BLAKE2b-256 checksum How to use checksums |
a9ac1e842c69f22ee587f563d07dbc6acdfe8b25e063d287abeae18b88b54754
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.4
|
Security for aws-tag 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.