ECS: S3 AWS CLI를 구성하고 사용하는 방법

Summary: 기능 및 호환성을 확인하기 위해 AWS CLI를 ECS와 함께 사용하는 고객 시나리오를 테스트하기 위해 AWS CLI를 사용하는 경우 항상 ECS AWS S3 지원 API 호출에 대한 ECS 데이터 액세스 가이드를 참조하십시오.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

AWS 명령줄 인터페이스(AWS CLI)는 S3 상위 수준 명령을 테스트하는 데 사용할 수 있는 AWS의 도구이며, s3 API 수준(s3api)

상위 수준, aws s3 (외부 링크) 명령은 버킷 생성, 나열 및 삭제와 같은 일반적인 버킷 작업을 지원합니다. 툴을 다운로드하고 설치하는 방법, 지원되는 모든 High-Level 명령은 명령을 사용하여 명령 세트에서 얻을 수 있습니다. aws s3api help을 클릭합니다.

S3Uri: S3 오브젝트, 접두사 또는 버킷의 위치를 나타냅니다. s3://mybucket/mykey 이는 mybucket 지정된 S3 버킷이 없는 경우, mykey 은 지정된 S3 키입니다. path 인수는 s3://

API 수준 aws s3api (외부 링크) 명령은 s3api 추천 세트에 포함되어 있습니다. 이러한 S3 API 명령은 버킷 ACL, 버킷 정책, 수명주기 정책과 같은 버킷 메타데이터에 대한 액세스를 제공하며, 지원되는 모든 API 호출은 다음 명령을 사용하여 명령 세트에서 가져올 수 있습니다. aws s3api help명령을 수행할 수 있는 충분한 공간이 있어야 합니다.

  • AWS CLI는 기본적으로 업로드하는 동안 최대 10개의 스레드를 자동으로 사용하여 파일 또는 파트를 업로드합니다
  • AWS CLI는 파일 >= 8MB 파일 크기 multipart_chunksize multipart_threshold 업로드를 자동으로 사용합니다.

설치 지침을 다운로드하고 설치합니다.

  1. 버전 릴리스 https://github.com/aws/aws-cli/releases (외부 링크)
  2. AWS CLI 번들 다운로드 및 설치
# curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
  1. 번들 추출
# unzip awscli-bundle.zip
  1. 설치 명령 실행
# sudo /awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
  1. 버전 확인
# aws version
Output:
      aws-cli/2.0.33 Python/3.7.3 Linux/4.15.0-109-generic botocore/2.0.0dev37

AWS CLI 구성

이 섹션에서는 ECS 오브젝트 사용자를 사용하여 ECS S3에서 사용할 수 있도록 AWS CLI를 구성하는 기본 단계에 대해 설명합니다. 이 섹션에서는 버킷 및 오브젝트 사용자가 ECS에서 이미 생성되었다고 가정합니다. 자격 증명 및 구성 파일은 명령을 실행할 때 업데이트됩니다 aws configure을 클릭합니다.

자격 증명 파일은 여기에 있습니다. ~/.aws/credentials명령을 수행할 수 있는 충분한 공간이 있어야 합니다. 자격 증명 파일은 사용자 프로필 세부 정보(액세스 키 ID 및 암호 액세스 키)를 저장하고, 구성 파일은 지역 및 출력 형식 세부 정보를 저장합니다.

필수:
  • 액세스 키 ID: ECS 오브젝트 사용자
  • 암호 액세스 키: 비밀 키
단계:
  1. 이 예에서는 mc_s3 프로파일 이름을 만듭니다.
# aws configure --profile mc_s3
Prompt:

    AWS Access Key ID [None]: mc_s3
    AWS Secret Access Key [None]: 1guFemRLSgqFau6uKzIVAZJu5+PS+S8qO7rvEsi7
    Default region name [None]: 
    Default output format [None]: json
  1. 모든 프로파일 나열(list-properties AWS CLI v2에서 사용 가능)
# aws configure list-properties
Output:
    mc_s3
    ad_uid1
# aws configure list
Output:
		  Name                    Value             Type    Location
		  ----                    -----             ----    --------
	   profile                <not set>             None    None
	access_key     ****************c_s3 shared-credentials-file    
	secret_key     ****************Esi7 shared-credentials-file    
		region                               config-file    ~/.aws/config
  1. 목록별 프로필
# aws configure get aws_access_key_id --profile mc_s3
Output:
      mc_s3
Dealing with SSL connections and error on self signed certificate.  ( [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1056))
  1. 9021에서 명령을 사용하는 경우 AWS CLI 옵션 --no-verify-ssl 은(는) 자체 서명된 인증서 오류를 우회하는 데 필요합니다.
# aws --profile mc_s3 --endpoint=https://ecshop:9021 s3api list-buckets
Output:
     SSL validation failed for https://ecshop:9021/mc_s3_bkt?acl [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1056)
  • 다음 명령을 실행합니다. --no-verify 이 오류를 우회하는 옵션
# aws --profile mc_s3 --endpoint=https://ecshop:9021 s3api list-buckets --no-verify-ssl --output text
Output:
      
    /usr/local/aws-cli/v2/2.0.33/dist/urllib3/connectionpool.py:986: InsecureRequestWarning: Unverified HTTPS request is being made to host 'ecshop'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

    BUCKETS 2020-02-24T21:24:29.440000+00:00        mc_s3_bkt
    BUCKETS 2020-05-06T17:23:48.870000+00:00        mc_s3_bkt2_backup
    BUCKETS 2020-05-06T21:16:13.344000+00:00        mc_s3_bkt_nfs
    OWNER   mc_s3   mc_s3
  • 두 번째 옵션은 PEM 형식으로 저장된 ECS 자체 서명 인증서를 다운로드하고 --ca-bundle 선택
  • OpenSSL을 사용하여 포트 9021에서 오브젝트 데이터 액세스를 위한 ECS 인증서를 얻고, 선호하는 편집기를 사용하여 인증서 콘텐츠를 복사한 후 아래 예에 따라 인증서 헤더를 포함하여 저장합니다.
# openssl s_client -connect ecshop:9021
여기서 ecshop 은 ECS 노드 IP 또는 호스트 이름이고, xxxxxx는 사용자 환경의 전체 인증서여야 합니다.
Output:

    -----BEGIN CERTIFICATE----- 
    Xxxxxxxxx
    xxxxxxxxx
    ...
    ...
    -----END CERTIFICATE-----
  1. 인증서가 PEM 파일 이름 ecshop_cert_pem에 저장되는 ca-bundle 옵션을 사용하여 인간 친화적 테이블의 버킷 나열 
# aws --profile mc_s3 --endpoint=https://ecshop:9021 s3api list-buckets  --ca-bundle ecshop_cert.pem  --output table
Output:
    -------------------------------------------------------------
    |                        ListBuckets                        |
    +-----------------------------------------------------------+
    ||                         Buckets                         ||
    |+-----------------------------------+---------------------+|
    ||           CreationDate            |        Name         ||
    |+-----------------------------------+---------------------+|
    ||  2020-02-24T21:24:29.440000+00:00 |  mc_s3_bkt          ||
    ||  2020-05-06T17:23:48.870000+00:00 |  mc_s3_bkt2_backup  ||
    ||  2020-05-06T21:16:13.344000+00:00 |  mc_s3_bkt_nfs      ||
    |+-----------------------------------+---------------------+|
    ||                          Owner                          ||
    |+-----------------------------------+---------------------+|
    ||            DisplayName            |         ID          ||
    |+-----------------------------------+---------------------+|
    ||  mc_s3                            |  mc_s3              ||
    |+-----------------------------------+---------------------+|

기본 S3 작업

https://docs.aws.amazon.com/cli/latest/userguide/cli-services-s3-commands.html (외부 링크)
성능 튜닝
  • max_concurrent_requests - 최대 동시 요청 수
  • max_queue_size - 작업 대기열의 최대 작업 수
  • multipart_threshold - CLI가 개별 파일의 다중 파트 전송에 사용하는 크기 임계값입니다.
  • multipart_chunksize - 다중 파트 전송을 사용하는 경우 CLI가 개별 파일의 다중 파트 전송에 사용하는 청크 크기입니다.
  • max_bandwidth - Amazon S3에서 데이터를 업로드하고 다운로드하는 데 사용되는 최대 대역폭입니다.
구성 파일에 예제로 저장됨:
# cat .aws/config
Output:
    [profile mc_s3]
    output = json
    s3 =
            endpoint_url = http://ecshop:9020

              max_concurrent_requests = 20
              max_queue_size = 1000
              multipart_threshold = 64MB
              multipart_chunksize = 16MB
              max_bandwidth = 50MB/s
              addressing_style = auto 
Windows 10 1607 이하 버전에서 aws configure set 업로드 속도를 조정하기 위한 매개변수를 설정하는 명령
$ aws configure set default.s3.max_concurrent_requests 20
$ aws configure set default.s3.max_queue_size 10000
$ aws configure set default.s3.multipart_threshold 64MB
$ aws configure set default.s3.multipart_chunksize 16MB
$ aws configure set default.s3.max_bandwidth 50MB/s
$ aws configure set default.s3.addressing_style auto
단계: 
  1. 다음을 사용하여 버킷 생성 s3 mb 명령
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 mb s3://s3_bkt
Output:
    make_bucket: s3_bkt
  1. 다음을 사용하여 버킷 나열 s3 lss3api list-buckets 명령 세트는 버킷의 다른 작업(S3에서 '접두사'라고 함)(외부 링크)에 대한 버킷을 나열합니다.
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 ls
Output:
   2020-07-29 20:34:24 s3_bkt

  #  aws --profile mc_s3 --endpoint http://ecshop:9020 s3api list-buckets
#  aws --profile mc_s3 --endpoint http://ecshop:9020 s3api list-buckets
Output:		
	 aws --profile mc_s3 --endpoint http://ecshop:9020 s3api list-buckets
	{
		"Buckets": [
			{
				"Name": "mc_s3_bkt",
				"CreationDate": "2020-02-24T21:24:29.440000+00:00"
			},
			{
				"Name": "mc_s3_bkt2_backup",
				"CreationDate": "2020-05-06T17:23:48.870000+00:00"
			},
			{
				"Name": "mc_s3_bkt_nfs",
				"CreationDate": "2020-05-06T21:16:13.344000+00:00"
			},
			{
				"Name": "s3_bkt",
				"CreationDate": "2020-07-30T00:34:24.147000+00:00"
			},
  1.  테스트용 파일 생성 및 업로드 
  • 예제 1MB 및 4MB 파일 생성
# dd if=/dev/zero of=1MB_output.file bs=1024 count=1024
# dd if=/dev/zero of=4MB_output.file bs=1024 count=4096
  • 2GB의 대용량 파일 생성 예시
# dd if=/dev/urandom of=bigfile_2GB bs=1024k count=2048
  • 버킷에 1MB 파일 업로드 s3_bkt
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 cp 1MB_output.file s3://s3_bkt
Output:
    upload: ./1MB_output.file to s3://s3_bkt/1MB_output.file
  1. 버킷의 파일 나열, s3_bkt 프로파일 이름 사용 mc_s3 사용 s3 ls또는 s3api list-objects 명령 세트 
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 ls s3://s3_bkt
Output:
2020-07-29 20:39:43   16.0 MiB 16MB_output.file
2020-07-29 20:37:25    1.0 MiB 1MB_output.file
2020-07-29 20:39:23    4.0 MiB 4MB_output.file
 # aws --profile mc_s3 --endpoint http://ecshop:9020 s3api list-objects --bucket s3_bkt
Output:
	{
		"Contents": [
			{
				"Key": "16MB_output.file",
				"LastModified": "2020-07-30T00:39:43.125000+00:00",
				"ETag": "\"3a2d20e2e504fe056bbaae5b4c2351fd-2\"",
				"Size": 16777216,
				"StorageClass": "STANDARD",
				"Owner": {
					"DisplayName": "mc_s3",
					"ID": "mc_s3"
				}
			},
			{
				"Key": "1MB_output.file",
				"LastModified": "2020-07-30T00:37:25.033000+00:00",
				"ETag": "\"b6d81b360a5672d80c27430f39153e2c\"",
				"Size": 1048576,
				"StorageClass": "STANDARD",
				"Owner": {
					"DisplayName": "mc_s3",
					"ID": "mc_s3"
				}
			},
  1. 오브젝트 버전 나열
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api list-object-versions --bucket s3_bkt --output text
  1. 1MB_output.file 파일 다운로드 s3_bkt 로컬 머신의 /tmp 디렉토리로 이동합니다.
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 cp s3://s3_bkt/1MB_output.file /tmp/
Output:
     download: s3://s3_bkt/1MB_output.file to ../../tmp/1MB_output.file
  1. 출력을 위해 YAML 형식의 1MB_output.file 파일의 ACL에서 가독성을 확인합니다.
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api get-object-acl --bucket s3_bkt --key 1MB_output.file  --output yaml
Output:
        
    Grants:
    - Grantee:
        DisplayName: mc_s3
        ID: mc_s3
        Type: CanonicalUser
      Permission: FULL_CONTROL
    Owner:
      DisplayName: mc_s3
      ID: mc_s3
  1. 버킷에서 버킷 ACL 확인 s3_bkt
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api get-bucket-acl --bucket s3_bkt --output yaml
Output:      
    Grants:
    - Grantee:
        DisplayName: mc_s3
        ID: mc_s3
        Type: CanonicalUser
      Permission: FULL_CONTROL
    Owner:
      DisplayName: mc_s3
      ID: mc_s3
  1. 버킷 버전 확인 또는 버킷에 대한 버전 관리 활성화
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api get-bucket-versioning --bucket s3_bkt
Output:

    {
        "Status": "Enabled"
    }
  1. 대용량 파일에서 s3api API 수준을 사용하여 멀티파트 업로드 시작 
  1. 5GB 파일 만들기:
# time dd if=/dev/urandom of=bigfile_5GB bs=1024k count=5096
  1. 업로드 시작
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api create-multipart-upload --bucket s3_bkt --key bigfile_5GB
Output:

    {
        "Bucket": "s3_bkt",
        "Key": "bigfile_5GB",
        "UploadId": "27cb6c45ab5c4c838fb5893263d871d3"
    }
  1. 불완전한 다중 파트 파일 업로드 나열 https://aws.amazon.com/premiumsupport/knowledge-center/s3-multipart-upload-cli/ (외부 링크)
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api list-multipart-uploads --bucket s3_bkt
Output:

	{
	    "Uploads": [
	        {
	            "UploadId": "27cb6c45ab5c4c838fb5893263d871d3",
	            "Key": "bigfile_5GB",
	            "Initiated": "2020-07-31T01:10:56.323000+00:00",
	            "StorageClass": "STANDARD",
	            "Owner": {
	                "DisplayName": "mc_s3",
	                "ID": "mc_s3"
	            }
	        }
	    ]
	}
  1. 개선하다 s3 cp 대용량 파일에 대한 명령 또는 버킷 간 성능 권장 사항 다중 파트 업로드를 시작하고 동시 스레드를 변경하려면 위의 성능 튜닝을 참조하십시오.
  1. 버킷 간 복사를 수행하여 file.txt를 복사합니다. mc_s3_bkt 에서 s3_bkt S3api 사용 
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api copy-object --copy-source mc_s3_bkt/file.txt --key file.txt --bucket s3_bkt
Output:
{
    "VersionId": "1596159769267",
    "CopyObjectResult": {
        "ETag": "\"c789e490a90359de2bd3b09d7e957cfd-128\"",
        "LastModified": "2020-07-31T01:42:49.267000+00:00"
    }
}
  1. 버킷의 파일(오브젝트 또는 키) 나열 
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 ls s3://s3_bkt/file.txt --human-readable  summarize
Output:
      2020-07-30 21:42:49    1.0 GiB file.txt
  1. 다음에서 파일 복사 S3_bkt 에서 mc_s3_bkt S3 CP 상위 수준 명령 세트 사용
다음 cp 명령은 단일 s3 오브젝트를 지정된 버킷과 키에 복사합니다.
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 cp s3://s3_bkt/file.txt s3://mc_s3_bkt/file2.txt
       Output:
         copy: s3://s3_bkt/file.txt to s3://mc_s3_bkt/file2.txt
  1. 버킷에서 버전 관리가 활성화되어 있는지 확인 s3_bkt
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api get-bucket-versioning --bucket s3_bkt
Output: 

      {
          "Status": "Enabled"
      }
  1. 다음을 사용하여 버킷 삭제 s3 rb command(명령에 출력이 없음)
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3 rm s3://s3_bkt2
  1. 다음 예에서는 버킷의 모든 객체 및 하위 폴더를 삭제한 다음 버킷을 제거합니다. (버전 관리가 활성화된 경우 이 명령은 버전 객체를 제거하지 않습니다(LDS, 라이프 사이클 정책 검토).
# aws s3 rb s3://bucket-name --force
  1. 버킷에 버전 관리 활성화 s3_bkt s3api API 수준 명령 집합 사용(명령이 출력되지 않음)
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api put-bucket-versioning --bucket s3_bkt --versioning-configuration Status=Enabled 
  1. 수명주기 정책 적용 템플릿 생성(ECS 데이터 액세스 가이드 참조) AWS CLI에는 수명주기 정책에 json 형식이 필요합니다.
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api put-bucket-lifecycle-configuration --generate-cli-skeleton input --bucket s3_bkt
  1. 버킷에 버킷 수명 정책을 적용합니다. 자세한 내용은 ECS 데이터 액세스 가이드를 참조하십시오.
다음에 대한 정책 생성 AbortIncompleteMultipartUpload, NoncurrentVersionExpiration, and ExpiredObjectDeleteMarker and NoncurrentDays 7일 후에 만료됩니다.
#  aws --profile mc_s3 --endpoint http://ecshop:9020 s3api put-bucket-lifecycle --bucket s3_bkt --lifecycle-configuration file://s3_bkt_lifecycle.json
Output:

{
   "Rules": [
   {
      "ID": "expire-non-current-and-dmarkers-and-mpu",
      "Status": "Enabled",
      "Prefix": "/",
      "Expiration": {
         "ExpiredObjectDeleteMarker": true
      },
      "AbortIncompleteMultipartUpload": {
         "DaysAfterInitiation": 7
      },
      "NoncurrentVersionExpiration": {
         "NoncurrentDays": 7
      }
   }
   ]
}
  1. GET 수명주기 정책
# aws --profile mc_s3 --endpoint http://ecshop:9020 s3api get-bucket-lifecycle --bucket s3_bkt
Output:

{
    "Rules": [
        {
            "Expiration": {
                "Days": 10
            },
            "ID": "DeleteVersion-musa",
            "Prefix": "",
            "Status": "Enabled",
            "NoncurrentVersionExpiration": {
                "NoncurrentDays": 10
            }
        }
    ]
}
  1. 키 값 쌍을 사용한 오브젝트 태그 지정 
  1. 파일을 씁니다. 
$ aws s3 cp file.txt s3://mc_s3_bkt/aws/tag.txt  --profile mc_s3_emea --endpoint  http://emea:9020
upload: ./file.txt to s3://mc_s3_bkt/aws/tag.txt
  1. 태그 추가(이 명령은 성공한 경우 출력되지 않습니다. 
    한 줄 명령:
$ aws s3api put-object-tagging --profile mc_s3_emea --bucket mc_s3_bkt --key aws/tag.txt --tagging '{"TagSet": [{ "Key": "Product", "Value": "ECS" }]}' --endpoint-url http://emea:9020

여러 줄 복사 및 붙여넣기: 

$ aws s3api put-object-tagging \
	 --profile mc_s3_emea \
     --bucket mc_s3_bkt \
     --key aws/tag.txt \
     --tagging '{"TagSet": [{ "Key": "Product", "Value": "ECS" }]}' \
    --endpoint-url http://emea:9020
  1. 오브젝트 태그를 가져옵니다.
$ aws s3api get-object-tagging --profile mc_s3_emea --bucket mc_s3_bkt --key aws/tag.txt --endpoint http://emea:9020

{
    "TagSet": [
        {
            "Key": "Product",
            "Value": "ECS"
        }
    ]
}
  1. 여러 태그 값 추가 'key:value' - 짧은 형식
$ aws s3api put-object-tagging --profile mc_s3_emea --bucket mc_s3_bkt --key aws/tag5.txt --tagging '{"TagSet": [{ "Key": "Product", "Value": "ECS 3.6.1.2" },{"Key": "Company", "Value": "Dell Technologies"}]}' --endpoint-url http://emea:9020
  1. 오브젝트 태그를 가져옵니다.
$ aws s3api get-object-tagging --profile mc_s3_emea --bucket mc_s3_bkt --key aws/tag5.txt
{
    "TagSet": [
        {
            "Key": "Product",
            "Value": "ECS 3.6.1.2"
        },
        {
            "Key": "Company",
            "Value": "Dell Technologies"
        }
    ]
}
  1. S3 객체 잠금
ECS를 사용하면 S3 Object Lock을 통해 WORM(Write-Once-Read-Many) 모델을 사용하여 오브젝트를 저장할 수 있습니다. 이 기능은 지정된 시간 동안 또는 무기한으로 오브젝트가 삭제되거나 덮어쓰이는 것을 방지합니다.
 
참고:
  • ECS S3 Object Lock 기능은 버전 관리가 활성화된 버킷만 지원합니다.
  • Object Lock에 대한 ECS 사용자 인터페이스는 없습니다. ECS Object Lock API를 통해 액세스할 수 있습니다.
  • 잠긴 객체는 수명주기 삭제로부터 보호됩니다
  • 버킷은 파일 시스템을 활성화할 수 없습니다.
  • 오브젝트 잠금은 기존 사용자가 아닌 IAM 사용자에게 작동합니다. 
  • 버킷에서 오브젝트 잠금 활성화, 버전 관리 자동 활성화 
  • ADO가 활성화된 경우 패치가 필요하며 ECS 3.7에서 해결해야 합니다. 다음 문서를 참조하십시오. ECS: ECS for IBM Content Manager에서 오브젝트 잠금 기능 비활성화


버킷에 오브젝트 잠금을 설정하려면 다음을 수행합니다.
Use put-object-lock-configuration option은 AWS CLI와 함께 사용됩니다.

참조: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html put-object-lock-configuration — AWS CLI 1.22.24 명령 참조(amazon.com)(외부 링크)

  • 버킷에 객체 잠금 구성을 설정하려면
The following put-object-lock-configuration example sets a 1-day object lock on the specified bucket.

$ aws s3api put-object-lock-configuration \
	--profile iam1 \
    --bucket iam-bucket \
    --object-lock-configuration '{ "ObjectLockEnabled": "Enabled", "Rule": { "DefaultRetention": { "Mode": "COMPLIANCE", "Days": 1 }}}'

이 명령은 출력을 생성하지 않습니다.

  • put-object-legal-hold
$ aws s3api put-object-legal-hold --endpoint http://<hostname>:<port_number> --profile iam1 --bucket iam-bucket --key file1.txt --legal-hold "Status=ON"
where:
	--profile: name of profile is profile confirmed in .aws credentials file
	--bucket: Bucket name
	--key: Object name
	--legal-hold: ON or OFF
	--version-id: specifies the version id of the object for Versioned 
	--endpoint: ECS IP and port 9020 or 90201
  • get-object-legal-hold
$ aws s3api get-object-legal-hold --endpoint http://<hostname>:<port_number> --profile iam1 --bucket iam-bucket --key file1.txt
where:
	--bucket: Bucket name
	--key: Object name
	--version-id: specifies the version id of the object
	--endpoint: ECS IP and port 9020 or 90201

Affected Products

Elastic Cloud Storage

Products

ECS Appliance, ECS Appliance Hardware Series, ECS Appliance Software with Encryption, Elastic Cloud Storage
Article Properties
Article Number: 000020564
Article Type: How To
Last Modified: 02 Oct 2025
Version:  6
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.