CLI로 GetBucketInventoryConfiguration 사용 - AWS SDK 코드 예제

AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제가 있습니다.

CLI로 GetBucketInventoryConfiguration 사용

다음 코드 예시는 GetBucketInventoryConfiguration의 사용 방법을 보여 줍니다.

CLI
AWS CLI

버킷의 인벤토리 구성 가져오기

다음 get-bucket-inventory-configuration 예시에서는 지정된 버킷에 대해 ID가 1인 인벤토리 구성을 가져옵니다.

aws s3api get-bucket-inventory-configuration \ --bucket amzn-s3-demo-bucket \ --id 1

출력:

{ "InventoryConfiguration": { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "ORC", "Bucket": "arn:aws:s3:::amzn-s3-demo-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "1", "Schedule": { "Frequency": "Weekly" } } }
PowerShell
Tools for PowerShell V4

예시 1: 이 명령은 지정된 S3 버킷에 대해 이름이 'testinventory'인 인벤토리의 세부 정보를 반환합니다.

Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
Tools for PowerShell V5

예시 1: 이 명령은 지정된 S3 버킷에 대해 이름이 'testinventory'인 인벤토리의 세부 정보를 반환합니다.

Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'