{"id":16119064,"url":"https://github.com/germainlefebvre4/aws-python","last_synced_at":"2025-07-07T00:06:30.133Z","repository":{"id":80782642,"uuid":"126184435","full_name":"germainlefebvre4/aws-python","owner":"germainlefebvre4","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-19T14:12:25.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T10:16:53.639Z","etag":null,"topics":["aws","aws-ec2","aws-sdk","aws-vpc","boto3","python","python2","resource-group"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/germainlefebvre4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-21T13:39:09.000Z","updated_at":"2019-04-19T14:12:26.000Z","dependencies_parsed_at":"2023-04-07T09:31:00.252Z","dependency_job_id":null,"html_url":"https://github.com/germainlefebvre4/aws-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/germainlefebvre4/aws-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/germainlefebvre4%2Faws-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/germainlefebvre4%2Faws-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/germainlefebvre4%2Faws-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/germainlefebvre4%2Faws-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/germainlefebvre4","download_url":"https://codeload.github.com/germainlefebvre4/aws-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/germainlefebvre4%2Faws-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263991444,"owners_count":23540665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-ec2","aws-sdk","aws-vpc","boto3","python","python2","resource-group"],"created_at":"2024-10-09T20:52:31.295Z","updated_at":"2025-07-07T00:06:30.104Z","avatar_url":"https://github.com/germainlefebvre4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS SDK Python scripts\n\nSome useful scripts to list or clean entire environments.\n\n**Table of Contents**\n1. [Requirements](#requirements)\n2. [AWS Configuration](#aws-configuration)\n   1. [Create an Access Key](#create-an-access-key)\n   2. [Configure credentials](#configure-credentials)\n      1. [Guided configuration](#guided-configuration)\n      2. [Manual configuration](#manual-configuration)\n3. [Running the scripts](#running-the-scripts)\n   1. [Delete VPCs resources](#delete-vpcs-resources)\n      1. [Description](#description)\n      2. [Usage](#usage)\n      3. [Examples](#examples)\n   2. [List resources with their owner](#list-resources-with-their-owner)\n      1. [Description](#description)\n      2. [Usage](#usage)\n      3. [Examples](#examples)\n   3. [Delete Main AWS Services from Region](#delete-main-aws-services-from-region)\n      1. [Description](#description)\n      2. [Usage](#usage)\n      3. [Examples](#examples)\n\n## Requirements\nThese scripts depends on `boto3` package, the AWS SDK for Python and require Python 2.6+.\nYou can install `boto3`using yum\n```bash\n$ yum install python2-boto3\n```\nor using pip\n```bash\n$ pip install boto3\n```\n\n## AWS configuration\n\n### Create an Access Key\nTo use AWS API calls you need to make your account reachable with an Access Account. \n\nSee the [Security Credentials](http://aws.amazon.com/security-credentials) page for more information on getting your keys. For more information on configuring boto3, check out the Quickstart section in the [developer guide](https://boto3.readthedocs.org/en/latest/guide/quickstart.html).\n\n### Configure credentials\nYou need to set up your AWS security credentials previously created to allow the API calls.\n\n#### Guided configuration\nYou can use the AWS CLI to configure aws credentials. In that case you need to install the `awscli` with yum\n```bash\n$ yum install -y awscli\n```\nor pip\n```bash\n$ pip install awscli --upgrade --user\n```\n\nNow run `aws configure` and fill the fields `ACCESS_KEY`, `SECRET`and `REGION`.\n```bash\n$ aws configure\n```\n\nYour aws profile is ready.\n\n#### Manual configuration\nOn Linux environments fill the configuration file at `~/.aws/credentials` with your credentials previously made :\n```bash\n$ vi ~/.aws/credentials\n```\n```ini\n[default]\naws_access_key_id = \u003cyour access key id\u003e\naws_secret_access_key = \u003cyour secret key\u003e\n```\n\n(optionnal) You can also fill the `~/.aws/config` file to set your region on default profile\n```bash\n$ vi ~/.aws/config\n```\n```ini\n[default]\nregion = \u003cyour aws region\u003e # e.g. region = eu-central-1\n```\n\nYour aws profile is ready.\n\n\n## Running the scripts\n\n### Delete VPCs resources\n**Beware!** *You need to provide AWS Access Key with high rights elevation.*\n\n#### Description\nName: `delete_vpcs.py`\nDescription: Clear non-default resources on the region (from your profile or in parameter of the script).\nTechnical: This script mainly uses `boto3.resource` class to instanciate AWS entities.\nParameters:\n* `--check` : (none) Enable check mode and do not apply deletions\n* `--region_name \u003cregion\u003e` : (string) Name of the (only one) AWS Region (e.g. eu-west-1, eu-central-1)\n\n#### Usage\n```bash\n$ ./delete_vpcs.py\n```\n```\n+-----------------------------------+\n|    Delete non default VPCs and    |\n|       and its sub-resources       |\n+-----------------------------------+\n```\n\n#### Examples\n\nShow some help on usage\n```bash\n$ ./delete_vpcs.py -h\n```\n\nRun on Dry Run\n```bash\n$ ./delete_vpcs.py --check\n```\n\nRun on a specific region (parameter override profile)\n```bash\n$ ./delete_vpcs.py --region_name=eu-central-1\n```\n\n\n### List resources with their owner\n\n#### Description\nName: `list_region_vpc.py`\nDescription: List non-default VPCs and instances (for the moment) with their creator in order to trace who created it.\nTechnical: This script mainly uses `boto3.resource` class to instanciate AWS entities.\nParameters:\n* `--check` : (none) Enable check mode and do not apply any action [implemented but not used yet]\n\n#### Usage\n```bash\n$ ./list_region_vpc.py\n```\n```\n+-------------------------------------------+\n|    List non default VPCs and Instances    |\n|      for all regions with its owner.      |\n+-------------------------------------------+\n```\n\n#### Examples\n\nShow some help\n```bash\n$ ./list_region_vpc.py -h\n```\n\n\n### Delete Main AWS Services from Region\n\n#### Description\nName: `reset_region.py`\nDescription: Browse and delete main AWS Service non-default resources.\nTechnical: This script mainly uses `boto3.client` class to instanciate AWS entities.\nParameters:\n* `--check` : (none) Enable check mode and do not apply any action [implemented but not used yet]\n* `--region_name \u003cregion\u003e` : (string) Name of the (only one) AWS Region (e.g. eu-west-1, eu-central-1)\n\n#### Usage\n```bash\n$ ./reset_region.py\n```\n```\n+-----------------------------------+\n|       Delete all non default      |\n|    resources and sub-resources    |\n+-----------------------------------+\n```\n\n#### Examples\n\nShow some help\n```bash\n$ ./reset_region.py -h\n```\n\nRun on Dry Run\n```bash\n$ ./reset_region.py --check\n```\n\nRun on a specific region (parameter override profile)\n```bash\n$ ./reset_region.py --region_name=eu-central-1\n```\n\n\n### List Resource Groups resources\n\n#### Description\nName: `list_resource-groups.py`\nDescription: Browse Resource Groups and show resources linked.\nParameters:\n* `--check` : (none) Enable check mode and do not apply any action [implemented but not used yet]\n* `--region_name \u003cregion\u003e` : (string) Name of the (only one) AWS Region (e.g. eu-west-1, eu-central-1)\n\n#### Usage\n```bash\n$ ./list_resource-groups.py\n```\n```\n+----------------------------+\n|    List Resource Groups    |\n|         resources          |\n+----------------------------+\n```\n\n#### Examples\n\nShow some help\n```bash\n$ ./list_resource-groups.py -h\n```\n\nRun on Dry Run\n```bash\n$ ./list_resource-groups.py --check\n```\n\nRun on a specific region (parameter override profile)\n```bash\n$ ./list_resource-groups.py --region_name=eu-central-1\n```\n\n\n### List Resource Groups resources\n\n#### Description\nName: `control_resource-groups_instances.py`\nDescription: Browse Resource Groups and show resources linked.\nParameters:\n* `--check` : (none) Enable check mode and do not apply any action [implemented but not used yet]\n* `--region_name \u003cRegion\u003e` : (string) Name of the (only one) AWS Region (e.g. eu-west-1, eu-central-1)\n* `--group_name \u003cResource Group\u003e` : (string) Name of the Resource Group to control\n* `--start` : (none) Start Resource Groups instances\n* `--stop` : (none) Stop Resource Groups instances\n\n#### Usage\n```bash\n$ ./control_resource-groups_instances.py\n```\n```\n+----------------------------+\n|    List Resource Groups    |\n|         resources          |\n+----------------------------+\n```\n\n#### Examples\n\nShow some help\n```bash\n$ ./control_resource-groups_instances.py -h\n```\n\nRun on Dry Run\n```bash\n$ ./control_resource-groups_instances.py --check\n```\n\nRun on a specific region (parameter override profile)\n```bash\n$ ./control_resource-groups_instances.py --region_name=eu-central-1\n```\n\nStart all instances from all Resource Groups from the Region (region set in profile)\n```bash\n$ ./control_resource-groups_instances.py --start\n```\n\nStop all instances included in Resource Group named `myRessGroup`\n```bash\n$ ./control_resource-groups_instances.py --group_name=myRessGroup --stop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgermainlefebvre4%2Faws-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgermainlefebvre4%2Faws-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgermainlefebvre4%2Faws-python/lists"}