Skip to main content

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

  1. Run the script and select an action:

    • Enter 1 to show instance uptimes for all autoscaling groups.
    • Enter 2 to scale an autoscaling group to a desired size.
  2. If you choose to show instance uptimes, the script will display the running duration of each instance in each autoscaling group.

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

  4. 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_groups function. Modify the MaxRecords parameter in the get_autoscaling_groups function 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

  1. 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.
  2. The script will change the IAM user's password to the new password provided.

  3. All existing access keys for the IAM user will be disabled.

  4. A new access key will be created for the IAM user.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p67_awstools-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

p67_awstools-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file p67_awstools-0.1.1.tar.gz.

File metadata

  • Download URL: p67_awstools-0.1.1.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

Hashes for p67_awstools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4fb116fca9447dd266eaab8bd72e4582d7fd3075b5b1e70b4d01b4c0dfefa976
MD5 84320287116b8c34e4e6e65da3e8c9f7
BLAKE2b-256 ea42ca0b02183ba0b23b0f3012a5df4e83db246ad8756164d223ba0c6d02da0b

See more details on using hashes here.

File details

Details for the file p67_awstools-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: p67_awstools-0.1.1-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

Hashes for p67_awstools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 daaf8efb9f14ee1f10601b31b0feeb5b69163507fd5bdba256778c4527f3f0a1
MD5 5695cc8648ba53023fad001ef00d8182
BLAKE2b-256 534f15dc7a461ae2fe20220d8aa00f59c488eecd59a7e0b281b87f4c62a2722b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page