이 문서는 AWS CLI의 버전 1에만 해당합니다.
곧 AWS CLI 버전 1에 대한 지원이 종료될 예정임을 알려드립니다. AWS CLI 버전 2로 마이그레이션하는 것이 좋습니다. 마이그레이션 날짜, 추가 세부 정보 및 방법에 대한 자세한 내용은 공지 사항
Directory Service를 사용한 예시AWS CLI
다음 코드 예제는 Directory Service와 함께 AWS Command Line Interface를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.
작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.
각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.
주제
작업
다음 코드 예제에서는 describe-directories의 사용 방법을 보여줍니다.
- AWS CLI
-
디렉터리에 대한 세부 정보를 가져오려면
다음
describe-directories예제에서는 지정된 디렉터리에 대한 세부 정보를 표시합니다.aws ds describe-directories \ --directory-idd-a1b2c3d4e5출력:
{ "DirectoryDescriptions": [ { "DirectoryId": "d-a1b2c3d4e5", "Name": "mydirectory.example.com", "ShortName": "mydirectory", "Size": "Small", "Edition": "Standard", "Alias": "d-a1b2c3d4e5", "AccessUrl": "d-a1b2c3d4e5.awsapps.com", "Stage": "Active", "ShareStatus": "Shared", "ShareMethod": "HANDSHAKE", "ShareNotes": "These are my share notes", "LaunchTime": "2019-07-08T15:33:46.327000-07:00", "StageLastUpdatedDateTime": "2019-07-08T15:59:12.307000-07:00", "Type": "SharedMicrosoftAD", "SsoEnabled": false, "DesiredNumberOfDomainControllers": 0, "OwnerDirectoryDescription": { "DirectoryId": "d-b2c3d4e5f6", "AccountId": "123456789111", "DnsIpAddrs": [ "203.113.0.248", "203.113.0.253" ], "VpcSettings": { "VpcId": "vpc-a1b2c3d4", "SubnetIds": [ "subnet-a1b2c3d4", "subnet-d4c3b2a1" ], "AvailabilityZones": [ "us-west-2a", "us-west-2c" ] } } } ] }-
API 세부 정보는 AWS CLI 명령 참조의 DescribeDirectories
를 참조하세요.
-
다음 코드 예제에서는 describe-trusts의 사용 방법을 보여줍니다.
- AWS CLI
-
신뢰 관계에 대한 세부 정보를 가져오려면
다음
describe-trusts예제에서는 지정된 디렉터리의 신뢰 관계에 대한 세부 정보를 표시합니다.aws ds describe-trusts \ --directory-idd-a1b2c3d4e5출력:
{ "Trusts": [ { "DirectoryId": "d-a1b2c3d4e5", "TrustId": "t-9a8b7c6d5e", "RemoteDomainName": "other.example.com", "TrustType": "Forest", "TrustDirection": "Two-Way", "TrustState": "Verified", "CreatedDateTime": "2017-06-20T18:08:45.614000-07:00", "LastUpdatedDateTime": "2019-06-04T10:52:12.410000-07:00", "StateLastUpdatedDateTime": "2019-06-04T10:52:12.410000-07:00", "SelectiveAuth": "Disabled" } ] }-
API 세부 정보는 AWS CLI 명령 참조의 DescribeTrusts
를 참조하세요.
-