Various AWS code
Project description
P67-awstools
Helper tools for common AWS activities. Currently still in heavy development. For now, it provides two functionalities:
1. Autoscaling Group Management (cli_scale_ec2_asg)
This Python script provides functionalities to manage autoscaling groups in AWS. It utilizes the Boto3 library to interact with the AWS Autoscaling and EC2 services.
Prerequisites
- Python 3.x
- Boto3 library
cli_scale_ec2_asg usage
-
Run the script and select an action:
- Enter
1to show instance uptimes for all autoscaling groups. - Enter
2to scale an autoscaling group to a desired size.
- Enter
-
If you choose to show instance uptimes, the script will display the running duration of each instance in each autoscaling group.
-
If you choose to scale an autoscaling group, you will be prompted to enter the numbers of the autoscaling groups you want to scale, separated by commas. Then, enter the desired size for the autoscaling group.
-
The script will update the specified autoscaling groups with the desired size, and display a confirmation message.
Note:
- Ensure that the AWS credentials used by the script have appropriate permissions to describe and update autoscaling groups.
- The script currently supports a maximum of 100 autoscaling groups due to the default value used in the
describe_auto_scaling_groupsfunction. Modify theMaxRecordsparameter in theget_autoscaling_groupsfunction if you have more than 100 autoscaling groups.
2. IAM User Password and Access Key Management (aws_passwd_rotate)
This Python script provides a way to change the password of an IAM user in AWS and manage their access keys. It utilizes the Boto3 library to interact with the AWS IAM service.
password_rotate Usage
-
Run the script and enter the following information:
- Enter your current password: Enter the current password of the IAM user.
- Enter your new password: Enter the desired new password for the IAM user.
-
The script will change the IAM user's password to the new password provided.
-
All existing access keys for the IAM user will be disabled.
-
A new access key will be created for the IAM user.
-
The script will print the new access key information, including the Access Key ID and Secret Access Key. Make sure to save this information securely as it will not be accessible again.
Note:
- Ensure that the AWS credentials used by the script have appropriate permissions to manage IAM users, change passwords, and create/delete access keys.
- The IAM user specified in the script must have sufficient permissions to change their own password and access key.
- Review and modify the script as necessary to meet your specific requirements and security practices.
License
This project is licensed under the MIT License.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file p67_awstools-0.1.2.tar.gz.
File metadata
- Download URL: p67_awstools-0.1.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c46fd52434df272188fbabe1768cbf3b27785f8534b0ed77693efb036638ea6
|
|
| MD5 |
ecbd3800627d7ffac0694319176711f3
|
|
| BLAKE2b-256 |
1a3132bd781a4f480d82a82ecd7b66a41b2c0b3a54917937a87b0ff2c6012bf6
|
File details
Details for the file p67_awstools-0.1.2-py3-none-any.whl.
File metadata
- Download URL: p67_awstools-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dc94dd8b270cd3fd048e40a5d9f68c4895b4d1c513a9e5f83dc4a87f71e4384
|
|
| MD5 |
b4f561decf29efd37914d3e6219cb33b
|
|
| BLAKE2b-256 |
1c63ae6f7e27116d23dedc19ea7a535719094d47c95546fd8233b4652be26a1c
|