버킷에서 수명 주기 구성 설정 - Amazon Simple Storage Service

버킷에서 수명 주기 구성 설정

이 섹션에서는 AWS SDK, AWS CLI 또는 Amazon S3 콘솔을 사용하여 버킷에 S3 수명 주기 구성을 설정하는 방법에 대해 설명합니다. S3 수명 주기 구성에 대해서는 스토리지 수명 주기 관리 섹션을 참조하세요.

수명 주기 규칙을 사용하여 객체 수명 주기 동안 Amazon S3에서 수행하려는 작업을 정의할 수 있습니다(예: 객체를 다른 스토리지 클래스로 이전, 객체 보관, 지정된 기간이 경과한 후 객체 삭제).

수명 주기 구성을 설정하기 전에 다음 사항에 유의하세요.

전파 지연

버킷에 S3 수명 주기 구성을 추가할 때 일반적으로 새로운 또는 업데이트된 수명 주기 구성이 모든 Amazon S3 시스템에 완전히 전파될 때까지 약간의 지연 시간이 있습니다. 구성이 완전히 적용되려면 몇 분간 기다려야 합니다. 이러한 지연은 S3 수명 주기 구성을 삭제할 때도 발생할 수 있습니다.

수명 주기 규칙 사용 중지 또는 삭제

수명 주기 규칙을 사용 중지 또는 삭제하는 경우 Amazon S3가 새로운 객체에 대한 삭제 또는 전환 예약을 중지하기 전에 약간의 지연이 발생합니다. 이미 예약된 객체는 모두 예약이 취소되고 삭제 또는 전환되지 않습니다.

참고

수명 주기 규칙을 업데이트, 비활성화 또는 삭제하기 전에 LIST API 작업(예: ListObjectsV2, ListObjectVersions, ListMultipartUploads)을 사용하거나 Amazon S3 인벤토리를 사용하여 사용 사례에 따라 Amazon S3에서 적합한 객체를 전환 및 만료했는지 확인하세요. 수명 주기 규칙을 업데이트, 비활성화 또는 삭제하는 데 문제가 있는 경우 Amazon S3 수명 주기 문제 해결 섹션을 참조하세요.

기존 객체 및 새 객체

버킷에 수명 주기 구성을 추가할 경우 구성 규칙이 기존 객체는 물론 나중에 추가하는 객체에도 적용됩니다. 예를 들어, 특정 접두사가 있는 객체를 생성 후 30일 경과 시 만료시키는 만료 작업을 포함하는 수명 주기 구성 규칙을 오늘 추가할 경우, Amazon S3은 30일 이상 경과한 모든 기존 객체를 삭제 대기열에 넣습니다.

결제 변경 사항

수명 주기 구성 규칙이 충족되는 시점과 규칙 충족에 따라 트리거된 조치가 실행되는 시점 사이에는 지연이 있을 수 있습니다. 그러나 결제 변경은 조치가 실행되지 않더라도 수명 주기 구성 규칙이 충족되는 즉시 변경됩니다.

예를 들어, 객체 만료 시간 이후에는 해당 객체가 즉시 삭제되지 않아도 스토리지 비용이 청구되지 않습니다. 또 다른 예는 객체가 S3 Glacier Flexible Retrieval 스토리지 클래스로 즉시 전환되지 않은 경우에도 객체 전환 시간이 경과하는 순간부터 S3 Glacier Flexible Retrieval 스토리지 요금이 부과된다는 것입니다. S3 Intelligent-Tiering 스토리지 클래스로의 수명 주기 전환은 예외입니다. 객체가 S3 Intelligent-Tiering 스토리지 클래스로 전환되기 전까지는 결제 변경이 발생하지 않습니다.

공유 접두사(공통 문자열로 시작하는 객체 이름) 또는 태그를 사용하여 버킷의 모든 객체 또는 일부 객체에 대해 수명 주기 규칙을 정의할 수 있습니다. 수명 주기 규칙을 사용하여 현재 객체 버전과 최신이 아닌 객체 버전 관련 작업을 정의할 수 있습니다. 자세한 내용은 다음 자료를 참조하세요.

수명 주기 규칙 생성
  1. AWS Management Console에 로그인한 후 https://console.aws.amazon.com/s3/에서 Amazon S3 콘솔을 엽니다.

  2. 버킷(Buckets) 목록에서 수명 주기 규칙을 생성할 버킷의 이름을 선택합니다.

  3. 관리(Management) 탭을 선택하고 수명 주기 규칙 생성(Create lifecycle rule)을 선택합니다.

  4. 수명 주기 규칙 이름(Lifecycle rule name)에 규칙의 이름을 입력합니다.

    단, 버킷 내에서 고유한 이름을 갖도록 합니다.

  5. 수명 주기 규칙의 범위를 선택합니다.

    • 특정 접두사나 태그가 있는 모든 객체에 이 수명 주기 규칙을 적용하려면 Limit the scope to specific prefixes or tags(범위를 특정 접두사 또는 태그로 제한)을 선택합니다.

      • 접두사로 범위를 제한하려면 접두사(Prefix)에 접두사를 입력합니다.

      • 태그로 범위를 제한하려면 태그 추가(Add tag)를 선택하고 태그 키와 값을 입력합니다.

      객체 이름 접두사에 대한 자세한 내용은 객체 키 이름 생성 섹션을 참조하세요. 객체 태그에 대한 자세한 내용은 태그를 사용하여 스토리지 분류 섹션을 참조하세요.

    • 이 수명 주기 규칙을 버킷의 모든 객체에 적용하려면 이 규칙이 버킷의 모든 객체에 적용됨(This rule applies to all objects in the bucket)을 선택하고 이 규칙이 버킷의 모든 객체에 적용됨을 확인합니다(I acknowledge that this rule applies to all objects in the bucket)를 선택합니다.

  6. 객체 크기별로 규칙을 필터링하려면 최소 객체 크기 지정(Specify minimum object size), 최대 객체 크기 지정(Specify maximum object size) 또는 두 옵션을 모두 선택할 수 있습니다.

    • 최소 객체 크기(minimum object size) 또는 최대 객체 크기(maximum object size)를 지정할 때 값은 0바이트보다 크고 최대 5TB여야 합니다. 이 값을 바이트, KB, MB 또는 GB 단위로 지정할 수 있습니다.

    • 둘 다 지정하는 경우 최대 객체 크기(maximum object size)가 최소 객체 크기(minimum object size)보다 커야 합니다.

  7. 수명 주기 규칙 작업(Lifecycle rule actions)에서 다음과 같은 수명 주기 규칙에서 수행할 작업을 선택합니다.

    • 스토리지 클래스 간에 객체의 현재 버전 이전

    • 스토리지 클래스 간에 객체의 이전 버전 이전

    • 객체의 현재 버전 만료

    • 객체의 이전 버전 영구 삭제

    • 만료된 삭제 마커 또는 불완전한 멀티파트 업로드 삭제

    선택한 작업에 따라 다른 옵션이 나타납니다.

  8. 스토리지 클래스 간에 객체의 현재 버전을 이전하려면 스토리지 클래스 간에 객체의 현재 버전 이전에서 다음을 수행합니다.

    1. 스토리지 클래스 이전(Storage class transitions)에서 다음으로 이전할 스토리지 클래스를 선택합니다.

      • Standard-IA

      • 지능형 계층화

      • One Zone-IA

      • S3 Glacier Flexible Retrieval

      • Glacier Deep Archive

    2. 객체 생성일 후 일수(Days after object creation)에 생성일 후 객체를 이전할 일수를 입력합니다.

    스토리지 클래스에 대한 자세한 정보는 Amazon S3 스토리지 클래스 사용를 참조하세요. 최신 객체 버전 또는 이전 객체 버전의 이전 또는 두 버전 모두의 이전을 정의할 수도 있습니다. 버전 관리를 통해 하나의 버킷에서 객체의 여러 버전을 유지할 수 있습니다. 버전 관리에 대한 자세한 내용은 S3 콘솔 사용 섹션을 참조하세요.

    중요

    S3 Glacier Flexible Retrieval 또는 Glacier Deep Archive 스토리지 클래스를 선택하면 객체가 Amazon S3에 그대로 유지됩니다. 별도의 Amazon S3 Glacier 서비스를 통해 객체에 직접 액세스할 수 없습니다. 자세한 내용은 Amazon S3 수명 주기를 사용하여 객체 전환 섹션을 참조하세요.

  9. 스토리지 클래스 간에 최신이 아닌 객체 버전을 이전하려면 스토리지 클래스 간에 최신이 아닌 객체 버전 이전(Transition non-current versions of objects between storage classes)에서 다음을 수행합니다.

    1. 스토리지 클래스 이전(Storage class transitions)에서 다음으로 이전할 스토리지 클래스를 선택합니다.

      • Standard-IA

      • 지능형 계층화

      • One Zone-IA

      • S3 Glacier Flexible Retrieval

      • Glacier Deep Archive

    2. 객체가 최신 버전이 아니게 된 후의 일수(Days after object becomes non-current)에 생성일 후 객체를 이전할 일수를 입력합니다.

  10. 객체의 현재 버전을 만료하려면 Expire current versions of objects(객체의 현재 버전 만료)에서 Number of days after object creation(객체 생성 후 일 수에 일 수)를 입력합니다.

    중요

    버전 관리를 사용하지 않는 버킷에서 만료 작업을 수행하면 Amazon S3에서는 객체를 영구적으로 제거합니다. 수명 주기 규칙에 대한 자세한 내용은 수명 주기 작업을 설명할 요소를 참조하세요.

  11. 이전 객체 버전을 영구적으로 삭제하려면 이전 객체 버전 영구 삭제(Permanently delete noncurrent versions of objects) 아래의 객체가 이전 버전이 된 후 일수(Days after objects become noncurrent)에 일수를 입력합니다. Number of newer versions to retain(유지할 새 버전 수) 아래에 값을 입력하여 유지할 최신 버전 수를 선택적으로 지정할 수 있습니다.

  12. 만료된 삭제 마커 또는 불완전한 멀티파트 업로드 삭제(Delete expired delete markers or incomplete multipart uploads)에서 만료된 객체 삭제 마커 삭제(Delete expired object delete markers)불완전한 멀티파트 업로드 삭제(Delete incomplete multipart uploads)를 선택합니다. 그런 다음 멀티파트 업로드 시작일 이후 불완전한 멀티파트 업로드를 종료하고 정리하고자 하는 일수를 입력합니다.

    멀티파트 업로드에 대한 자세한 내용은 멀티파트 업로드를 사용한 객체 업로드 및 복사 섹션을 참조하세요.

  13. [Create rule]을 선택합니다.

    규칙에 아무런 오류가 없는 경우 Amazon S3에서 이를 사용 설정하고, 이 규칙은 수명 주기 규칙(Lifecycle rules)관리(Management) 탭에서 확인할 수 있습니다.

CloudFormation 템플릿 및 예제에 대한 자세한 내용은 AWS CloudFormation 사용 설명서AWS CloudFormation 템플릿을 사용한 작업AWS::S3::Bucket을 참조하세요.

다음 AWS CLI 명령을 사용하여 S3 수명 주기 구성을 관리할 수 있습니다.

  • put-bucket-lifecycle-configuration

  • get-bucket-lifecycle-configuration

  • delete-bucket-lifecycle

AWS CLI를 설치하는 지침은 AWS CLI를 사용하여 Amazon S3에서 개발 섹션을 참조하세요.

Amazon S3 수명 주기 구성은 XML 파일입니다. 그러나 AWS CLI를 사용할 때는 XML을 지정할 수 없으며 대신 JSON을 지정해야 합니다. 다음은 XML 수명 주기 구성과 AWS CLI 명령에서 지정할 수 있는 그에 상당하는 JSON의 예입니다.

다음 예제 S3 수명 주기 구성을 살펴보세요.

예 1
JSON
{ "Rules": [ { "Filter": { "Prefix": "documents/" }, "Status": "Enabled", "Transitions": [ { "Days": 365, "StorageClass": "GLACIER" } ], "Expiration": { "Days": 3650 }, "ID": "ExampleRule" } ] }
XML
<LifecycleConfiguration> <Rule> <ID>ExampleRule</ID> <Filter> <Prefix>documents/</Prefix> </Filter> <Status>Enabled</Status> <Transition> <Days>365</Days> <StorageClass>GLACIER</StorageClass> </Transition> <Expiration> <Days>3650</Days> </Expiration> </Rule> </LifecycleConfiguration>
예 2
JSON
{ "Rules": [ { "ID": "id-1", "Filter": { "And": { "Prefix": "myprefix", "Tags": [ { "Value": "mytagvalue1", "Key": "mytagkey1" }, { "Value": "mytagvalue2", "Key": "mytagkey2" } ] } }, "Status": "Enabled", "Expiration": { "Days": 1 } } ] }
XML
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Rule> <ID>id-1</ID> <Expiration> <Days>1</Days> </Expiration> <Filter> <And> <Prefix>myprefix</Prefix> <Tag> <Key>mytagkey1</Key> <Value>mytagvalue1</Value> </Tag> <Tag> <Key>mytagkey2</Key> <Value>mytagvalue2</Value> </Tag> </And> </Filter> <Status>Enabled</Status> </Rule> </LifecycleConfiguration>

다음과 같이 put-bucket-lifecycle-configuration을 테스트할 수 있습니다.

구성 테스트
  1. 파일(lifecycle.json)에 JSON 수명 주기 구성을 저장합니다.

  2. 다음 AWS CLI 명령을 실행하여 버킷에서 수명 주기 구성을 설정합니다.

    $ aws s3api put-bucket-lifecycle-configuration  \ --bucket bucketname  \ --lifecycle-configuration file://lifecycle.json
  3. 확인하려면 다음과 같이 get-bucket-lifecycle-configuration AWS CLI 명령을 사용해 S3 수명 주기 구성을 가져옵니다.

    $ aws s3api get-bucket-lifecycle-configuration  \ --bucket bucketname
  4. S3 수명 주기 구성을 삭제하려면 다음과 같이 delete-bucket-lifecycle AWS CLI 명령을 사용합니다.

    aws s3api delete-bucket-lifecycle \ --bucket bucketname
Java

AWS SDK for Java를 사용하여 버킷에서 S3 수명 주기 구성을 관리할 수 있습니다. S3 수명 주기 구성 관리에 대한 자세한 내용은 스토리지 수명 주기 관리 섹션을 참조하세요.

참고

버킷에 S3 수명 주기 구성을 추가하면 Amazon S3이 버킷의 현재 수명 주기 구성(있는 경우)을 대체합니다. 구성을 업데이트하려면 검색한 후 원하는 대로 변경한 다음 수정한 구성을 버킷에 추가합니다.

다음 예제는 AWS SDK for Java를 사용하여 버킷의 수명 주기 구성을 추가, 업데이트 및 삭제하는 방법을 보여줍니다. 이 예제는 다음을 수행합니다.

  • 버킷에 수명 주기 구성을 추가합니다.

  • 수명 주기 구성을 검색하고 다른 규칙을 추가하여 구성을 업데이트합니다.

  • 버킷에 수정된 수명 주기 구성을 추가합니다. Amazon S3에서는 기존 구성을 대체합니다.

  • 구성을 다시 검색한 다음 규칙 수를 인쇄하여 올바른 개수의 규칙이 있는지 확인합니다.

  • 수명 주기 구성을 삭제한 다음 다시 검색을 시도하여 삭제되었는지 확인합니다.

실제 예제를 작성 및 테스트하는 방법에 대한 자세한 내용은 Amazon S3 Java 코드 예제 테스트 섹션을 참조하세요.

import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.regions.Regions; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.model.BucketLifecycleConfiguration; import com.amazonaws.services.s3.model.BucketLifecycleConfiguration.Transition; import com.amazonaws.services.s3.model.StorageClass; import com.amazonaws.services.s3.model.Tag; import com.amazonaws.services.s3.model.lifecycle.LifecycleAndOperator; import com.amazonaws.services.s3.model.lifecycle.LifecycleFilter; import com.amazonaws.services.s3.model.lifecycle.LifecyclePrefixPredicate; import com.amazonaws.services.s3.model.lifecycle.LifecycleTagPredicate; import java.io.IOException; import java.util.Arrays; public class LifecycleConfiguration { public static void main(String[] args) throws IOException { Regions clientRegion = Regions.DEFAULT_REGION; String bucketName = "*** Bucket name ***"; // Create a rule to archive objects with the "glacierobjects/" prefix to Glacier // immediately. BucketLifecycleConfiguration.Rule rule1 = new BucketLifecycleConfiguration.Rule() .withId("Archive immediately rule") .withFilter(new LifecycleFilter(new LifecyclePrefixPredicate("glacierobjects/"))) .addTransition(new Transition().withDays(0).withStorageClass(StorageClass.Glacier)) .withStatus(BucketLifecycleConfiguration.ENABLED); // Create a rule to transition objects to the Standard-Infrequent Access storage // class // after 30 days, then to Glacier after 365 days. Amazon S3 will delete the // objects after 3650 days. // The rule applies to all objects with the tag "archive" set to "true". BucketLifecycleConfiguration.Rule rule2 = new BucketLifecycleConfiguration.Rule() .withId("Archive and then delete rule") .withFilter(new LifecycleFilter(new LifecycleTagPredicate(new Tag("archive", "true")))) .addTransition(new Transition().withDays(30) .withStorageClass(StorageClass.StandardInfrequentAccess)) .addTransition(new Transition().withDays(365).withStorageClass(StorageClass.Glacier)) .withExpirationInDays(3650) .withStatus(BucketLifecycleConfiguration.ENABLED); // Add the rules to a new BucketLifecycleConfiguration. BucketLifecycleConfiguration configuration = new BucketLifecycleConfiguration() .withRules(Arrays.asList(rule1, rule2)); try { AmazonS3 s3Client = AmazonS3ClientBuilder.standard() .withCredentials(new ProfileCredentialsProvider()) .withRegion(clientRegion) .build(); // Save the configuration. s3Client.setBucketLifecycleConfiguration(bucketName, configuration); // Retrieve the configuration. configuration = s3Client.getBucketLifecycleConfiguration(bucketName); // Add a new rule with both a prefix predicate and a tag predicate. configuration.getRules().add(new BucketLifecycleConfiguration.Rule().withId("NewRule") .withFilter(new LifecycleFilter(new LifecycleAndOperator( Arrays.asList(new LifecyclePrefixPredicate("YearlyDocuments/"), new LifecycleTagPredicate(new Tag( "expire_after", "ten_years")))))) .withExpirationInDays(3650) .withStatus(BucketLifecycleConfiguration.ENABLED)); // Save the configuration. s3Client.setBucketLifecycleConfiguration(bucketName, configuration); // Retrieve the configuration. configuration = s3Client.getBucketLifecycleConfiguration(bucketName); // Verify that the configuration now has three rules. configuration = s3Client.getBucketLifecycleConfiguration(bucketName); System.out.println("Expected # of rules = 3; found: " + configuration.getRules().size()); // Delete the configuration. s3Client.deleteBucketLifecycleConfiguration(bucketName); // Verify that the configuration has been deleted by attempting to retrieve it. configuration = s3Client.getBucketLifecycleConfiguration(bucketName); String s = (configuration == null) ? "No configuration found." : "Configuration found."; System.out.println(s); } catch (AmazonServiceException e) { // The call was transmitted successfully, but Amazon S3 couldn't process // it, so it returned an error response. e.printStackTrace(); } catch (SdkClientException e) { // Amazon S3 couldn't be contacted for a response, or the client // couldn't parse the response from Amazon S3. e.printStackTrace(); } } }
.NET

AWS SDK for .NET을 사용하여 버킷에서 S3 수명 주기 구성을 관리할 수 있습니다. 수명 주기 구성 관리에 대한 자세한 내용은 스토리지 수명 주기 관리 섹션을 참조하세요.

참고

수명 주기 구성을 추가하면 Amazon S3이 지정된 버킷에서 기존 구성을 대체합니다. 구성을 업데이트하려면 먼저 수명 주기 구성을 검색하여 변경한 후, 수정한 수명 주기 구성을 버킷에 추가해야 합니다.

다음 예제는 AWS SDK for .NET를 사용하여 버킷의 수명 주기 구성을 추가, 업데이트 및 삭제하는 방법을 보여줍니다. 이 코드 예제에서는 다음 작업을 수행합니다.

  • 버킷에 수명 주기 구성을 추가합니다.

  • 수명 주기 구성을 검색하고 다른 규칙을 추가하여 구성을 업데이트합니다.

  • 버킷에 수정된 수명 주기 구성을 추가합니다. Amazon S3에서는 기존 수명 주기 구성을 대체합니다.

  • 구성을 다시 검색한 다음 구성의 규칙 수를 인쇄하여 구성을 확인합니다.

  • 수명 주기 구성을 삭제하고 삭제되었는지 확인합니다.

실제 예제를 작성하여 테스트하는 방법에 대한 자세한 내용은 Amazon S3 .NET 코드 예제 실행 섹션을 참조하세요.

using Amazon; using Amazon.S3; using Amazon.S3.Model; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Amazon.DocSamples.S3 { class LifecycleTest { private const string bucketName = "*** bucket name ***"; // Specify your bucket region (an example region is shown). private static readonly RegionEndpoint bucketRegion = RegionEndpoint.USWest2; private static IAmazonS3 client; public static void Main() { client = new AmazonS3Client(bucketRegion); AddUpdateDeleteLifecycleConfigAsync().Wait(); } private static async Task AddUpdateDeleteLifecycleConfigAsync() { try { var lifeCycleConfiguration = new LifecycleConfiguration() { Rules = new List<LifecycleRule> { new LifecycleRule { Id = "Archive immediately rule", Filter = new LifecycleFilter() { LifecycleFilterPredicate = new LifecyclePrefixPredicate() { Prefix = "glacierobjects/" } }, Status = LifecycleRuleStatus.Enabled, Transitions = new List<LifecycleTransition> { new LifecycleTransition { Days = 0, StorageClass = S3StorageClass.Glacier } }, }, new LifecycleRule { Id = "Archive and then delete rule", Filter = new LifecycleFilter() { LifecycleFilterPredicate = new LifecyclePrefixPredicate() { Prefix = "projectdocs/" } }, Status = LifecycleRuleStatus.Enabled, Transitions = new List<LifecycleTransition> { new LifecycleTransition { Days = 30, StorageClass = S3StorageClass.StandardInfrequentAccess }, new LifecycleTransition { Days = 365, StorageClass = S3StorageClass.Glacier } }, Expiration = new LifecycleRuleExpiration() { Days = 3650 } } } }; // Add the configuration to the bucket. await AddExampleLifecycleConfigAsync(client, lifeCycleConfiguration); // Retrieve an existing configuration. lifeCycleConfiguration = await RetrieveLifecycleConfigAsync(client); // Add a new rule. lifeCycleConfiguration.Rules.Add(new LifecycleRule { Id = "NewRule", Filter = new LifecycleFilter() { LifecycleFilterPredicate = new LifecyclePrefixPredicate() { Prefix = "YearlyDocuments/" } }, Expiration = new LifecycleRuleExpiration() { Days = 3650 } }); // Add the configuration to the bucket. await AddExampleLifecycleConfigAsync(client, lifeCycleConfiguration); // Verify that there are now three rules. lifeCycleConfiguration = await RetrieveLifecycleConfigAsync(client); Console.WriteLine("Expected # of rulest=3; found:{0}", lifeCycleConfiguration.Rules.Count); // Delete the configuration. await RemoveLifecycleConfigAsync(client); // Retrieve a nonexistent configuration. lifeCycleConfiguration = await RetrieveLifecycleConfigAsync(client); } catch (AmazonS3Exception e) { Console.WriteLine("Error encountered ***. Message:'{0}' when writing an object", e.Message); } catch (Exception e) { Console.WriteLine("Unknown encountered on server. Message:'{0}' when writing an object", e.Message); } } static async Task AddExampleLifecycleConfigAsync(IAmazonS3 client, LifecycleConfiguration configuration) { PutLifecycleConfigurationRequest request = new PutLifecycleConfigurationRequest { BucketName = bucketName, Configuration = configuration }; var response = await client.PutLifecycleConfigurationAsync(request); } static async Task<LifecycleConfiguration> RetrieveLifecycleConfigAsync(IAmazonS3 client) { GetLifecycleConfigurationRequest request = new GetLifecycleConfigurationRequest { BucketName = bucketName }; var response = await client.GetLifecycleConfigurationAsync(request); var configuration = response.Configuration; return configuration; } static async Task RemoveLifecycleConfigAsync(IAmazonS3 client) { DeleteLifecycleConfigurationRequest request = new DeleteLifecycleConfigurationRequest { BucketName = bucketName }; await client.DeleteLifecycleConfigurationAsync(request); } } }
Ruby

AWS SDK for Ruby를 사용하여 버킷에서 AWS::S3::BucketLifecycleConfiguration 클래스를 통해 S3 수명 주기 구성을 관리할 수 있습니다. Amazon S3에서 AWS SDK for Ruby를 사용하는 방법에 대한 자세한 내용은 AWS SDK for Ruby 버전 3 사용 섹션을 참조하세요. 수명 주기 구성 관리에 대한 자세한 내용은 스토리지 수명 주기 관리 섹션을 참조하세요.

Amazon Simple Storage Service API 참조의 다음 섹션에서는 S3 수명 주기 구성과 관련된 REST API 작업에 대해 설명합니다.