

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

# 참조: Amazon EC2 시작 템플릿 예제
<a name="launch-template-examples"></a>

다음은 고유한 템플릿을 생성하는 데 사용할 수 있는 MIME 멀티파트 파일의 예입니다.

**Topics**
+ [예: 기존 Amazon EFS 파일 시스템 탑재](#example-mount-an-existing-amazon-efs-file-system)
+ [예: 기본 Amazon ECS 컨테이너 에이전트 구성 기본값 재정의](#example-override-default-amazon-ecs-container-agent-configuration)
+ [예: 기존 Amazon FSx for Lustre 파일 시스템 탑재](#example-mount-an-existing-amazon-fsx-for-lustre-file-system)

## 예: 기존 Amazon EFS 파일 시스템 탑재
<a name="example-mount-an-existing-amazon-efs-file-system"></a>

**Example**  
이 예제 MIME 멀티파트 파일은 `amazon-efs-utils` 패키지를 설치하고 `/mnt/efs`에 기존 Amazon EFS 파일 시스템을 탑재하도록 컴퓨팅 리소스를 구성합니다.  

```
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==MYBOUNDARY=="

--==MYBOUNDARY==
Content-Type: text/cloud-config; charset="us-ascii"

packages:
- amazon-efs-utils

runcmd:
- file_system_id_01=fs-abcdef123
- efs_directory=/mnt/efs

- mkdir -p ${efs_directory}
- echo "${file_system_id_01}:/ ${efs_directory} efs tls,_netdev" >> /etc/fstab
- mount -a -t efs defaults

--==MYBOUNDARY==--
```

## 예: 기본 Amazon ECS 컨테이너 에이전트 구성 기본값 재정의
<a name="example-override-default-amazon-ecs-container-agent-configuration"></a>

**Example**  
이 예제 MIME 멀티파트 파일은 컴퓨팅 리소스에 대한 기본 도커 이미지 정리 설정을 재정의합니다.  

```
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==MYBOUNDARY=="

--==MYBOUNDARY==
Content-Type: text/x-shellscript; charset="us-ascii"

#!/bin/bash
echo ECS_IMAGE_CLEANUP_INTERVAL=60m >> /etc/ecs/ecs.config
echo ECS_IMAGE_MINIMUM_CLEANUP_AGE=60m >> /etc/ecs/ecs.config

--==MYBOUNDARY==--
```

## 예: 기존 Amazon FSx for Lustre 파일 시스템 탑재
<a name="example-mount-an-existing-amazon-fsx-for-lustre-file-system"></a>

**Example**  
이 예제 MIME 멀티파트 파일은 Extras Library에서 `lustre2.10` 패키지를 설치하고 `/scratch`에 기존 FSx for Lustre 파일 시스템과 `fsx`의 이름을 탑재하도록 컴퓨팅 리소스를 구성합니다. 이 예제는 Amazon Linux 2의 예제입니다. 다른 Linux 배포판의 설치 가이드는 *Amazon FSx for Lustre의 Lustre 사용 설명서*의 [Lustre 클라이언트 설치](https://docs.aws.amazon.com/fsx/latest/LustreGuide/install-lustre-client.html)를 참조하세요. 자세한 내용은 *Amazon FSx for Lustre 사용 설명서*의 [Amazon FSx 파일 시스템 자동 탑재](https://docs.aws.amazon.com/fsx/latest/LustreGuide/mount-fs-auto-mount-onreboot.html)를 참조하세요.  

```
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==MYBOUNDARY=="

--==MYBOUNDARY==
Content-Type: text/cloud-config; charset="us-ascii"

runcmd:
- file_system_id_01=fs-0abcdef1234567890
- region=us-east-2
- fsx_directory=/scratch
- amazon-linux-extras install -y lustre2.10
- mkdir -p ${fsx_directory}
- mount -t lustre ${file_system_id_01}.fsx.${region}.amazonaws.com@tcp:fsx ${fsx_directory}

--==MYBOUNDARY==--
```
컨테이너 속성의 [volumes](https://docs.aws.amazon.com/batch/latest/APIReference/API_ContainerProperties.html#Batch-Type-ContainerProperties-volumes) 및 [mountPoints](https://docs.aws.amazon.com/batch/latest/APIReference/API_ContainerProperties.html#Batch-Type-ContainerProperties-mountPoints) 멤버에서 탑재 지점을 컨테이너에 매핑해야 합니다.  

```
{
    "volumes": [
        {
            "host": {
                "sourcePath": "/scratch"
            },
            "name": "Scratch"
        }
    ],
    "mountPoints": [
        {
            "containerPath": "/scratch",
            "sourceVolume": "Scratch"
        }
    ],
}
```