Pre-requisites
- You will need to have the AWS Command Line Interface V2 (or later) installed on your machine - instructions on installing this can be found here: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
- You will also need to have the Session Manager Plugin for the AWS Command Line Interface installed - instructions on installing this can be found here: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
Running AWS list objects
- First, open Command Prompt as an Administrator (this can be done by right-clicking on the application and selecting Run as Administrator).
- With Command Prompt open, type in aws configure (as shown below) and press Enter:
- You will then be asked for the Access Key, Secret Key, Region, and Output. Fill in each line and press Enter. For Output, you can leave this blank and hit Enter.
- If you wish to change the location where the text file will be saved, please change the directory now via the CD command.
- Type in the following command:
aws s3api list-objects-v2 --bucket BUCKET-NAME -prod --prefix "FOLDER/PREFIX NAME"/ --query "Contents[].{Key: Key}" --encoding-type url --output text >> MyTextFile.txt - It is important that you use speech marks around your prefix and that you end the prefix with a /.
If you are planning to ingest the listed objects, see the guide here on how to convert to CSV and Ingest: https://ipv.helpjuice.com/aws/1553659?from_search=99476071