From 15498ce95a984b049617977bf29061d80cf652ab Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 27 Nov 2023 20:10:27 +0000 Subject: [PATCH] feat(client-efs): Adding support for EFS Replication to existing file system. --- clients/client-efs/README.md | 8 + clients/client-efs/src/EFS.ts | 23 +++ clients/client-efs/src/EFSClient.ts | 10 +- .../src/commands/CreateFileSystemCommand.ts | 3 + .../CreateReplicationConfigurationCommand.ts | 71 ++++--- .../DeleteReplicationConfigurationCommand.ts | 10 +- .../commands/DescribeFileSystemsCommand.ts | 3 + .../DescribeLifecycleConfigurationCommand.ts | 4 +- .../PutLifecycleConfigurationCommand.ts | 13 +- .../src/commands/UpdateFileSystemCommand.ts | 3 + .../UpdateFileSystemProtectionCommand.ts | 177 +++++++++++++++++ clients/client-efs/src/commands/index.ts | 1 + clients/client-efs/src/models/models_0.ts | 188 +++++++++++++++++- .../client-efs/src/protocols/Aws_restJson1.ts | 160 +++++++++++++++ codegen/sdk-codegen/aws-models/efs.json | 167 +++++++++++++++- 15 files changed, 787 insertions(+), 54 deletions(-) create mode 100644 clients/client-efs/src/commands/UpdateFileSystemProtectionCommand.ts diff --git a/clients/client-efs/README.md b/clients/client-efs/README.md index 2b66e2056709..1e236960c189 100644 --- a/clients/client-efs/README.md +++ b/clients/client-efs/README.md @@ -448,3 +448,11 @@ UpdateFileSystem [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/efs/command/UpdateFileSystemCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-efs/Interface/UpdateFileSystemCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-efs/Interface/UpdateFileSystemCommandOutput/) +
+ +UpdateFileSystemProtection + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/efs/command/UpdateFileSystemProtectionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-efs/Interface/UpdateFileSystemProtectionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-efs/Interface/UpdateFileSystemProtectionCommandOutput/) + +
diff --git a/clients/client-efs/src/EFS.ts b/clients/client-efs/src/EFS.ts index 02852679a337..e87810258de8 100644 --- a/clients/client-efs/src/EFS.ts +++ b/clients/client-efs/src/EFS.ts @@ -140,6 +140,11 @@ import { UpdateFileSystemCommandInput, UpdateFileSystemCommandOutput, } from "./commands/UpdateFileSystemCommand"; +import { + UpdateFileSystemProtectionCommand, + UpdateFileSystemProtectionCommandInput, + UpdateFileSystemProtectionCommandOutput, +} from "./commands/UpdateFileSystemProtectionCommand"; import { EFSClient, EFSClientConfig } from "./EFSClient"; const commands = { @@ -173,6 +178,7 @@ const commands = { TagResourceCommand, UntagResourceCommand, UpdateFileSystemCommand, + UpdateFileSystemProtectionCommand, }; export interface EFS { @@ -652,6 +658,23 @@ export interface EFS { options: __HttpHandlerOptions, cb: (err: any, data?: UpdateFileSystemCommandOutput) => void ): void; + + /** + * @see {@link UpdateFileSystemProtectionCommand} + */ + updateFileSystemProtection( + args: UpdateFileSystemProtectionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateFileSystemProtection( + args: UpdateFileSystemProtectionCommandInput, + cb: (err: any, data?: UpdateFileSystemProtectionCommandOutput) => void + ): void; + updateFileSystemProtection( + args: UpdateFileSystemProtectionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateFileSystemProtectionCommandOutput) => void + ): void; } /** diff --git a/clients/client-efs/src/EFSClient.ts b/clients/client-efs/src/EFSClient.ts index 55fc3d54be53..7bcb5b008c21 100644 --- a/clients/client-efs/src/EFSClient.ts +++ b/clients/client-efs/src/EFSClient.ts @@ -131,6 +131,10 @@ import { import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; import { UpdateFileSystemCommandInput, UpdateFileSystemCommandOutput } from "./commands/UpdateFileSystemCommand"; +import { + UpdateFileSystemProtectionCommandInput, + UpdateFileSystemProtectionCommandOutput, +} from "./commands/UpdateFileSystemProtectionCommand"; import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, @@ -175,7 +179,8 @@ export type ServiceInputTypes = | PutLifecycleConfigurationCommandInput | TagResourceCommandInput | UntagResourceCommandInput - | UpdateFileSystemCommandInput; + | UpdateFileSystemCommandInput + | UpdateFileSystemProtectionCommandInput; /** * @public @@ -210,7 +215,8 @@ export type ServiceOutputTypes = | PutLifecycleConfigurationCommandOutput | TagResourceCommandOutput | UntagResourceCommandOutput - | UpdateFileSystemCommandOutput; + | UpdateFileSystemCommandOutput + | UpdateFileSystemProtectionCommandOutput; /** * @public diff --git a/clients/client-efs/src/commands/CreateFileSystemCommand.ts b/clients/client-efs/src/commands/CreateFileSystemCommand.ts index 0ae400281b56..38f41052241c 100644 --- a/clients/client-efs/src/commands/CreateFileSystemCommand.ts +++ b/clients/client-efs/src/commands/CreateFileSystemCommand.ts @@ -148,6 +148,9 @@ export interface CreateFileSystemCommandOutput extends FileSystemDescription, __ * // Value: "STRING_VALUE", // required * // }, * // ], + * // FileSystemProtection: { // FileSystemProtectionDescription + * // ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING", + * // }, * // }; * * ``` diff --git a/clients/client-efs/src/commands/CreateReplicationConfigurationCommand.ts b/clients/client-efs/src/commands/CreateReplicationConfigurationCommand.ts index fd9cc5077d65..7e8ffca59fb9 100644 --- a/clients/client-efs/src/commands/CreateReplicationConfigurationCommand.ts +++ b/clients/client-efs/src/commands/CreateReplicationConfigurationCommand.ts @@ -49,39 +49,46 @@ export interface CreateReplicationConfigurationCommandOutput * - *

The following properties are set by default:

+ * + *

After the file system is created, you cannot change the KMS key.

+ *
+ *

For new destination file systems, the following properties are set by default:

*
    *
  • *

    - * Performance mode - The destination file system's performance - * mode matches that of the source file system, unless the destination file system uses EFS - * One Zone storage. In that case, the General Purpose performance mode is used. The - * performance mode cannot be changed.

    + * Performance mode - The destination file system's + * performance mode matches that of the source file system, unless the destination file + * system uses EFS One Zone storage. In that case, the General Purpose performance mode is + * used. The performance mode cannot be changed.

    *
  • *
  • *

    - * Throughput mode - The destination file system's throughput - * mode matches that of the source file system. After the file system is created, you can modify the - * throughput mode.

    + * Throughput mode - The destination file system's + * throughput mode matches that of the source file system. After the file system is created, + * you can modify the throughput mode.

    *
  • *
- *

The following properties are turned off by default:

*
    *
  • *

    * Lifecycle management – Lifecycle management is not enabled * on the destination file system. After the destination file system is created, you can - * enable it.

    + * enable lifecycle management.

    *
  • *
  • *

    @@ -135,6 +144,7 @@ export interface CreateReplicationConfigurationCommandOutput * Region: "STRING_VALUE", * AvailabilityZoneName: "STRING_VALUE", * KmsKeyId: "STRING_VALUE", + * FileSystemId: "STRING_VALUE", * }, * ], * }; @@ -168,6 +178,9 @@ export interface CreateReplicationConfigurationCommandOutput *

    Returned if the request is malformed or contains an error such as an invalid * parameter value or a missing required parameter.

    * + * @throws {@link ConflictException} (client fault) + *

    Returned if the source file system in a replication is encrypted but the destination file system is unencrypted.

    + * * @throws {@link FileSystemLimitExceeded} (client fault) *

    Returned if the Amazon Web Services account has already created the maximum number of file systems * allowed per account.

    diff --git a/clients/client-efs/src/commands/DeleteReplicationConfigurationCommand.ts b/clients/client-efs/src/commands/DeleteReplicationConfigurationCommand.ts index 0296ba0426c6..94b0ad3d08cb 100644 --- a/clients/client-efs/src/commands/DeleteReplicationConfigurationCommand.ts +++ b/clients/client-efs/src/commands/DeleteReplicationConfigurationCommand.ts @@ -40,10 +40,12 @@ export interface DeleteReplicationConfigurationCommandOutput extends __MetadataB /** * @public - *

    Deletes an existing replication configuration. Deleting a replication configuration ends the replication process. After a - * replication configuration is deleted, the destination file system is no longer read-only. You - * can write to the destination file system after its status becomes - * Writeable.

    + *

    Deletes a replication configuration. Deleting a replication configuration ends the + * replication process. After a replication configuration is deleted, the destination file system + * becomes Writeable and its replication overwrite protection is re-enabled. For + * more information, see Delete a replication configuration.

    + *

    This operation requires permissions for the + * elasticfilesystem:DeleteReplicationConfiguration action.

    * @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-efs/src/commands/DescribeFileSystemsCommand.ts b/clients/client-efs/src/commands/DescribeFileSystemsCommand.ts index eaab5d192e8a..8ab6602279ee 100644 --- a/clients/client-efs/src/commands/DescribeFileSystemsCommand.ts +++ b/clients/client-efs/src/commands/DescribeFileSystemsCommand.ts @@ -103,6 +103,9 @@ export interface DescribeFileSystemsCommandOutput extends DescribeFileSystemsRes * // Value: "STRING_VALUE", // required * // }, * // ], + * // FileSystemProtection: { // FileSystemProtectionDescription + * // ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING", + * // }, * // }, * // ], * // NextMarker: "STRING_VALUE", diff --git a/clients/client-efs/src/commands/DescribeLifecycleConfigurationCommand.ts b/clients/client-efs/src/commands/DescribeLifecycleConfigurationCommand.ts index 24a7679d726a..82c3c5a725cc 100644 --- a/clients/client-efs/src/commands/DescribeLifecycleConfigurationCommand.ts +++ b/clients/client-efs/src/commands/DescribeLifecycleConfigurationCommand.ts @@ -43,8 +43,8 @@ export interface DescribeLifecycleConfigurationCommandOutput /** * @public *

    Returns the current LifecycleConfiguration object for the specified Amazon - * EFS file system. Llifecycle management uses the LifecycleConfiguration object to - * identify when to move files between storage classes. For a file system without a + * EFS file system. Lifecycle management uses the LifecycleConfiguration object + * to identify when to move files between storage classes. For a file system without a * LifecycleConfiguration object, the call returns an empty array in the * response.

    *

    This operation requires permissions for the diff --git a/clients/client-efs/src/commands/PutLifecycleConfigurationCommand.ts b/clients/client-efs/src/commands/PutLifecycleConfigurationCommand.ts index 2fece8b43b10..908955c587d5 100644 --- a/clients/client-efs/src/commands/PutLifecycleConfigurationCommand.ts +++ b/clients/client-efs/src/commands/PutLifecycleConfigurationCommand.ts @@ -37,7 +37,7 @@ export interface PutLifecycleConfigurationCommandOutput extends LifecycleConfigu /** * @public - *

    Use this action to manage storage of your file system. A + *

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

    *
      @@ -63,24 +63,25 @@ export interface PutLifecycleConfigurationCommandOutput extends LifecycleConfigu * 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 + * 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.

    + *

    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 for the file system.

    - *

    In the request, specify the following:

    + * LifecycleConfiguration. In the request, specify the following:

    *
      *
    • *

      The ID for the file system for which you are enabling, disabling, or modifying diff --git a/clients/client-efs/src/commands/UpdateFileSystemCommand.ts b/clients/client-efs/src/commands/UpdateFileSystemCommand.ts index c82a9dce446a..be9945047946 100644 --- a/clients/client-efs/src/commands/UpdateFileSystemCommand.ts +++ b/clients/client-efs/src/commands/UpdateFileSystemCommand.ts @@ -81,6 +81,9 @@ export interface UpdateFileSystemCommandOutput extends FileSystemDescription, __ * // Value: "STRING_VALUE", // required * // }, * // ], + * // FileSystemProtection: { // FileSystemProtectionDescription + * // ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING", + * // }, * // }; * * ``` diff --git a/clients/client-efs/src/commands/UpdateFileSystemProtectionCommand.ts b/clients/client-efs/src/commands/UpdateFileSystemProtectionCommand.ts new file mode 100644 index 000000000000..2be03158da25 --- /dev/null +++ b/clients/client-efs/src/commands/UpdateFileSystemProtectionCommand.ts @@ -0,0 +1,177 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { EFSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EFSClient"; +import { FileSystemProtectionDescription, UpdateFileSystemProtectionRequest } from "../models/models_0"; +import { de_UpdateFileSystemProtectionCommand, se_UpdateFileSystemProtectionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateFileSystemProtectionCommand}. + */ +export interface UpdateFileSystemProtectionCommandInput extends UpdateFileSystemProtectionRequest {} +/** + * @public + * + * The output of {@link UpdateFileSystemProtectionCommand}. + */ +export interface UpdateFileSystemProtectionCommandOutput extends FileSystemProtectionDescription, __MetadataBearer {} + +/** + * @public + *

      Updates protection on the file system.

      + *

      This operation requires permissions for the + * elasticfilesystem:UpdateFileSystemProtection action.

      + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EFSClient, UpdateFileSystemProtectionCommand } from "@aws-sdk/client-efs"; // ES Modules import + * // const { EFSClient, UpdateFileSystemProtectionCommand } = require("@aws-sdk/client-efs"); // CommonJS import + * const client = new EFSClient(config); + * const input = { // UpdateFileSystemProtectionRequest + * FileSystemId: "STRING_VALUE", // required + * ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING", + * }; + * const command = new UpdateFileSystemProtectionCommand(input); + * const response = await client.send(command); + * // { // FileSystemProtectionDescription + * // ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING", + * // }; + * + * ``` + * + * @param UpdateFileSystemProtectionCommandInput - {@link UpdateFileSystemProtectionCommandInput} + * @returns {@link UpdateFileSystemProtectionCommandOutput} + * @see {@link UpdateFileSystemProtectionCommandInput} for command's `input` shape. + * @see {@link UpdateFileSystemProtectionCommandOutput} for command's `response` shape. + * @see {@link EFSClientResolvedConfig | config} for EFSClient's `config` shape. + * + * @throws {@link BadRequest} (client fault) + *

      Returned if the request is malformed or contains an error such as an invalid + * parameter value or a missing required parameter.

      + * + * @throws {@link FileSystemNotFound} (client fault) + *

      Returned if the specified FileSystemId value doesn't exist in the + * requester's Amazon Web Services account.

      + * + * @throws {@link IncorrectFileSystemLifeCycleState} (client fault) + *

      Returned if the file system's lifecycle state is not "available".

      + * + * @throws {@link InsufficientThroughputCapacity} (server fault) + *

      Returned if there's not enough capacity to provision additional throughput. This value + * might be returned when you try to create a file system in provisioned throughput mode, + * when you attempt to increase the provisioned throughput of an existing file system, or + * when you attempt to change an existing file system from Bursting Throughput to + * Provisioned Throughput mode. Try again later.

      + * + * @throws {@link InternalServerError} (server fault) + *

      Returned if an error occurred on the server side.

      + * + * @throws {@link ReplicationAlreadyExists} (client fault) + *

      Returned if the file system is already included in a replication configuration.>

      + * + * @throws {@link ThroughputLimitExceeded} (client fault) + *

      Returned if the throughput mode or amount of provisioned throughput can't be changed + * because the throughput limit of 1024 MiB/s has been reached.

      + * + * @throws {@link TooManyRequests} (client fault) + *

      Returned if you don’t wait at least 24 hours before either changing the throughput mode, or + * decreasing the Provisioned Throughput value.

      + * + * @throws {@link EFSServiceException} + *

      Base exception class for all service exceptions from EFS service.

      + * + */ +export class UpdateFileSystemProtectionCommand extends $Command< + UpdateFileSystemProtectionCommandInput, + UpdateFileSystemProtectionCommandOutput, + EFSClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateFileSystemProtectionCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: EFSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateFileSystemProtectionCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "EFSClient"; + const commandName = "UpdateFileSystemProtectionCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "MagnolioAPIService_v20150201", + operation: "UpdateFileSystemProtection", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateFileSystemProtectionCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateFileSystemProtectionCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_UpdateFileSystemProtectionCommand(output, context); + } +} diff --git a/clients/client-efs/src/commands/index.ts b/clients/client-efs/src/commands/index.ts index 82838b815829..986c6dc2629f 100644 --- a/clients/client-efs/src/commands/index.ts +++ b/clients/client-efs/src/commands/index.ts @@ -29,3 +29,4 @@ export * from "./PutLifecycleConfigurationCommand"; export * from "./TagResourceCommand"; export * from "./UntagResourceCommand"; export * from "./UpdateFileSystemCommand"; +export * from "./UpdateFileSystemProtectionCommand"; diff --git a/clients/client-efs/src/models/models_0.ts b/clients/client-efs/src/models/models_0.ts index 0d8916f90529..6761a78ec787 100644 --- a/clients/client-efs/src/models/models_0.ts +++ b/clients/client-efs/src/models/models_0.ts @@ -470,6 +470,44 @@ export class BadRequest extends __BaseException { } } +/** + * @public + *

      Returned if the source file system in a replication is encrypted but the destination file system is unencrypted.

      + */ +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + * @public + *

      The error code is a string that uniquely identifies an error condition. + * It is meant to be read and understood by programs that detect and handle errors by type.

      + */ + ErrorCode?: string; + + /** + * @public + *

      The error message contains a generic description of the error + * condition in English. It is intended for a human audience. Simple programs display the message directly + * to the end user if they encounter an error condition they don't know how or don't care to handle. + * Sophisticated programs with more exhaustive error handling and proper internationalization are + * more likely to ignore the error message.

      + */ + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ConflictException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConflictException.prototype); + this.ErrorCode = opts.ErrorCode; + this.Message = opts.Message; + } +} + /** * @public */ @@ -875,6 +913,56 @@ export class FileSystemAlreadyExists extends __BaseException { } } +/** + * @public + * @enum + */ +export const ReplicationOverwriteProtection = { + DISABLED: "DISABLED", + ENABLED: "ENABLED", + REPLICATING: "REPLICATING", +} as const; + +/** + * @public + */ +export type ReplicationOverwriteProtection = + (typeof ReplicationOverwriteProtection)[keyof typeof ReplicationOverwriteProtection]; + +/** + * @public + *

      Describes the protection on a file system.

      + */ +export interface FileSystemProtectionDescription { + /** + * @public + *

      The status of the file system's replication overwrite protection.

      + *
        + *
      • + *

        + * ENABLED – The file system cannot be used as the destination file + * system in a replication configuration. The file system is writeable. Replication overwrite + * protection is ENABLED by default.

        + *
      • + *
      • + *

        + * DISABLED – The file system can be used as the destination file + * system in a replication configuration. The file system is read-only and can only be + * modified by EFS replication.

        + *
      • + *
      • + *

        + * REPLICATING – The file system is being used as the destination + * file system in a replication configuration. The file system is read-only and is only + * modified only by EFS replication.

        + *
      • + *
      + *

      If the replication configuration is deleted, the file system's replication overwrite + * protection is re-enabled, the file system becomes writeable.

      + */ + ReplicationOverwriteProtection?: ReplicationOverwriteProtection; +} + /** * @public *

      The latest known metered size (in bytes) of data stored in the file system, in its @@ -1053,6 +1141,12 @@ export interface FileSystemDescription { * objects.

      */ Tags: Tag[] | undefined; + + /** + * @public + *

      Describes the protection on the file system.

      + */ + FileSystemProtection?: FileSystemProtectionDescription; } /** @@ -1594,7 +1688,8 @@ export class SubnetNotFound extends __BaseException { /** * @public - *

      Describes the destination file system to create in the replication configuration.

      + *

      Describes the new or existing destination file system for the replication + * configuration.

      */ export interface DestinationToCreate { /** @@ -1612,7 +1707,7 @@ export interface DestinationToCreate { /** * @public - *

      Specifies the Key Management Service (KMS) key that you want to use to + *

      Specify the Key Management Service (KMS) key that you want to use to * encrypt the destination file system. If you do not specify a KMS key, Amazon EFS uses your default KMS key for Amazon EFS, * /aws/elasticfilesystem. This ID can be in one of the following formats:

      *
        @@ -1635,6 +1730,14 @@ export interface DestinationToCreate { *
      */ KmsKeyId?: string; + + /** + * @public + *

      The ID of the file system to use for the destination. The file system's replication + * overwrite replication must be disabled. If you do not provide an ID, then EFS creates a new + * file system for the replication destination.

      + */ + FileSystemId?: string; } /** @@ -2406,8 +2509,8 @@ export type TransitionToPrimaryStorageClassRules = /** * @public *

      Describes a policy used by Lifecycle management that specifies when to transition files - * into and out of the Infrequent Access (IA) and Archive storage - * classes. For more information, see Managing file system storage.

      + * into and out of storage classes. For more information, see Managing file system + * storage.

      * *

      When using the put-lifecycle-configuration CLI command or the * PutLifecycleConfiguration API action, Amazon EFS requires that each @@ -3033,3 +3136,80 @@ export interface UpdateFileSystemRequest { */ ProvisionedThroughputInMibps?: number; } + +/** + * @public + *

      Returned if the file system is already included in a replication configuration.>

      + */ +export class ReplicationAlreadyExists extends __BaseException { + readonly name: "ReplicationAlreadyExists" = "ReplicationAlreadyExists"; + readonly $fault: "client" = "client"; + /** + * @public + *

      The error code is a string that uniquely identifies an error condition. + * It is meant to be read and understood by programs that detect and handle errors by type.

      + */ + ErrorCode?: string; + + /** + * @public + *

      The error message contains a generic description of the error + * condition in English. It is intended for a human audience. Simple programs display the message directly + * to the end user if they encounter an error condition they don't know how or don't care to handle. + * Sophisticated programs with more exhaustive error handling and proper internationalization are + * more likely to ignore the error message.

      + */ + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ReplicationAlreadyExists", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ReplicationAlreadyExists.prototype); + this.ErrorCode = opts.ErrorCode; + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface UpdateFileSystemProtectionRequest { + /** + * @public + *

      The ID of the file system to update.

      + */ + FileSystemId: string | undefined; + + /** + * @public + *

      The status of the file system's replication overwrite protection.

      + *
        + *
      • + *

        + * ENABLED – The file system cannot be used as the destination file + * system in a replication configuration. The file system is writeable. Replication overwrite + * protection is ENABLED by default.

        + *
      • + *
      • + *

        + * DISABLED – The file system can be used as the destination file + * system in a replication configuration. The file system is read-only and can only be + * modified by EFS replication.

        + *
      • + *
      • + *

        + * REPLICATING – The file system is being used as the destination file + * system in a replication configuration. The file system is read-only and is only modified + * only by EFS replication.

        + *
      • + *
      + *

      If the replication configuration is deleted, the file system's replication overwrite + * protection is re-enabled, the file system becomes writeable.

      + */ + ReplicationOverwriteProtection?: ReplicationOverwriteProtection; +} diff --git a/clients/client-efs/src/protocols/Aws_restJson1.ts b/clients/client-efs/src/protocols/Aws_restJson1.ts index c32c3ea23ed7..7bba4642f170 100644 --- a/clients/client-efs/src/protocols/Aws_restJson1.ts +++ b/clients/client-efs/src/protocols/Aws_restJson1.ts @@ -108,6 +108,10 @@ import { import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; import { UpdateFileSystemCommandInput, UpdateFileSystemCommandOutput } from "../commands/UpdateFileSystemCommand"; +import { + UpdateFileSystemProtectionCommandInput, + UpdateFileSystemProtectionCommandOutput, +} from "../commands/UpdateFileSystemProtectionCommand"; import { EFSServiceException as __BaseException } from "../models/EFSServiceException"; import { AccessPointAlreadyExists, @@ -116,6 +120,7 @@ import { AvailabilityZonesMismatch, BackupPolicy, BadRequest, + ConflictException, CreationInfo, DependencyTimeout, Destination, @@ -139,6 +144,7 @@ import { NoFreeAddressesInSubnet, PolicyNotFound, PosixUser, + ReplicationAlreadyExists, ReplicationConfigurationDescription, ReplicationNotFound, RootDirectory, @@ -1163,6 +1169,45 @@ export const se_UpdateFileSystemCommand = async ( }); }; +/** + * serializeAws_restJson1UpdateFileSystemProtectionCommand + */ +export const se_UpdateFileSystemProtectionCommand = async ( + input: UpdateFileSystemProtectionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/2015-02-01/file-systems/{FileSystemId}/protection"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "FileSystemId", + () => input.FileSystemId!, + "{FileSystemId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + ReplicationOverwriteProtection: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + /** * deserializeAws_restJson1CreateAccessPointCommand */ @@ -1259,6 +1304,7 @@ export const de_CreateFileSystemCommand = async ( Encrypted: __expectBoolean, FileSystemArn: __expectString, FileSystemId: __expectString, + FileSystemProtection: _json, KmsKeyId: __expectString, LifeCycleState: __expectString, Name: __expectString, @@ -1452,6 +1498,9 @@ const de_CreateReplicationConfigurationCommandError = async ( case "BadRequest": case "com.amazonaws.efs#BadRequest": throw await de_BadRequestRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.efs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "FileSystemLimitExceeded": case "com.amazonaws.efs#FileSystemLimitExceeded": throw await de_FileSystemLimitExceededRes(parsedOutput, context); @@ -2871,6 +2920,7 @@ export const de_UpdateFileSystemCommand = async ( Encrypted: __expectBoolean, FileSystemArn: __expectString, FileSystemId: __expectString, + FileSystemProtection: _json, KmsKeyId: __expectString, LifeCycleState: __expectString, Name: __expectString, @@ -2930,6 +2980,74 @@ const de_UpdateFileSystemCommandError = async ( } }; +/** + * deserializeAws_restJson1UpdateFileSystemProtectionCommand + */ +export const de_UpdateFileSystemProtectionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateFileSystemProtectionCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ReplicationOverwriteProtection: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateFileSystemProtectionCommandError + */ +const de_UpdateFileSystemProtectionCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "BadRequest": + case "com.amazonaws.efs#BadRequest": + throw await de_BadRequestRes(parsedOutput, context); + case "FileSystemNotFound": + case "com.amazonaws.efs#FileSystemNotFound": + throw await de_FileSystemNotFoundRes(parsedOutput, context); + case "IncorrectFileSystemLifeCycleState": + case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": + throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); + case "InsufficientThroughputCapacity": + case "com.amazonaws.efs#InsufficientThroughputCapacity": + throw await de_InsufficientThroughputCapacityRes(parsedOutput, context); + case "InternalServerError": + case "com.amazonaws.efs#InternalServerError": + throw await de_InternalServerErrorRes(parsedOutput, context); + case "ReplicationAlreadyExists": + case "com.amazonaws.efs#ReplicationAlreadyExists": + throw await de_ReplicationAlreadyExistsRes(parsedOutput, context); + case "ThroughputLimitExceeded": + case "com.amazonaws.efs#ThroughputLimitExceeded": + throw await de_ThroughputLimitExceededRes(parsedOutput, context); + case "TooManyRequests": + case "com.amazonaws.efs#TooManyRequests": + throw await de_TooManyRequestsRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + const throwDefaultError = withBaseException(__BaseException); /** * deserializeAws_restJson1AccessPointAlreadyExistsRes @@ -3031,6 +3149,24 @@ const de_BadRequestRes = async (parsedOutput: any, context: __SerdeContext): Pro return __decorateServiceException(exception, parsedOutput.body); }; +/** + * deserializeAws_restJson1ConflictExceptionRes + */ +const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + ErrorCode: __expectString, + Message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + /** * deserializeAws_restJson1DependencyTimeoutRes */ @@ -3344,6 +3480,27 @@ const de_PolicyNotFoundRes = async (parsedOutput: any, context: __SerdeContext): return __decorateServiceException(exception, parsedOutput.body); }; +/** + * deserializeAws_restJson1ReplicationAlreadyExistsRes + */ +const de_ReplicationAlreadyExistsRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + ErrorCode: __expectString, + Message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ReplicationAlreadyExists({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + /** * deserializeAws_restJson1ReplicationNotFoundRes */ @@ -3588,6 +3745,7 @@ const de_FileSystemDescription = (output: any, context: __SerdeContext): FileSys Encrypted: __expectBoolean, FileSystemArn: __expectString, FileSystemId: __expectString, + FileSystemProtection: _json, KmsKeyId: __expectString, LifeCycleState: __expectString, Name: __expectString, @@ -3613,6 +3771,8 @@ const de_FileSystemDescriptions = (output: any, context: __SerdeContext): FileSy return retVal; }; +// de_FileSystemProtectionDescription omitted. + /** * deserializeAws_restJson1FileSystemSize */ diff --git a/codegen/sdk-codegen/aws-models/efs.json b/codegen/sdk-codegen/aws-models/efs.json index 75b6ff145b8f..3a5d07d5dede 100644 --- a/codegen/sdk-codegen/aws-models/efs.json +++ b/codegen/sdk-codegen/aws-models/efs.json @@ -289,6 +289,22 @@ "smithy.api#pattern": "^.+$" } }, + "com.amazonaws.efs#ConflictException": { + "type": "structure", + "members": { + "ErrorCode": { + "target": "com.amazonaws.efs#ErrorCode" + }, + "Message": { + "target": "com.amazonaws.efs#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

      Returned if the source file system in a replication is encrypted but the destination file system is unencrypted.

      ", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, "com.amazonaws.efs#CreateAccessPoint": { "type": "operation", "input": { @@ -598,6 +614,9 @@ { "target": "com.amazonaws.efs#BadRequest" }, + { + "target": "com.amazonaws.efs#ConflictException" + }, { "target": "com.amazonaws.efs#FileSystemLimitExceeded" }, @@ -627,7 +646,7 @@ } ], "traits": { - "smithy.api#documentation": "

      Creates a replication configuration that replicates an existing EFS file system\n to a new, read-only file system. For more information, see Amazon EFS replication in the\n Amazon EFS User Guide. The replication configuration\n specifies the following:

      \n
        \n
      • \n

        \n Source file system - An existing EFS file system that you\n want replicated. The source file system cannot be a destination file system in an existing\n replication configuration.

        \n
      • \n
      • \n

        \n Destination file system configuration - The configuration of\n the destination file system to which the source file system will be replicated. There can\n only be one destination file system in a replication configuration. The destination file\n system configuration consists of the following properties:

        \n
          \n
        • \n

          \n Amazon Web Services Region - The Amazon Web Services Region in which the destination file system is created. Amazon EFS replication is available in all Amazon Web Services Regions in which EFS is\n available. To use EFS replication in a Region that is disabled by default, you must\n first opt in to the Region. For more information, see Managing Amazon Web Services Regions in the Amazon Web Services General Reference\n Reference Guide\n

          \n
        • \n
        • \n

          \n Availability Zone - If you want the destination file system\n to use EFS One Zone availability, you must specify the Availability Zone to create the\n file system in. For more information about EFS storage classes, see \n Amazon EFS storage classes in the Amazon EFS User\n Guide.

          \n
        • \n
        • \n

          \n Encryption - All destination file systems are created with\n encryption at rest enabled. You can specify the Key Management Service (KMS) key that is used to encrypt the destination file system. If you don't\n specify a KMS key, your service-managed KMS key for\n Amazon EFS is used.

          \n \n

          After the file system is created, you cannot change the KMS key.

          \n
          \n
        • \n
        \n
      • \n
      \n

      The following properties are set by default:

      \n
        \n
      • \n

        \n Performance mode - The destination file system's performance\n mode matches that of the source file system, unless the destination file system uses EFS\n One Zone storage. In that case, the General Purpose performance mode is used. The\n performance mode cannot be changed.

        \n
      • \n
      • \n

        \n Throughput mode - The destination file system's throughput\n mode matches that of the source file system. After the file system is created, you can modify the\n throughput mode.

        \n
      • \n
      \n

      The following properties are turned off by default:

      \n
        \n
      • \n

        \n Lifecycle management – Lifecycle management is not enabled\n on the destination file system. After the destination file system is created, you can\n enable it.

        \n
      • \n
      • \n

        \n Automatic backups – Automatic daily backups are enabled on\n the destination file system. After the file system is created, you can change this\n setting.

        \n
      • \n
      \n

      For more information, see Amazon EFS replication in the\n Amazon EFS User Guide.

      ", + "smithy.api#documentation": "

      Creates a replication configuration that replicates an existing EFS file system\n to a new, read-only file system. For more information, see Amazon EFS replication in the\n Amazon EFS User Guide. The replication configuration\n specifies the following:

      \n
        \n
      • \n

        \n Source file system – The EFS file system that\n you want replicated. The source file system cannot be a destination file system in an\n existing replication configuration.

        \n
      • \n
      • \n

        \n Amazon Web Services Region – The Amazon Web Services Region in which the destination file system is created. Amazon EFS\n replication is available in all Amazon Web Services Regions in which EFS is available. The\n Region must be enabled. For more information, see Managing Amazon Web Services Regions in the Amazon Web Services General Reference\n Reference Guide.

        \n
      • \n
      • \n

        \n Destination file system configuration – The\n configuration of the destination file system to which the source file system will be\n replicated. There can only be one destination file system in a replication configuration.

        \n

        Parameters for the replication configuration include:

        \n
          \n
        • \n

          \n File system ID – The ID of the destination\n file system for the replication. If no ID is provided, then EFS creates a new file\n system with the default settings. For existing file systems, the file system's\n replication overwrite protection must be disabled. For more information, see Replicating to\n an existing file system.

          \n
        • \n
        • \n

          \n Availability Zone – If you want the destination file\n system to use One Zone storage, you must specify the Availability Zone to create the\n file system in. For more information, see \n EFS file system types in the Amazon EFS User\n Guide.

          \n
        • \n
        • \n

          \n Encryption – All destination file systems are created\n with encryption at rest enabled. You can specify the Key Management Service (KMS) key that is used to encrypt the destination file system. If you don't\n specify a KMS key, your service-managed KMS key for\n Amazon EFS is used.

          \n \n

          After the file system is created, you cannot change the KMS key.

          \n
          \n
        • \n
        \n
      • \n
      \n \n

      After the file system is created, you cannot change the KMS key.

      \n
      \n

      For new destination file systems, the following properties are set by default:

      \n
        \n
      • \n

        \n Performance mode - The destination file system's\n performance mode matches that of the source file system, unless the destination file\n system uses EFS One Zone storage. In that case, the General Purpose performance mode is\n used. The performance mode cannot be changed.

        \n
      • \n
      • \n

        \n Throughput mode - The destination file system's\n throughput mode matches that of the source file system. After the file system is created,\n you can modify the throughput mode.

        \n
      • \n
      \n
        \n
      • \n

        \n Lifecycle management – Lifecycle management is not enabled\n on the destination file system. After the destination file system is created, you can\n enable lifecycle management.

        \n
      • \n
      • \n

        \n Automatic backups – Automatic daily backups are enabled on\n the destination file system. After the file system is created, you can change this\n setting.

        \n
      • \n
      \n

      For more information, see Amazon EFS replication in the\n Amazon EFS User Guide.

      ", "smithy.api#http": { "method": "POST", "uri": "/2015-02-01/file-systems/{SourceFileSystemId}/replication-configuration", @@ -995,7 +1014,7 @@ } ], "traits": { - "smithy.api#documentation": "

      Deletes an existing replication configuration. Deleting a replication configuration ends the replication process. After a\n replication configuration is deleted, the destination file system is no longer read-only. You\n can write to the destination file system after its status becomes\n Writeable.

      ", + "smithy.api#documentation": "

      Deletes a replication configuration. Deleting a replication configuration ends the\n replication process. After a replication configuration is deleted, the destination file system\n becomes Writeable and its replication overwrite protection is re-enabled. For\n more information, see Delete a replication configuration.

      \n

      This operation requires permissions for the\n elasticfilesystem:DeleteReplicationConfiguration action.

      ", "smithy.api#http": { "method": "DELETE", "uri": "/2015-02-01/file-systems/{SourceFileSystemId}/replication-configuration", @@ -1472,7 +1491,7 @@ } ], "traits": { - "smithy.api#documentation": "

      Returns the current LifecycleConfiguration object for the specified Amazon\n EFS file system. Llifecycle management uses the LifecycleConfiguration object to\n identify when to move files between storage classes. For a file system without a\n LifecycleConfiguration object, the call returns an empty array in the\n response.

      \n

      This operation requires permissions for the\n elasticfilesystem:DescribeLifecycleConfiguration operation.

      ", + "smithy.api#documentation": "

      Returns the current LifecycleConfiguration object for the specified Amazon\n EFS file system. Lifecycle management uses the LifecycleConfiguration object\n to identify when to move files between storage classes. For a file system without a\n LifecycleConfiguration object, the call returns an empty array in the\n response.

      \n

      This operation requires permissions for the\n elasticfilesystem:DescribeLifecycleConfiguration operation.

      ", "smithy.api#examples": [ { "title": "To describe the lifecycle configuration for a file system", @@ -1975,12 +1994,18 @@ "KmsKeyId": { "target": "com.amazonaws.efs#KmsKeyId", "traits": { - "smithy.api#documentation": "

      Specifies the Key Management Service (KMS) key that you want to use to\n encrypt the destination file system. If you do not specify a KMS key, Amazon EFS uses your default KMS key for Amazon EFS,\n /aws/elasticfilesystem. This ID can be in one of the following formats:

      \n
        \n
      • \n

        Key ID - The unique identifier of the key, for example\n 1234abcd-12ab-34cd-56ef-1234567890ab.

        \n
      • \n
      • \n

        ARN - The Amazon Resource Name (ARN) for the key, for example\n arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

        \n
      • \n
      • \n

        Key alias - A previously created display name for a key, for example\n alias/projectKey1.

        \n
      • \n
      • \n

        Key alias ARN - The ARN for a key alias, for example\n arn:aws:kms:us-west-2:444455556666:alias/projectKey1.

        \n
      • \n
      " + "smithy.api#documentation": "

      Specify the Key Management Service (KMS) key that you want to use to\n encrypt the destination file system. If you do not specify a KMS key, Amazon EFS uses your default KMS key for Amazon EFS,\n /aws/elasticfilesystem. This ID can be in one of the following formats:

      \n
        \n
      • \n

        Key ID - The unique identifier of the key, for example\n 1234abcd-12ab-34cd-56ef-1234567890ab.

        \n
      • \n
      • \n

        ARN - The Amazon Resource Name (ARN) for the key, for example\n arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

        \n
      • \n
      • \n

        Key alias - A previously created display name for a key, for example\n alias/projectKey1.

        \n
      • \n
      • \n

        Key alias ARN - The ARN for a key alias, for example\n arn:aws:kms:us-west-2:444455556666:alias/projectKey1.

        \n
      • \n
      " + } + }, + "FileSystemId": { + "target": "com.amazonaws.efs#FileSystemId", + "traits": { + "smithy.api#documentation": "

      The ID of the file system to use for the destination. The file system's replication\n overwrite replication must be disabled. If you do not provide an ID, then EFS creates a new\n file system for the replication destination.

      " } } }, "traits": { - "smithy.api#documentation": "

      Describes the destination file system to create in the replication configuration.

      " + "smithy.api#documentation": "

      Describes the new or existing destination file system for the replication\n configuration.

      " } }, "com.amazonaws.efs#Destinations": { @@ -2155,6 +2180,12 @@ "smithy.api#documentation": "

      The tags associated with the file system, presented as an array of Tag\n objects.

      ", "smithy.api#required": {} } + }, + "FileSystemProtection": { + "target": "com.amazonaws.efs#FileSystemProtectionDescription", + "traits": { + "smithy.api#documentation": "

      Describes the protection on the file system.

      " + } } }, "traits": { @@ -2259,6 +2290,20 @@ } } }, + "com.amazonaws.efs#FileSystemProtectionDescription": { + "type": "structure", + "members": { + "ReplicationOverwriteProtection": { + "target": "com.amazonaws.efs#ReplicationOverwriteProtection", + "traits": { + "smithy.api#documentation": "

      The status of the file system's replication overwrite protection.

      \n
        \n
      • \n

        \n ENABLED – The file system cannot be used as the destination file\n system in a replication configuration. The file system is writeable. Replication overwrite\n protection is ENABLED by default.

        \n
      • \n
      • \n

        \n DISABLED – The file system can be used as the destination file\n system in a replication configuration. The file system is read-only and can only be\n modified by EFS replication.

        \n
      • \n
      • \n

        \n REPLICATING – The file system is being used as the destination\n file system in a replication configuration. The file system is read-only and is only\n modified only by EFS replication.

        \n
      • \n
      \n

      If the replication configuration is deleted, the file system's replication overwrite\n protection is re-enabled, the file system becomes writeable.

      " + } + } + }, + "traits": { + "smithy.api#documentation": "

      Describes the protection on a file system.

      " + } + }, "com.amazonaws.efs#FileSystemSize": { "type": "structure", "members": { @@ -2535,7 +2580,7 @@ } }, "traits": { - "smithy.api#documentation": "

      Describes a policy used by Lifecycle management that specifies when to transition files\n into and out of the Infrequent Access (IA) and Archive storage\n classes. For more information, see Managing file system storage.

      \n \n

      When using the put-lifecycle-configuration CLI command or the\n PutLifecycleConfiguration API action, Amazon EFS requires that each\n LifecyclePolicy object have only a single transition. This means that in a\n request body, LifecyclePolicies must be structured as an array of\n LifecyclePolicy objects, one object for each transition. For more\n information, see the request examples in PutLifecycleConfiguration.

      \n
      " + "smithy.api#documentation": "

      Describes a policy used by Lifecycle management that specifies when to transition files\n into and out of storage classes. For more information, see Managing file system\n storage.

      \n \n

      When using the put-lifecycle-configuration CLI command or the\n PutLifecycleConfiguration API action, Amazon EFS requires that each\n LifecyclePolicy object have only a single transition. This means that in a\n request body, LifecyclePolicies must be structured as an array of\n LifecyclePolicy objects, one object for each transition. For more\n information, see the request examples in PutLifecycleConfiguration.

      \n
      " } }, "com.amazonaws.efs#ListTagsForResource": { @@ -2717,6 +2762,9 @@ }, { "target": "com.amazonaws.efs#UpdateFileSystem" + }, + { + "target": "com.amazonaws.efs#UpdateFileSystemProtection" } ], "traits": { @@ -4550,7 +4598,7 @@ } ], "traits": { - "smithy.api#documentation": "

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

      \n
        \n
      • \n

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

        \n
      • \n
      • \n

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

        \n

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

        \n \n

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

        \n
        \n
      • \n
      • \n

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

        \n
      • \n
      \n

      For more information, see \n Managing file system storage.

      \n

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

      \n

      In the request, specify the following:

      \n
        \n
      • \n

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

        \n
      • \n
      • \n

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

        \n \n

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

        \n
        \n
      • \n
      \n

      This operation requires permissions for the elasticfilesystem:PutLifecycleConfiguration operation.

      \n

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

      ", + "smithy.api#documentation": "

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

      \n
        \n
      • \n

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

        \n
      • \n
      • \n

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

        \n

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

        \n \n

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

        \n
        \n
      • \n
      \n
        \n
      • \n

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

        \n
      • \n
      \n

      For more information, see Managing file system\n storage.

      \n

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

      \n
        \n
      • \n

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

        \n
      • \n
      • \n

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

        \n \n

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

        \n
        \n
      • \n
      \n

      This operation requires permissions for the elasticfilesystem:PutLifecycleConfiguration operation.

      \n

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

      ", "smithy.api#examples": [ { "title": "Creates a new lifecycleconfiguration object for a file system", @@ -4612,6 +4660,22 @@ "smithy.api#pattern": "^[a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-{0,1}[0-9]{0,1}$" } }, + "com.amazonaws.efs#ReplicationAlreadyExists": { + "type": "structure", + "members": { + "ErrorCode": { + "target": "com.amazonaws.efs#ErrorCode" + }, + "Message": { + "target": "com.amazonaws.efs#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

      Returned if the file system is already included in a replication configuration.>

      ", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, "com.amazonaws.efs#ReplicationConfigurationDescription": { "type": "structure", "members": { @@ -4687,6 +4751,29 @@ "smithy.api#httpError": 404 } }, + "com.amazonaws.efs#ReplicationOverwriteProtection": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + }, + "REPLICATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REPLICATING" + } + } + } + }, "com.amazonaws.efs#ReplicationStatus": { "type": "enum", "members": { @@ -5414,6 +5501,72 @@ } } }, + "com.amazonaws.efs#UpdateFileSystemProtection": { + "type": "operation", + "input": { + "target": "com.amazonaws.efs#UpdateFileSystemProtectionRequest" + }, + "output": { + "target": "com.amazonaws.efs#FileSystemProtectionDescription" + }, + "errors": [ + { + "target": "com.amazonaws.efs#BadRequest" + }, + { + "target": "com.amazonaws.efs#FileSystemNotFound" + }, + { + "target": "com.amazonaws.efs#IncorrectFileSystemLifeCycleState" + }, + { + "target": "com.amazonaws.efs#InsufficientThroughputCapacity" + }, + { + "target": "com.amazonaws.efs#InternalServerError" + }, + { + "target": "com.amazonaws.efs#ReplicationAlreadyExists" + }, + { + "target": "com.amazonaws.efs#ThroughputLimitExceeded" + }, + { + "target": "com.amazonaws.efs#TooManyRequests" + } + ], + "traits": { + "smithy.api#documentation": "

      Updates protection on the file system.

      \n

      This operation requires permissions for the\n elasticfilesystem:UpdateFileSystemProtection action.

      ", + "smithy.api#http": { + "method": "PUT", + "uri": "/2015-02-01/file-systems/{FileSystemId}/protection", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.efs#UpdateFileSystemProtectionRequest": { + "type": "structure", + "members": { + "FileSystemId": { + "target": "com.amazonaws.efs#FileSystemId", + "traits": { + "smithy.api#documentation": "

      The ID of the file system to update.

      ", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "ReplicationOverwriteProtection": { + "target": "com.amazonaws.efs#ReplicationOverwriteProtection", + "traits": { + "smithy.api#documentation": "

      The status of the file system's replication overwrite protection.

      \n
        \n
      • \n

        \n ENABLED – The file system cannot be used as the destination file\n system in a replication configuration. The file system is writeable. Replication overwrite\n protection is ENABLED by default.

        \n
      • \n
      • \n

        \n DISABLED – The file system can be used as the destination file\n system in a replication configuration. The file system is read-only and can only be\n modified by EFS replication.

        \n
      • \n
      • \n

        \n REPLICATING – The file system is being used as the destination file\n system in a replication configuration. The file system is read-only and is only modified\n only by EFS replication.

        \n
      • \n
      \n

      If the replication configuration is deleted, the file system's replication overwrite\n protection is re-enabled, the file system becomes writeable.

      " + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, "com.amazonaws.efs#UpdateFileSystemRequest": { "type": "structure", "members": {