Amazon ECS 작업 정의에서 FSx for Windows File Server 파일 시스템 지정
컨테이너에 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
-
유형: 객체
필수 여부: 아니요
이 파라미터는 태스크 저장에 FSx for Windows File Server 파일 시스템을 사용할 때 지정됩니다.
fileSystemId
-
유형: 문자열
필수 항목 여부: 예
사용할 FSx for Windows File Server 파일 시스템 ID입니다.
rootDirectory
-
유형: 문자열
필수 항목 여부: 예
호스트 내의 루트 디렉터리로 탑재할 FSx for Windows File Server 파일 시스템 내 디렉터리입니다.
authorizationConfig
-
credentialsParameter
-
유형: 문자열
필수 항목 여부: 예
권한 부여 자격 증명 옵션:
-
Secrets Manager 암호의 Amazon 리소스 이름(ARN).
-
Systems Manager 파라미터의 Amazon 리소스 이름(ARN).
-
domain
-
유형: 문자열
필수 항목 여부: 예
셀프 호스팅된 EC2 Active Directory 또는 AWS Directory Service for Microsoft Active Directory(AWS Managed Microsoft AD) 디렉터리에서 호스팅하는 정규화된 도메인 이름입니다.
FSx for Windows File Server 볼륨 자격 증명을 저장하는 방법
자격 증명 파라미터와 함께 사용할 자격 증명을 저장하는 방법에는 두 가지가 있습니다.
-
AWS Secrets Manager 암호
이 자격 증명은 다른 암호 유형 카테고리를 사용하여 AWS Secrets Manager 콘솔에서 생성할 수 있습니다. 각 키/값 쌍, 사용자 이름/관리자 및 암호/
암호
에 대한 열을 추가합니다. -
Systems Manager 파라미터
이 자격 증명은 다음 예제 코드 조각에 표시된 형식으로 텍스트를 입력하여 Systems Manager 파라미터 콘솔에서 생성될 수 있습니다.
{ "username": "admin", "password":
"password"
}
태스크 정의 FSxWindowsFileServerVolumeConfiguration
파라미터의 credentialsParameter
는 암호 ARN 또는 Systems Manager 파라미터 ARN을 보유합니다. 자세한 정보는 Secrets Manager 사용 설명서의 AWS Secrets Manager란 무엇인가요? 및 Systems Manager 사용 설명서의 Systems Manager 파라미터 스토어를 참조하세요.