

Amazon CodeCatalyst는 더 이상 신규 고객에게 공개되지 않습니다. 기존 고객은 정상적으로 서비스를 계속 이용할 수 있습니다. 자세한 내용은 [CodeCatalyst에서 마이그레이션하는 방법](migration.md) 단원을 참조하십시오.

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 개발 환경용 devfile 구성
<a name="devenvironment-devfile"></a>

*devfile*은 팀 전체에서 개발 환경을 사용자 지정하는 데 도움이 되는 개방형 표준입니다. devfile은 필요한 개발 도구를 코드화하는 YAML 파일입니다. devfile을 구성하면 필요한 프로젝트 도구 및 애플리케이션 라이브러리를 미리 결정할 수 있으며 Amazon CodeCatalyst가 이를 개발 환경에 설치합니다. devfile은 생성된 리포지토리에 따라 다르며 각 리포지토리에 대해 별도의 devfile을 생성할 수 있습니다. 개발 환경은 명령 및 이벤트를 지원하며 기본 범용 devfile 이미지를 제공합니다.

빈 블루프린트를 사용하여 프로젝트를 생성하는 경우 devfile을 수동으로 생성할 수 있습니다. 다른 블루프린트를 사용하여 프로젝트를 생성하는 경우 CodeCatalyst는 devfile을 자동으로 생성합니다. 개발 환경의 `/projects` 디렉터리는 소스 리포지토리와 devfile에서 가져온 파일을 저장합니다. 개발 환경을 처음 생성할 때 비어 있는 `/home` 디렉터리는 개발 환경을 사용하는 동안 생성한 파일을 저장합니다. 개발 환경의 `/projects` 및 `/home` 디렉터리에 있는 모든 항목은 영구적으로 저장됩니다.

**참고**  
`/home` 폴더는 devfile 또는 devfile 구성 요소 이름의 이름을 변경하는 경우에만 변경됩니다. devfile 또는 devfile 구성 요소 이름을 변경하면 `/home` 디렉터리의 내용이 대체되고 이전 `/home` 디렉터리 데이터를 복구할 수 없습니다.

루트에 devfile이 포함되지 않은 소스 리포지토리로 개발 환경을 생성하거나 소스 리포지토리 없이 개발 환경을 생성하는 경우 기본 범용 devfile이 소스 리포지토리에 자동으로 적용됩니다. 모든 IDE에 동일한 기본 범용 devfile 이미지가 사용됩니다. CodeCatalyst는 현재 devfile 버전 2.0.0을 지원합니다. devfile에 대한 자세한 내용은 [Devfile 스키마 - 버전 2.0.0](https://devfile.io/docs/2.0.0/devfile-schema)을 참조하세요.

**참고**  
Devfile에는 퍼블릭 컨테이너 이미지만 포함할 수 있습니다.

VPC 연결 개발 환경은 다음 devfile 이미지만 지원합니다.
+ 유니버설 이미지
+ 리포지토리가 VPC와 동일한 리전에 있는 경우 프라이빗 Amazon ECR 이미지

**Topics**
+ [개발 환경용 리포지토리 devfile 편집](devenvironment-devfile-moving.md)
+ [CodeCatalyst에서 지원하는 Devfile 기능](#devenvironment-devfile-support)
+ [개발 환경용 devfile의 예](#devenvironment-devfile-example)
+ [복구 모드를 사용하여 리포지토리 devfile 문제 해결](#devenvironment-devfile-recovery)
+ [개발 환경에 대한 범용 devfile 이미지 지정](devenvironment-universal-image.md)
+ [Devfile 명령](devenvironment-devfile-commands.md)
+ [Devfile 이벤트](devenvironment-devfile-events.md)
+ [Devfile 구성 요소](devenvironment-devfile-components.md)

# 개발 환경용 리포지토리 devfile 편집
<a name="devenvironment-devfile-moving"></a>

다음 절차를 사용하여 개발 환경용 리포지토리 devfile을 편집합니다.

## CodeCatalyst에서 개발 환경용 리포지토리 devfile 편집
<a name="devenvironment-devfile-procedure"></a><a name="devenvironment-devfile-steps"></a>

**리포지토리 devfile을 편집하려면**

1. [https://codecatalyst.aws/](https://codecatalyst.aws/)에서 CodeCatalyst 콘솔을 엽니다.

1. devfile을 편집하려는 소스 리포지토리가 포함된 프로젝트로 이동합니다.

1. 탐색 창에서 **코드**를 선택합니다.

1. **소스 리포지토리**를 선택합니다.

1. 편집하려는 devfile이 포함된 소스 리포지토리를 선택합니다.

1. 파일 목록에서 `devfile.yaml` 파일을 선택합니다.

1. **편집**을 선택합니다.

1. devfile을 편집합니다.

1. **커밋**을 선택하거나 풀 요청을 생성하여 팀원이 변경 사항을 검토하고 승인할 수 있도록 합니다.

**참고**  
devfile을 편집하는 경우 변경 사항을 적용하려면 devfile을 다시 시작해야 합니다. 이 작업은 `/aws/mde/mde start --location devfile.yaml`을 실행하여 수행할 수 있습니다. devfile을 시작하는 데 문제가 있는 경우 복구 모드로 전환됩니다. 그러나 VPC에 연결된 개발 환경과 연결된 devfile을 편집하는 경우 변경 사항을 적용하려면 개발 환경을 대신 다시 시작해야 합니다.

`/aws/mde/mde status`를 실행하여 사용 중인 devfile을 검토할 수 있습니다. 위치 필드에는 환경 `/projects` 폴더를 기준으로 데브파일의 경로가 있습니다.

```
{
            "status": "STABLE",
            "location": "devfile.yaml"
        }
```

`/projects/devfile.yaml`의 기본 devfile을 소스 코드 리포지토리로 이동할 수도 있습니다. devfile의 위치를 업데이트하려면 다음 명령을 사용합니다. `/aws/mde/mde start --location repository-name/devfile.yaml` 

## IDE에서 개발 환경용 리포지토리 devfile 편집
<a name="devenvironment-devfile-ide"></a>

개발 환경의 구성을 변경하려면 devfile을 편집해야 합니다. 지원되는 IDE에서 devfile을 편집한 다음 개발 환경을 업데이트하는 것이 좋지만 CodeCatalyst의 소스 리포지토리 루트에서 devfile을 편집할 수도 있습니다. 지원되는 IDE에서 devfile을 편집하는 경우, 변경 사항을 커밋하고 소스 리포지토리에 푸시하거나 풀 요청을 생성하여 팀원이 devfile 편집을 검토 및 승인할 수 있게 해야 합니다.
+ [에서 개발 환경의 리포지토리 devfile 편집 AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/devenvironment-cloud9.title.html#ide-toolkits-edit-devfile-cloud9)
+ [VS Code에서 개발 환경용 리포지토리 devfile 편집](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/codecatalyst-devenvironment.html#codecatalyst-devenvironment-devfile)
+ [JetBrains에서 개발 환경용 리포지토리 devfile 편집](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/codecatalyst-overview.html#codecatalyst-overview-default)

## CodeCatalyst에서 지원하는 Devfile 기능
<a name="devenvironment-devfile-support"></a>

CodeCatalyst는 버전 2.0.0에서 다음과 같은 devfile 기능을 지원합니다. devfile에 대한 자세한 내용은 [Devfile 스키마 - 버전 2.0.0](https://devfile.io/docs/2.0.0/devfile-schema)을 참조하세요.


| 기능 | Type | 
| --- | --- | 
|  `exec`  |  명령  | 
|  `postStart`  |  Event  | 
|  `container`  |  구성 요소  | 
|  `args`  |  구성 요소 속성  | 
|  `env`  |  구성 요소 속성  | 
|  `mountSources`  |  구성 요소 속성  | 
|  `volumeMounts`  |  구성 요소 속성  | 

## 개발 환경용 devfile의 예
<a name="devenvironment-devfile-example"></a>

다음은 간단한 devfile의 예입니다.

```
schemaVersion: 2.0.0
metadata:
  name: al2
components:
  - name: test
    container:
      image: public.ecr.aws/amazonlinux/amazonlinux:2
      mountSources: true
      command: ['sleep', 'infinity']
  - name: dockerstore
commands:
  - id: setupscript
    exec:
      component: test
      commandLine: "chmod +x script.sh"
      workingDir: /projects/devfiles
  - id: executescript
    exec:
      component: test
      commandLine: "/projects/devfiles/script.sh"
  - id: yumupdate
    exec:
      component: test
      commandLine: "yum -y update --security"
events:
  postStart:
    - setupscript
    - executescript
    - yumupdate
```

Devfile 시작, 명령 및 이벤트 로그는 캡처되어 `/aws/mde/logs`에 저장됩니다. devfile 동작을 디버깅하려면 작업 devfile을 사용하여 개발 환경을 시작하고 로그에 액세스합니다.

## 복구 모드를 사용하여 리포지토리 devfile 문제 해결
<a name="devenvironment-devfile-recovery"></a>

devfile을 시작하는 데 문제가 있는 경우 복구 모드로 전환되므로 환경에 계속 연결하고 devfile을 수정할 수 있습니다. 복구 모드에 있는 동안 `/aws/mde/mde status` 실행에는 devfile의 위치가 포함되지 않습니다.

```
{
            "status": "STABLE"
        }
```

`/aws/mde/logs`의 로그에서 오류를 확인하고, devfile을 수정하고, 다시 `/aws/mde/mde start` 실행을 시도할 수 있습니다.

# 개발 환경에 대한 범용 devfile 이미지 지정
<a name="devenvironment-universal-image"></a>

기본 *범용 이미지*에는 IDE에 사용할 수 있는 가장 일반적으로 사용되는 프로그래밍 언어와 관련 도구가 포함되어 있습니다. 이미지가 지정되지 않은 경우 CodeCatalyst는 이 이미지를 제공하고 CodeCatalyst에서 관리하는 도구를 포함합니다. 새 이미지 릴리스에 대한 알림을 유지하려면 [SNS를 통한 범용 이미지 알림 구독](#devenvironment-universal-notifications) 섹션을 참조하세요.

Amazon CodeCatalyst는 다음과 같은 devfile 이미지를 적극적으로 지원합니다.


| 이미지 버전 | 이미지 식별자 | 
| --- | --- | 
| Universal image 4.0 | public.ecr.aws/aws-mde/universal-image:4.0 | 
| Universal image 5.0 | public.ecr.aws/aws-mde/universal-image:5.0 | 

**참고**  
`public.ecr.aws/aws-mde/universal-image:latest`를 사용하여 현재 `public.ecr.aws/aws-mde/universal-image:5.0`인 최신 이미지를 가져올 수도 있습니다.

CodeCatalyst는 다음 이미지를 더 이상 사용하지 않습니다. 이러한 이미지는 계속 사용할 수 있지만 빌드 호스트에 캐시되지 않으므로 개발 환경 시작 시간이 길어집니다.


| 이미지 버전 | 이미지 식별자 | 사용 중단 날짜 | 
| --- | --- | --- | 
| Universal image 1.0 | public.ecr.aws/aws-mde/universal-image:1.0 | 2024년 8월 16일 | 
| Universal image 2.0 | public.ecr.aws/aws-mde/universal-image:2.0 | 2024년 8월 16일 | 
| Universal image 3.0 | public.ecr.aws/aws-mde/universal-image:3.0 | 2025년 7월 30일 | 

**참고**  
를 사용하는 경우 로 업그레이드한 후 PHP, Ruby 및 CSS에서 AWS Cloud9자동 완성이 작동하지 않습니다`universal-image:3.0`.

**Topics**
+ [SNS를 통한 범용 이미지 알림 구독](#devenvironment-universal-notifications)
+ [범용 이미지 4.0 런타임 버전](#devenvironment-universal-runtimes-4.0)
+ [범용 이미지 5.0 런타임 버전](#devenvironment-universal-runtimes-5.0)

## SNS를 통한 범용 이미지 알림 구독
<a name="devenvironment-universal-notifications"></a>

CodeCatalyst는 범용 이미지 알림 서비스를 제공합니다. 이를 사용하여 CodeCatalyst 범용 이미지 업데이트가 릴리스되었을 때 알리는 Amazon Simple Notification Service(SNS) 주제를 구독할 수 있습니다. SNS 주제에 대한 자세한 내용은 [What is Amazon Simple Notification Service?](https://docs.aws.amazon.com/sns/latest/dg/welcome.html)를 참조하세요.

새 범용 이미지가 릴리스될 때마다 구독자에게 알림을 보냅니다. 이 섹션에서는 CodeCatalyst 범용 이미지 업데이트를 구독하는 방법을 설명합니다.

**샘플 메시지**

```
{
    "Type": "Notification",
    "MessageId": "123456789",
    "TopicArn": "arn:aws:sns:us-east-1:1234657890:universal-image-updates",
    "Subject": "New Universal Image Release",
    "Message": {
        "v1": {
            "Message": "A new version of the Universal Image has been released. You are now able to launch new DevEnvironments using this image.",
            "image ": {
                "release_type": "MAJOR VERSION",
                "image_name": "universal-image",
                "image_version": "2.0",
                "image_uri": "public.ecr.aws/amazonlinux/universal-image:2.0"
            }
        }
    },
    "Timestamp": "2021-09-03T19:05:57.882Z",
    "UnsubscribeURL": "example url"
}
```

**Amazon SNS 콘솔을 사용하여 CodeCatalyst 범용 이미지 업데이트를 구독하려면**

1. Amazon SNS 콘솔의 [대시보드](https://console.aws.amazon.com/sns/v2/home)를 엽니다.

1. 탐색 모음에서를 선택합니다 AWS 리전.

1. 탐색 창에서 **구독**을 선택하고 나서 **구독 생성**을 선택합니다.

1. **주제 ARN**에 `arn:aws:sns:us-east-1:089793673375:universal-image-updates`를 입력합니다.

1. **프로토콜**에서 **이메일**을 선택합니다.

1. **엔드포인트**에서 이메일 주소를 입력합니다. 이 이메일 주소는 알림을 받는 데 사용됩니다.

1. **구독 생성**을 선택합니다.

1. "AWS 알림 - 구독 확인"이라는 제목의 확인 이메일을 받게 됩니다. 이메일을 열고 **구독 확인** 링크를 선택합니다.

**Amazon SNS 콘솔을 사용하여 CodeCatalyst 범용 이미지 업데이트 구독을 취소하려면**

1. Amazon SNS 콘솔의 [대시보드](https://console.aws.amazon.com/sns/v2/home)를 엽니다.

1. 탐색 모음에서를 선택합니다 AWS 리전.

1. 탐색 창에서 **구독**을 선택한 다음 구독을 해지하려는 구독을 선택합니다.

1. 그런 다음 **작업**을 선택하고 **구독 삭제**를 선택합니다.

1. **삭제**를 선택합니다.

## 범용 이미지 4.0 런타임 버전
<a name="devenvironment-universal-runtimes-4.0"></a>

다음 표에는 `universal-image:4.0`에 대한 런타임 가용성이 나열되어 있습니다.


**`universal-image:4.0` 런타임 버전**  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/codecatalyst/latest/userguide/devenvironment-universal-image.html)

## 범용 이미지 5.0 런타임 버전
<a name="devenvironment-universal-runtimes-5.0"></a>

다음 표에는 `universal-image:5.0`에 대한 런타임 가용성이 나열되어 있습니다.


**`universal-image:5.0` 런타임 버전**  

| 실행 시간 이름  | 버전 | 특정 메이저 버전 및 최신 마이너 버전 | 
| --- | --- | --- | 
| aws cli |  2.25  |  `aws-cli: 2.x`  | 
| docker compose |  2.34  |  `docker-compose: 2.x`  | 
| dotnet |  8.0  |  `dotnet: 8.x`  | 
| golang |  1.24  |  `golang: 1.x`  | 
| java |  corretto21  |  `java: corretto21.x`  | 
| nodejs |  22.0  |  `nodejs: 22.x`  | 
| php |  8.3.16  |  `php: 8.x`  | 
| python |  3.12  |  `python: 3.x`  | 
| ruby |  3.4.2  |  `ruby: 3.x`  | 
| terraform |  1.10.5  |  `terraform: 1.x`  | 

# Devfile 명령
<a name="devenvironment-devfile-commands"></a>

현재 CodeCatalyst는 devfile의 `exec` 명령만 지원합니다. 자세한 내용을 알아보려면 Devfile.io 설명서의 [명령 추가](https://devfile.io/docs/2.0.0/adding-commands)를 참조하세요.

다음 예시에서는 devfile에서 `exec` 명령을 지정하는 방법을 보여줍니다.

```
commands:
  - id: setupscript
    exec:
      component: test
      commandLine: "chmod +x script.sh"
      workingDir: /projects/devfiles
  - id: executescript
    exec:
      component: test
      commandLine: "./projects/devfiles/script.sh"
  - id: updateyum
    exec:
      component: test
      commandLine: "yum -y update --security"
```

개발 환경에 연결한 후 터미널을 통해 정의된 명령을 실행할 수 있습니다.

```
/aws/mde/mde command <command-id>
/aws/mde/mde command executescript
```

장기 실행 명령의 경우 `-s` 스트리밍 플래그를 사용하여 명령 실행을 실시간으로 출력할 수 있습니다.

```
/aws/mde/mde -s command <command-id>
```

**참고**  
`command-id`는 소문자여야 합니다.

## CodeCatalyst에서 지원하는 Exec 파라미터
<a name="devenvironment-exec-support"></a>

CodeCatalyst는 devfile 버전 2.0.0에서 다음 `exec` 파라미터를 지원합니다.
+ `commandLine`
+ `component`
+ `id`
+ `workingDir`

# Devfile 이벤트
<a name="devenvironment-devfile-events"></a>

현재 CodeCatalyst는 devfile의 `postStart` 이벤트만 지원합니다. 자세한 내용은 Devfile.io 설명서에서 [postStartObject](https://devfile.io/docs/2.0.0/adding-event-bindings#post-start-object) 섹션을 참조하세요.

다음 예시에서는 devfile에 `postStart` 이벤트 바인딩을 추가하는 방법을 보여줍니다.

```
commands:
  - id: executescript
    exec:
      component: test
      commandLine: "./projects/devfiles/script.sh"
  - id: updateyum
    exec:
      component: test
      commandLine: "yum -y update --security"
events:
  postStart:
    - updateyum
    - executescript
```

시작 후 개발 환경은 지정된 `postStart` 명령을 정의된 순서대로 실행합니다. 명령이 실패하면 개발 환경이 계속 실행되고 실행 출력이 `/aws/mde/logs` 아래의 로그에 저장됩니다.

# Devfile 구성 요소
<a name="devenvironment-devfile-components"></a>

현재 CodeCatalyst는 devfile의 `container` 구성 요소만 지원합니다. 자세한 내용은 Devfile.io 설명서의 [구성 요소 추가](https://devfile.io/docs/2.0.0/adding-components)를 참조하세요.

다음 예시에서는 devfile의 컨테이너에 시작 명령을 추가하는 방법을 보여줍니다.

```
components:
  - name: test
    container:
      image: public.ecr.aws/amazonlinux/amazonlinux:2
      command: ['sleep', 'infinity']
```

**참고**  
컨테이너에 짧은 라이브 항목 명령이 있는 경우 컨테이너를 계속 실행하려면 `command: ['sleep', 'infinity']`를 포함해야 합니다.

CodeCatalyst는 컨테이너 구성 요소에서 `args`, `env`, `mountSources`, `volumeMounts` 속성도 지원합니다.