# AWS ECR

*Make sure that you have the latest version of the AWS CLI and Docker installed.*

### You need to have on hand

* [x] The AWS Region of your ECR
* [x] The Registry URI

### To get this information, go to AWS Console

1. Go to your ECR Region
2. Go to Elastic Container Registry
3. Then to Repositories
4. Click on the Repository you wish to get your image from
5. Click on the **View push commands**.

### Split the URI

By default the AWS **URI** contains the Registry and the Image, you will need to split those

Imagine having this **URI**: **597351113950.dkr.ecr.ca-central-1.amazonaws.com/example**

Your **Repository** will be: **597351113950.dkr.ecr.ca-central-1.amazonaws.com**

and your **Image** will be: **example**

### Get the password

To get your ECR Login Password

```bash
aws ecr get-login-password --region ca-central-1
```

{% hint style="success" %}
You can change to your region (e.g. us-east-1, us-west-1, etc).
{% endhint %}

#### More info on [**AWS Doc**](https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html)[**umentation**](https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html)

### Add the app to Edgegap

#### API Example

{% hint style="info" %}
The username will always be AWS
{% endhint %}

```json
{
    [...]
    "docker_repository": "597351113950.dkr.ecr.ca-central-1.amazonaws.com",
    "docker_image": "example",
    "docker_tag": "v1",
    "private_username": "AWS",
    "private_token": "<ecr login-password>",
    [...]
}
```

#### From Dashboard

From our Dashboard, The **Private registry token** will be your **ecr login-password**

<figure><img src="https://3027732442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR0dHSFv9ymoC0DO5G8J%2Fuploads%2Fgit-blob-5818f97e273c73aa37bddcc3ce7c10e61356bb6c%2Fecr-example.png?alt=media" alt=""><figcaption></figcaption></figure>
