This script provides a command line interface for managing AWS services. The script supports the following operations:
- Upload a file to a specified S3 bucket.
- Create a private subnet within a specified VPC.
- Authorize SSH access from the machine running the script to an EC2 instance specified by security group ID.
- Python 3.7 or higher.
- Poetry for managing dependencies.
- An AWS account with appropriate permissions for the operations you want to perform.
- AWS credentials configured on your machine, either by defining environment variables
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
, andAWS_REGION
, or by using the AWS CLI configuration.
- Clone the repository:
git clone https://github.com/IrakliDevelop/aws_task_2.git
cd aws_task_2
- Install dependencies:
poetry install
All commands should be preceded by poetry run python main.py
.
- Upload a file to a bucket:
poetry run python main.py bucket <bucket_name> -upload_file <file_name>
- Create a private subnet in a VPC:
poetry run python main.py vpc <VpcId> -create_private_subnet <cidr_block>
- Add SSH access for current machine to a specified security group:
poetry run python main.py ec2 -security_group_id <sg_id> -ssh_my_ip
For help with the command-line options, you can use the -h
or --help
options with the script or any of its commands.