---
title: "AWS CLI"
description: "Use the AWS CLI with EZGH Object Storage."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS CLI

Add a profile to `~/.aws/config` with your [access key](/object-storage/access-keys). `endpoint_url`
in a profile needs AWS CLI 1.29 or 2.13 or later.

```ini title="~/.aws/config"
[profile ezgh]
aws_access_key_id = oak_…
aws_secret_access_key = …
region = us-west-1
endpoint_url = https://s3.us-west-1.ezghapps.com
s3 =
    signature_version = s3v4
```

On AWS CLI v1, the `s3 =` block is what makes `aws s3 presign` use SigV4.

## Common commands

```sh
export AWS_PROFILE=ezgh

aws s3 mb s3://my-bucket
aws s3 cp report.pdf s3://my-bucket/
aws s3 ls s3://my-bucket/
aws s3 cp s3://my-bucket/report.pdf .
aws s3 rm s3://my-bucket/report.pdf
```

`aws s3 cp` splits large files into multipart uploads by itself.

## Presigned URLs

```sh
aws s3 presign s3://my-bucket/report.pdf --expires-in 3600
```

`--expires-in` is in seconds, up to 604,800 (7 days). See
[Presigned URLs](/object-storage/public-buckets-and-presigned-urls#presigned-urls).

## Virtual-hosted URLs

For `https://my-bucket.s3.us-west-1.ezghapps.com/report.pdf` URLs, add `addressing_style`:

```ini title="~/.aws/config"
s3 =
    signature_version = s3v4
    addressing_style = virtual
```

Source: https://docs.ezghcloud.com/object-storage/aws-cli/index.mdx
