A bash script and python script to list instances in each regoins in an AWS account You can run the scripts from any environment that has access to the AWS CLI or AWS SDKs and is properly configured with the necessary AWS credentials, you can also run it from the cloudshell.
- Install AWS CLI and SDKs:
- Ensure you have the AWS CLI and any necessary SDKs (like
boto3
for Python) installed on your local machine.
- Ensure you have the AWS CLI and any necessary SDKs (like
- Configure AWS CLI:
- Run
aws configure
to set up your AWS credentials and default region.
- Run
- Run the Scripts:
- Save the script to a file on your local machine.
- Open a terminal or command prompt.
- Navigate to the directory where you saved the script.
- Make the script executable (for shell scripts) and run it.
AWS CloudShell is a browser-based shell provided by AWS. It comes pre-installed with the AWS CLI and other development tools.
- Access AWS CloudShell:
- Go to the AWS Management Console.
- Click on the CloudShell icon in the top navigation bar.
- Run the Scripts:
- You can copy and paste the script directly into the CloudShell terminal.
- Alternatively, upload the script file to CloudShell using the CloudShell file upload feature and run it as you would in a local terminal.