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

# AWS ECR

> `ale` 에서 빌드된 이미지를 업로드할 저장소와 배포되는 과정에서 사용할 저장소를 AWS의 **Elastic Container Registry**로 설정할 수 있습니다.

***

## AWS IAM 사용자 생성

### 사용자 만들기

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-01.png" />
</Frame>

> AWS의 IAM 콘솔에서 **액세스 관리 > 사용자 페이지**에 접속한 후 `사용자 생성`을 클릭하세요.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-02.png" />
</Frame>

> 희망하는 **사용자 이름**을 입력한 후 다음으로 넘어갑니다.

### 권한 부여

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-03.png" />
</Frame>

> 권한 옵션에서 **직접 정책 연결**을 선택하고 **AmazonEC2ContainerRegistryFullAccess**를 검색해 체크박스에 체크한 후 다음으로 넘어갑니다.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-04.png" />
</Frame>

> 별도 설정 없이 `사용자 생성`을 클릭하세요.

## Access Key 발급

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-08.png" />
</Frame>

> 생성한 사용자 페이지의 **보안 자격 증명탭** 엑세스 키 항목의 `액세스 키 만들기`를 클릭하세요.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-09.png" />
</Frame>

> 이어지는 화면에서 **AWS 외부에서 실행되는 애플리케이션**을 선택합니다.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-10.png" />
</Frame>

> 적당한 설명 태그 값을 작성 후 `액세스 키 만들기`를 클릭하세요.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-11.png" />
</Frame>

> 이어지는 화면에서 발급된 **액세스 키**와 **비밀 액세스 키**를 조회할 수 있습니다.

## 콘솔 로그인 URL 생성

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-05.png" />
</Frame>

> 생성한 사용자 페이지의 **보안 자격 증명탭** 콘솔 로그인 항목의 `콘솔 엑세스 활성화`을 클릭하세요.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-06.png" />
</Frame>

> 콘솔 엑세스 항목에 **활성화**를, 암호 설정에 **사용자 지정 암호**를 선택하고 사용할 암호를 입력한 후 `콘솔 엑세스 활성화`를 클릭하세요.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-07.png" />
</Frame>

> 생성된 **콘솔 로그인 URL**에 사용자이름과 콘솔 암호로 접속해 컨테이너 레지스트리를 생성할 수 있습니다.

## AWS ECR 생성

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-12.png" />
</Frame>

> 위의 과정에서 생성한 콘솔 로그인 URL로 접속해 설정한 사용자 계정으로 로그인하세요.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/aws-ecr-13.png" />
</Frame>

> 리포지토리 `생성`을 클릭하고 이어지는 화면의 **리포지토리 이름** 필드에서 '/' 이하를 제외한 `[ID].dkr.ecr.ap-northeast-2.amazonaws.com` 부분이 `ale` 에 ECR을 연결할 때 **접속 주소**로 사용됩니다.

## ale에 연결

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/setup/eks/images/05_02.png" />
</Frame>

> `ale` 운영 시스템의 **클러스터 > 설정 > 컨테이너 레지스트리 > 읽기/쓰기** 항목의 `컨테이너 저장소 연결하기`를 클릭하면 표시되는 **컨테이너 저장소 설정** 창에서 아래의 값들을 입력한 후 `연결하기`를 클릭하면 **ECR**이 연결됩니다.

* **저장소 제공자** : AWS Elastic Container Registry
* **접속 주소** : AWS ECR 리포지토리 이름의 `[ID].dkr.ecr.ap-northeast-2.amazonaws.com` 부분
* **aws access key ID** : [엑세스 키](/ko/registry/aws-ecr#access-key-%EB%B0%9C%EA%B8%89)
* **aws secret aceess key** : [비밀 엑세스 키](/ko/registry/aws-ecr#access-key-%EB%B0%9C%EA%B8%89)
* **region** : ECR이 위치한 리전 식별자 **(ex. ap-northeast-2)**
