Amazon ECS 태스크 정의에서 FSx for Windows File Server 파일 시스템 지정하기
Amazon ECS 태스크 정의에서 FSx for Windows File Server 파일 시스템 지정하기
컨테이너에 FSx for Windows File Server 파일 시스템 볼륨을 사용하려면 태스크 정의에서 볼륨과 마운트 지점 구성을 지정해요. 다음 태스크 정의 JSON 조각은 컨테이너의 volumes와 mountPoints 객체 문법을 보여줍니다.
출처: 문서
본문
컨테이너에 FSx for Windows File Server 파일 시스템 볼륨을 사용하려면 태스크 정의에서 볼륨과 마운트 지점 구성을 지정합니다. 다음 태스크 정의 JSON 조각은 컨테이너의 volumes와 mountPoints 객체 문법을 보여줍니다.
{
"containerDefinitions": [
{
"entryPoint": [
"powershell",
"-Command"
],
"portMappings": [],
"command": ["New-Item -Path C:\\fsx-windows-dir\\index.html -ItemType file -Value '<html> <head> <title>Amazon ECS Sample App</title> <style>body {margin-top: 40px; background-color: #333;} </style> </head><body> <div style=color:white;text-align:center> <h1>Amazon ECS Sample App</h1> <h2>It Works!</h2> <p>You are using Amazon FSx for Windows File Server file system for persistent container storage.</p>' -Force"],
"cpu": 512,
"memory": 256,
"image": "mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019",
"essential": false,
"name": "container1",
"mountPoints": [
{
"sourceVolume": "fsx-windows-dir",
"containerPath": "C:\\fsx-windows-dir",
"readOnly": false
}
]
},
{
"entryPoint": [
"powershell",
"-Command"
],
"portMappings": [
{
"hostPort": 443,
"protocol": "tcp",
"containerPort": 80
}
],
"command": ["Remove-Item -Recurse C:\\inetpub\\wwwroot\\* -Force; Start-Sleep -Seconds 120; Move-Item -Path C:\\fsx-windows-dir\\index.html -Destination C:\\inetpub\\wwwroot\\index.html -Force; C:\\ServiceMonitor.exe w3svc"],
"mountPoints": [
{
"sourceVolume": "fsx-windows-dir",
"containerPath": "C:\\fsx-windows-dir",
"readOnly": false
}
],
"cpu": 512,
"memory": 256,
"image": "mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019",
"essential": true,
"name": "container2"
}
],
"family": "fsx-windows",
"executionRoleArn": "arn:aws:iam::111122223333:role/ecsTaskExecutionRole",
"volumes": [
{
"name": "fsx-windows-dir",
"fsxWindowsFileServerVolumeConfiguration": {
"fileSystemId": "fs-0eeb5730b2EXAMPLE",
"authorizationConfig": {
"domain": "example.com",
"credentialsParameter": "arn:arn-1234"
},
"rootDirectory": "share"
}
}
]
}
FSxWindowsFileServerVolumeConfiguration
- Type: Object
- Required: No
- 이 파라미터는 태스크 스토리지에 FSx for Windows File Server 파일 시스템을 사용할 때 지정합니다.
fileSystemId
- Type: String, Required: Yes
- 사용할 FSx for Windows File Server 파일 시스템 ID.
rootDirectory
- Type: String, Required: Yes
- 호스트 안에서 루트 디렉터리로 마운트할 FSx for Windows File Server 파일 시스템 내부의 디렉터리.
authorizationConfig
credentialsParameter
- Type: String, Required: Yes
- 인증 자격 증명 옵션:
- Secrets Manager 시크릿의 Amazon Resource Name (ARN)
- Systems Manager 파라미터의 Amazon Resource Name (ARN)
domain
- Type: String, Required: Yes
- AWS Directory Service for Microsoft Active Directory(AWS Managed Microsoft AD) 디렉터리나 셀프 호스팅 EC2 Active Directory가 호스팅하는 정규화된(fully qualified) 도메인 이름.
FSx for Windows File Server 볼륨 자격 증명을 저장하는 방법
credentialsParameter에 사용할 자격 증명을 저장하는 방법은 두 가지입니다.
- AWS Secrets Manager 시크릿 — 이 자격 증명은 AWS Secrets Manager 콘솔에서 Other(기타) 유형의 시크릿 카테고리를 사용해 만들 수 있습니다. 각 키/값 쌍마다 행을 추가합니다. 예:
username/admin과password/password. - Systems Manager 파라미터 — 이 자격 증명은 Systems Manager 파라미터 콘솔에서 다음 예제 코드 조각의 형식으로 텍스트를 입력해 만들 수 있습니다.
{ "username": "admin", "password": "password" }
태스크 정의의 FSxWindowsFileServerVolumeConfiguration 파라미터에 있는 credentialsParameter는 시크릿 ARN이나 Systems Manager 파라미터 ARN을 보관합니다. 자세한 내용은 Secrets Manager User Guide의 "What is AWS Secrets Manager"와 Systems Manager User Guide의 "Systems Manager Parameter Store"를 참고하세요.
더 알아보기 (Learn more)
- FSx for Windows File Server 볼륨에 대한 자세한 내용은 AWS 공식 문서를 참고해 주세요.