Skip to content

AWS CLI

AWS Command Line Interface is a tool for managing S3 Compatible Storage. Besides bucket file operations, it also supports setting Policies and Lifecycles among other features.

Installation

Official installation instructions

Configuration

Create configuration file

~/.aws/config
cat > ~/.aws/config << EOF
[profile default]
output = json
EOF

Copy your keys from ICE Connect

Services ➡ S3 Storage ➡ Keys ➡ Export AWS

Paste it to the file

~/.aws/credentials
[default]
aws_access_key_id = YOUR_ACCESS_KEY_1
aws_secret_access_key = YOUR_SECRET_KEY_1
[do:alt-key]
aws_access_key_id = YOUR_ACCESS_KEY_2
aws_secret_access_key = YOUR_SECRET_KEY_2

Key pairs, other than the default, can be used with e.g.

aws --profile do:alt-key

List accessible buckets

aws --endpoint=https://s3.ice.ri.se s3 ls

Copy to a bucket

Copy test.img to bucket project-bucket/images/test.img

aws --endpoint=https://s3.ice.ri.se s3 cp test.img s3://project-bucket/images/test.img

List objects

aws --endpoint=https://s3.ice.ri.se s3 ls s3://project-bucket/