aws-tag


Nameaws-tag JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryBulk AWS resource tagging utility.
upload_time2024-03-18 16:51:15
maintainer
docs_urlNone
authorDeniz Parmaksız
requires_python>=3.8
license
keywords aws tag tagging tagger
VCS
bugtrack_url
requirements boto3 botocore jmespath numpy pandas pathvalidate python-dateutil pytz s3transfer six tabulate urllib3
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://packaging.python.org/en/latest/guides/installing-stand-alone-command-line-tools/), which installs 
the package in an isolated environment and adds the package to the system path.

```bash
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](#filters-and-operators) section for more
details.

- [List resources](#list-resources)
- [Tag resources](#tag-resources)
- [Export tags](#export-tags)
- [Import tags](#import-tags)

### 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.

```bash
aws-tag list --service dynamodb --filter 'team=data' --filter 'environment=production'
```

Find resources that does not have a `team` tag.

```bash
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-`.

```bash
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`.

```bash
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.

```bash
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.

```bash
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.

```bash
aws-tag import --file tags.csv
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "aws-tag",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "aws,tag,tagging,tagger",
    "author": "Deniz Parmaks\u0131z",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/76/dc/c1d5210b51ac3c99eaea6e874007640e91444d9f840f889942bfe74ba7ef/aws-tag-0.1.1.tar.gz",
    "platform": null,
    "description": "# AWS Tag\n\nBulk AWS resource tagging utility. Tag AWS resources using a single interface with filter support\nto operate on a subset of resources.\n\n## Installation\n\nInstall the package using pip. Alternatively, you can also use \n[pipx](https://packaging.python.org/en/latest/guides/installing-stand-alone-command-line-tools/), which installs \nthe package in an isolated environment and adds the package to the system path.\n\n```bash\npip install aws-tag\n```\n\n## Usage\n\nThere are four different operations that can be performed using this tool. Each operation (except import) supports\nfiltering resources by name and tag values. Read [filters and operators](#filters-and-operators) section for more\ndetails.\n\n- [List resources](#list-resources)\n- [Tag resources](#tag-resources)\n- [Export tags](#export-tags)\n- [Import tags](#import-tags)\n\n### Available AWS Services\n\nServices are selected using the `--service` flag. The following services are currently supported.\n\n```\n--service <service-parameter>\n```\n\n| Service                | Parameter   |\n|------------------------|-------------|\n| API Gateway            | agw         |\n| DynamoDB               | dynamodb    |\n| Elastic Block Store    | ebs         |\n| EC2                    | ec2         |\n| ECR                    | ecr         |\n| ElastiCache            | elasticache |\n| Kinesis Data Analytics | kda         |\n| Kinesis Data Firehose  | kdf         |\n| Kinesis Data Stream    | kds         |\n| KMS                    | kms         |\n| Lambda                 | lambda      |\n| CloudWatch Logs        | logs        |\n| RDS                    | rds         |\n| S3                     | s3          |\n| SNS                    | sns         |\n| SQS                    | sqs         |\n\n### Filters and Operators\n\nFilters are used to filter resources by name and tag values. Filters are specified using the following format:\n\n```\n--filter <key><operator><value>\n```\n\nKeys are the resource name or tag key. For tag keys just use the tag key as key. For resource names use the special\n`@name` key. Operators are used to specify the comparison operator. See the table below.\n\n| Operator | Description         |\n|----------|---------------------|\n| `= `     | Equals              |\n| `!=`     | Not equal           |\n| `~`      | Contains            |\n| `!~`     | Does not contain    |\n| `--`     | Does not exist      |\n| `^ `     | Starts with         |\n| `!^`     | Does not start with |\n| `$ `     | Ends with           |\n| `!$`     | Does not end with   |\n\nNote that ``--`` operator is used to check if a tag does not exist and has no `value` associated with it. Please check\nexamples below.\n\n### List Resources\n\nFind resources that have `team=data` and `environment=production` tags.\n\n```bash\naws-tag list --service dynamodb --filter 'team=data' --filter 'environment=production'\n```\n\nFind resources that does not have a `team` tag.\n\n```bash\naws-tag list --service ec2 --filter 'team--'\n```\n\n### Tag Resources\n\nAdd `subteam=intelligence` tag for resources that have `team=data` tag and resource name starting with `intel-`.\n\n```bash\naws-tag tag --service kds --filter 'team=data' --filter '@name^intel-' --tag 'subteam=intelligence'\n```\n\nAdd `environment=staging` tag for resources that have `team=data` tag and resource name ending\nwith `staging`.\n\n```bash\naws-tag tag --service kdf --filter 'team=data' --filter '@name$staging' --tag 'environment=staging'\n```\n\n### Export Tags\n\nExport the tags of the resources that have `team=data` tag to a csv file.\n\n```bash\naws-tag export --service ebs --filter 'team=data' --file tags.csv\n```\n\nExport the `team` and `Name` tags for the resources that have `team=data` tag to a csv file.\n\n```bash\naws-tag export --service ebs --filter 'team=data' --export-tag 'team' --export-tag 'Name' --file tags.csv\n```\n\n### Import Tags\n\nImport the tags from a csv file and tag those resources.\n\n```bash\naws-tag import --file tags.csv\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Bulk AWS resource tagging utility.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/dnzprmksz/aws-tag",
        "Issues": "https://github.com/dnzprmksz/aws-tag/issues"
    },
    "split_keywords": [
        "aws",
        "tag",
        "tagging",
        "tagger"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9ac1e842c69f22ee587f563d07dbc6acdfe8b25e063d287abeae18b88b54754",
                "md5": "541204f5c389e8484575aba72a52a3c7",
                "sha256": "ebe3d37f1a58f3da92bea249978a1216d4ee5cabfd1a298808d12bede778035c"
            },
            "downloads": -1,
            "filename": "aws_tag-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "541204f5c389e8484575aba72a52a3c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 44711,
            "upload_time": "2024-03-18T16:51:13",
            "upload_time_iso_8601": "2024-03-18T16:51:13.909648Z",
            "url": "https://files.pythonhosted.org/packages/a9/ac/1e842c69f22ee587f563d07dbc6acdfe8b25e063d287abeae18b88b54754/aws_tag-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76dcc1d5210b51ac3c99eaea6e874007640e91444d9f840f889942bfe74ba7ef",
                "md5": "4b4fcf5b5a7cdce75c93ca7bfbd92240",
                "sha256": "b099115b41c638e3488c007a7e8d46e381aa034486105436707064227a5f142b"
            },
            "downloads": -1,
            "filename": "aws-tag-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4b4fcf5b5a7cdce75c93ca7bfbd92240",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26594,
            "upload_time": "2024-03-18T16:51:15",
            "upload_time_iso_8601": "2024-03-18T16:51:15.811461Z",
            "url": "https://files.pythonhosted.org/packages/76/dc/c1d5210b51ac3c99eaea6e874007640e91444d9f840f889942bfe74ba7ef/aws-tag-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 16:51:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dnzprmksz",
    "github_project": "aws-tag",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "boto3",
            "specs": [
                [
                    "==",
                    "1.26.47"
                ]
            ]
        },
        {
            "name": "botocore",
            "specs": [
                [
                    "==",
                    "1.29.47"
                ]
            ]
        },
        {
            "name": "jmespath",
            "specs": [
                [
                    "==",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.24.1"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "1.5.2"
                ]
            ]
        },
        {
            "name": "pathvalidate",
            "specs": [
                [
                    "==",
                    "2.5.2"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.8.2"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2022.7"
                ]
            ]
        },
        {
            "name": "s3transfer",
            "specs": [
                [
                    "==",
                    "0.6.0"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "tabulate",
            "specs": [
                [
                    "==",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.13"
                ]
            ]
        }
    ],
    "lcname": "aws-tag"
}
        
Elapsed time: 0.22532s