Skip to content

Put Lifecycle Configuration

efs_put_lifecycle_configuration R Documentation

Use this action to manage storage for your file system

Description

Use this action to manage storage for your file system. A LifecycleConfiguration consists of one or more LifecyclePolicy objects that define the following:

  • TransitionToIA – When to move files in the file system from primary storage (Standard storage class) into the Infrequent Access (IA) storage.

  • TransitionToArchive – When to move files in the file system from their current storage class (either IA or Standard storage) into the Archive storage.

    File systems cannot transition into Archive storage before transitioning into IA storage. Therefore, TransitionToArchive must either not be set or must be later than TransitionToIA.

    The Archive storage class is available only for file systems that use the Elastic Throughput mode and the General Purpose Performance mode.

  • TransitionToPrimaryStorageClass – Whether to move files in the file system back to primary storage (Standard storage class) after they are accessed in IA or Archive storage.

For more information, see Managing file system storage.

Each Amazon EFS file system supports one lifecycle configuration, which applies to all files in the file system. If a LifecycleConfiguration object already exists for the specified file system, a put_lifecycle_configuration call modifies the existing configuration. A put_lifecycle_configuration call with an empty LifecyclePolicies array in the request body deletes any existing LifecycleConfiguration. In the request, specify the following:

  • The ID for the file system for which you are enabling, disabling, or modifying Lifecycle management.

  • A LifecyclePolicies array of LifecyclePolicy objects that define when to move files to IA storage, to Archive storage, and back to primary storage.

    Amazon EFS requires that each LifecyclePolicy object have only have a single transition, so the LifecyclePolicies array needs to be structured with separate LifecyclePolicy objects. See the example requests in the following section for more information.

This operation requires permissions for the elasticfilesystem:PutLifecycleConfiguration operation.

To apply a LifecycleConfiguration object to an encrypted file system, you need the same Key Management Service permissions as when you created the encrypted file system.

Usage

efs_put_lifecycle_configuration(FileSystemId, LifecyclePolicies)

Arguments

FileSystemId

[required] The ID of the file system for which you are creating the LifecycleConfiguration object (String).

LifecyclePolicies

[required] An array of LifecyclePolicy objects that define the file system's LifecycleConfiguration object. A LifecycleConfiguration object informs EFS Lifecycle management of the following:

  • TransitionToIA – When to move files in the file system from primary storage (Standard storage class) into the Infrequent Access (IA) storage.

  • TransitionToArchive – When to move files in the file system from their current storage class (either IA or Standard storage) into the Archive storage.

    File systems cannot transition into Archive storage before transitioning into IA storage. Therefore, TransitionToArchive must either not be set or must be later than TransitionToIA.

    The Archive storage class is available only for file systems that use the Elastic Throughput mode and the General Purpose Performance mode.

  • TransitionToPrimaryStorageClass – Whether to move files in the file system back to primary storage (Standard storage class) after they are accessed in IA or Archive storage.

When using the put-lifecycle-configuration CLI command or the put_lifecycle_configuration API action, Amazon EFS requires that each LifecyclePolicy object have only a single transition. This means that in a request body, LifecyclePolicies must be structured as an array of LifecyclePolicy objects, one object for each storage transition. See the example requests in the following section for more information.

Value

A list with the following syntax:

list(
  LifecyclePolicies = list(
    list(
      TransitionToIA = "AFTER_7_DAYS"|"AFTER_14_DAYS"|"AFTER_30_DAYS"|"AFTER_60_DAYS"|"AFTER_90_DAYS"|"AFTER_1_DAY"|"AFTER_180_DAYS"|"AFTER_270_DAYS"|"AFTER_365_DAYS",
      TransitionToPrimaryStorageClass = "AFTER_1_ACCESS",
      TransitionToArchive = "AFTER_1_DAY"|"AFTER_7_DAYS"|"AFTER_14_DAYS"|"AFTER_30_DAYS"|"AFTER_60_DAYS"|"AFTER_90_DAYS"|"AFTER_180_DAYS"|"AFTER_270_DAYS"|"AFTER_365_DAYS"
    )
  )
)

Request syntax

svc$put_lifecycle_configuration(
  FileSystemId = "string",
  LifecyclePolicies = list(
    list(
      TransitionToIA = "AFTER_7_DAYS"|"AFTER_14_DAYS"|"AFTER_30_DAYS"|"AFTER_60_DAYS"|"AFTER_90_DAYS"|"AFTER_1_DAY"|"AFTER_180_DAYS"|"AFTER_270_DAYS"|"AFTER_365_DAYS",
      TransitionToPrimaryStorageClass = "AFTER_1_ACCESS",
      TransitionToArchive = "AFTER_1_DAY"|"AFTER_7_DAYS"|"AFTER_14_DAYS"|"AFTER_30_DAYS"|"AFTER_60_DAYS"|"AFTER_90_DAYS"|"AFTER_180_DAYS"|"AFTER_270_DAYS"|"AFTER_365_DAYS"
    )
  )
)

Examples

## Not run: 
# This operation enables lifecycle management on a file system by creating
# a new LifecycleConfiguration object. A LifecycleConfiguration object
# defines when files in an Amazon EFS file system are automatically
# transitioned to the lower-cost EFS Infrequent Access (IA) storage class.
# A LifecycleConfiguration applies to all files in a file system.
svc$put_lifecycle_configuration(
  FileSystemId = "fs-01234567",
  LifecyclePolicies = list(
    list(
      TransitionToIA = "AFTER_30_DAYS"
    )
  )
)

## End(Not run)