AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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

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 PutLifecycleConfiguration call modifies the existing configuration. A PutLifecycleConfiguration call with an empty LifecyclePolicies array in the request body deletes any existing LifecycleConfiguration. In the request, specify the following:

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.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to PutLifecycleConfigurationAsync.

Namespace: Amazon.ElasticFileSystem
Assembly: AWSSDK.ElasticFileSystem.dll
Version: 3.x.y.z

Syntax

C#
public abstract PutLifecycleConfigurationResponse PutLifecycleConfiguration(
         PutLifecycleConfigurationRequest request
)

Parameters

request
Type: Amazon.ElasticFileSystem.Model.PutLifecycleConfigurationRequest

Container for the necessary parameters to execute the PutLifecycleConfiguration service method.

Return Value


The response from the PutLifecycleConfiguration service method, as returned by ElasticFileSystem.

Exceptions

ExceptionCondition
BadRequestException Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.
FileSystemNotFoundException Returned if the specified FileSystemId value doesn't exist in the requester's Amazon Web Services account.
IncorrectFileSystemLifeCycleStateException Returned if the file system's lifecycle state is not "available".
InternalServerErrorException Returned if an error occurred on the server side.

Examples

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.

Creates a new lifecycleconfiguration object for a file system


var client = new AmazonElasticFileSystemClient();
var response = client.PutLifecycleConfiguration(new PutLifecycleConfigurationRequest 
{
    FileSystemId = "fs-01234567",
    LifecyclePolicies = new List<LifecyclePolicy> {
        new LifecyclePolicy { TransitionToIA = "AFTER_30_DAYS" }
    }
});

List<LifecyclePolicy> lifecyclePolicies = response.LifecyclePolicies;

            

Version Information

.NET Framework:
Supported in: 4.7.2 and newer

See Also