Documentation

Manage Assets Using AWS CLI

To connect to the Servd Assets Platform using AWS CLI, first ensure you have an up-to-date version installed.

We recommend adding Servd as an additional AWS profile. In order to do so you'll need to add the following to your AWS credentials files:

~/.aws/config

You can find the following values on the Project Settings > Assets page within the Servd Dashboard:

Access Key ID

Access Key Secret

S3 Endpoint

Region

Bucket Name and/or Prefix

[default]
** Your default account settings **

[profile servd]
region = [Region]
endpoint-url = [S3 Endpoint]

~/.aws/credentials

[default]
** Your default account credentials **

[servd]
aws_access_key_id = [Access Key ID]
aws_secret_access_key = [Access Key Secret]

Once the new profile has been added you can test the connection by running:

# Asset Platform V3
aws --profile servd --endpoint-url https://[S3 Endpoint] s3 ls s3://[bucket-name]/

# Asset Platform V2 (Legacy)
aws --profile servd --endpoint-url https://[S3 Endpoint] s3 ls s3://[bucket-name]/[prefix]

Using Docker #

If you have docker installed you can use a single command to run a disposable container without having to set up profiles first.

You will need to update the values within square brackets [] and any directory paths.

Be aware that this will leave your secret and key in the terminal history so you might want to clean that up or prevent it via the mechanism offered by your shell.

# Asset Platform V3
docker run --rm -it -v `pwd`:/curdir -e AWS_ACCESS_KEY_ID=[Access Key ID] -e AWS_SECRET_ACCESS_KEY=[Access Key Secret] amazon/aws-cli --endpoint-url=https://[S3 Endpoint] s3 sync /curdir/assets/ s3://[Bucket]/staging/assets/

# Asset Platform V2 (Legacy)
docker run --rm -it -v `pwd`:/curdir -e AWS_ACCESS_KEY_ID=[Access Key ID] -e AWS_SECRET_ACCESS_KEY=[Access Key Secret] amazon/aws-cli --endpoint-url=https://s3.eu-central-003.backblazeb2.com s3 sync /curdir/assets/ s3://[Bucket]/[Prefix]/staging/assets/