Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/defo89/aws-boto3-scripts
Python scripts for AWS using boto3 SDK
https://github.com/defo89/aws-boto3-scripts
amazon-web-services aws aws-ec2 aws-lambda boto3 python
Last synced: 24 days ago
JSON representation
Python scripts for AWS using boto3 SDK
- Host: GitHub
- URL: https://github.com/defo89/aws-boto3-scripts
- Owner: defo89
- License: mit
- Created: 2018-05-29T21:17:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-31T14:41:01.000Z (over 6 years ago)
- Last Synced: 2023-09-05T10:37:11.408Z (about 1 year ago)
- Topics: amazon-web-services, aws, aws-ec2, aws-lambda, boto3, python
- Language: Python
- Size: 8.79 KB
- Stars: 9
- Watchers: 3
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-boto3-scripts
Python scripts for AWS using boto3 SDK| Script | Description |
| ---------------------------| ----------------------------------------------------|
| [ec2_start.py](scripts/ec2_start.py) | Start all instances with a specific tag |
| [ec2_stop.py](scripts/ec2_stop.py) | Stop all instances with a specific tag |
| [ec2_ip_route53.py](scripts/ec2_ip_route53.py) | Get EC2 public IP and change Route53 'A' record |
| [ec2_start_and_route53.py](scripts/ec2_start_and_route53.py) | Start EC2, get public IP and change Route53 'A' record |## Installation
Requires Python and [boto3](https://github.com/boto/boto3).
```
git clone https://github.com/dmitrijsf/aws-boto3-scripts
cd aws-boto3-scripts
pip install -r requirements.txt
```
## Usage**Set desired AWS credentials**
In this example I am using [**aws-vault**](https://github.com/99designs/aws-vault) to work with desired profile.
```
❯ aws-vault add home
Enter Access Key ID: your-aws-access-key-id
Enter Secret Access Key: your-aws-access-key
Added credentials to profile "home" in vault# launches subshell with desired AWS environment variables
❯ aws-vault exec -- home
```
**Launching Scripts**```
❯ cd scripts
# modify the script according to your needs
# ec2_ip_route53.py# set instance ID
instance_id = 'i-0111112233' # Instance ID, e.g. 'i-0111112233'
# set Hosted Zone ID
zone_id = 'ZBDAAABBBCCC' # Hosted Zone ID, e.g. 'ZBDAAABBBCCC'
# domain
domain = 'technoff.eu' # Domain, e.g. technoff.eu❯ ./ec2_ip_route53.py
technoff.eu record was changed to: 52.51.120.202
```