Skip to content

Commit

Permalink
feat(client-efs): Adding support for EFS Replication to existing file…
Browse files Browse the repository at this point in the history
… system.
  • Loading branch information
awstools committed Nov 27, 2023
1 parent 8de01a6 commit 15498ce
Show file tree
Hide file tree
Showing 15 changed files with 787 additions and 54 deletions.
8 changes: 8 additions & 0 deletions clients/client-efs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

</details>
<details>
<summary>
UpdateFileSystemProtection
</summary>

[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/)

</details>
23 changes: 23 additions & 0 deletions clients/client-efs/src/EFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ import {
UpdateFileSystemCommandInput,
UpdateFileSystemCommandOutput,
} from "./commands/UpdateFileSystemCommand";
import {
UpdateFileSystemProtectionCommand,
UpdateFileSystemProtectionCommandInput,
UpdateFileSystemProtectionCommandOutput,
} from "./commands/UpdateFileSystemProtectionCommand";
import { EFSClient, EFSClientConfig } from "./EFSClient";

const commands = {
Expand Down Expand Up @@ -173,6 +178,7 @@ const commands = {
TagResourceCommand,
UntagResourceCommand,
UpdateFileSystemCommand,
UpdateFileSystemProtectionCommand,
};

export interface EFS {
Expand Down Expand Up @@ -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<UpdateFileSystemProtectionCommandOutput>;
updateFileSystemProtection(
args: UpdateFileSystemProtectionCommandInput,
cb: (err: any, data?: UpdateFileSystemProtectionCommandOutput) => void
): void;
updateFileSystemProtection(
args: UpdateFileSystemProtectionCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateFileSystemProtectionCommandOutput) => void
): void;
}

/**
Expand Down
10 changes: 8 additions & 2 deletions clients/client-efs/src/EFSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -175,7 +179,8 @@ export type ServiceInputTypes =
| PutLifecycleConfigurationCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateFileSystemCommandInput;
| UpdateFileSystemCommandInput
| UpdateFileSystemProtectionCommandInput;

/**
* @public
Expand Down Expand Up @@ -210,7 +215,8 @@ export type ServiceOutputTypes =
| PutLifecycleConfigurationCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateFileSystemCommandOutput;
| UpdateFileSystemCommandOutput
| UpdateFileSystemProtectionCommandOutput;

/**
* @public
Expand Down
3 changes: 3 additions & 0 deletions clients/client-efs/src/commands/CreateFileSystemCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ export interface CreateFileSystemCommandOutput extends FileSystemDescription, __
* // Value: "STRING_VALUE", // required
* // },
* // ],
* // FileSystemProtection: { // FileSystemProtectionDescription
* // ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING",
* // },
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,69 +49,78 @@ export interface CreateReplicationConfigurationCommandOutput
* <ul>
* <li>
* <p>
* <b>Source file system</b> - An existing EFS file system that you
* want replicated. The source file system cannot be a destination file system in an existing
* replication configuration.</p>
* <b>Source file system</b> – The EFS file system that
* you want replicated. The source file system cannot be a destination file system in an
* existing replication configuration.</p>
* </li>
* <li>
* <p>
* <b>Destination file system configuration</b> - The configuration of
* the destination file system to which the source file system will be replicated. There can
* only be one destination file system in a replication configuration. The destination file
* system configuration consists of the following properties:</p>
* <b>Amazon Web Services Region</b> – 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 available. The
* Region must be enabled. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable">Managing Amazon Web Services Regions</a> in the <i>Amazon Web Services General Reference
* Reference Guide</i>.</p>
* </li>
* <li>
* <p>
* <b>Destination file system configuration</b> – The
* configuration of the destination file system to which the source file system will be
* replicated. There can only be one destination file system in a replication configuration. </p>
* <p>Parameters for the replication configuration include:</p>
* <ul>
* <li>
* <p>
* <b>Amazon Web Services Region</b> - 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
* available. To use EFS replication in a Region that is disabled by default, you must
* first opt in to the Region. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable">Managing Amazon Web Services Regions</a> in the <i>Amazon Web Services General Reference
* Reference Guide</i>
* </p>
* <b>File system ID</b> The ID of the destination
* file system for the replication. If no ID is provided, then EFS creates a new file
* system with the default settings. For existing file systems, the file system's
* replication overwrite protection must be disabled. For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/efs-replication#replicate-existing-destination"> Replicating to
* an existing file system</a>.</p>
* </li>
* <li>
* <p>
* <b>Availability Zone</b> - If you want the destination file system
* to use EFS One Zone availability, you must specify the Availability Zone to create the
* file system in. For more information about EFS storage classes, see <a href="https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html">
* Amazon EFS storage classes</a> in the <i>Amazon EFS User
* <b>Availability Zone</b> If you want the destination file
* system to use One Zone storage, you must specify the Availability Zone to create the
* file system in. For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html">
* EFS file system types</a> in the <i>Amazon EFS User
* Guide</i>.</p>
* </li>
* <li>
* <p>
* <b>Encryption</b> - All destination file systems are created 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
* <b>Encryption</b> All destination file systems are created
* 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
* specify a KMS key, your service-managed KMS key for
* Amazon EFS is used. </p>
* Amazon EFS is used. </p>
* <note>
* <p>After the file system is created, you cannot change the KMS key.</p>
* </note>
* </li>
* </ul>
* </li>
* </ul>
* <p>The following properties are set by default:</p>
* <note>
* <p>After the file system is created, you cannot change the KMS key.</p>
* </note>
* <p>For new destination file systems, the following properties are set by default:</p>
* <ul>
* <li>
* <p>
* <b>Performance mode</b> - 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.</p>
* <b>Performance mode</b> - 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.</p>
* </li>
* <li>
* <p>
* <b>Throughput mode</b> - 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.</p>
* <b>Throughput mode</b> - 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.</p>
* </li>
* </ul>
* <p>The following properties are turned off by default:</p>
* <ul>
* <li>
* <p>
* <b>Lifecycle management</b> – Lifecycle management is not enabled
* on the destination file system. After the destination file system is created, you can
* enable it.</p>
* enable lifecycle management.</p>
* </li>
* <li>
* <p>
Expand All @@ -135,6 +144,7 @@ export interface CreateReplicationConfigurationCommandOutput
* Region: "STRING_VALUE",
* AvailabilityZoneName: "STRING_VALUE",
* KmsKeyId: "STRING_VALUE",
* FileSystemId: "STRING_VALUE",
* },
* ],
* };
Expand Down Expand Up @@ -168,6 +178,9 @@ export interface CreateReplicationConfigurationCommandOutput
* <p>Returned if the request is malformed or contains an error such as an invalid
* parameter value or a missing required parameter.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>Returned if the source file system in a replication is encrypted but the destination file system is unencrypted.</p>
*
* @throws {@link FileSystemLimitExceeded} (client fault)
* <p>Returned if the Amazon Web Services account has already created the maximum number of file systems
* allowed per account.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ export interface DeleteReplicationConfigurationCommandOutput extends __MetadataB

/**
* @public
* <p>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
* <code>Writeable</code>.</p>
* <p>Deletes a replication configuration. Deleting a replication configuration ends the
* replication process. After a replication configuration is deleted, the destination file system
* becomes <code>Writeable</code> and its replication overwrite protection is re-enabled. For
* more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/delete-replications.html">Delete a replication configuration</a>.</p>
* <p>This operation requires permissions for the
* <code>elasticfilesystem:DeleteReplicationConfiguration</code> action. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
3 changes: 3 additions & 0 deletions clients/client-efs/src/commands/DescribeFileSystemsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ export interface DescribeFileSystemsCommandOutput extends DescribeFileSystemsRes
* // Value: "STRING_VALUE", // required
* // },
* // ],
* // FileSystemProtection: { // FileSystemProtectionDescription
* // ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING",
* // },
* // },
* // ],
* // NextMarker: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export interface DescribeLifecycleConfigurationCommandOutput
/**
* @public
* <p>Returns the current <code>LifecycleConfiguration</code> object for the specified Amazon
* EFS file system. Llifecycle management uses the <code>LifecycleConfiguration</code> object to
* identify when to move files between storage classes. For a file system without a
* EFS file system. Lifecycle management uses the <code>LifecycleConfiguration</code> object
* to identify when to move files between storage classes. For a file system without a
* <code>LifecycleConfiguration</code> object, the call returns an empty array in the
* response.</p>
* <p>This operation requires permissions for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface PutLifecycleConfigurationCommandOutput extends LifecycleConfigu

/**
* @public
* <p>Use this action to manage storage of your file system. A
* <p>Use this action to manage storage for your file system. A
* <code>LifecycleConfiguration</code> consists of one or more <code>LifecyclePolicy</code>
* objects that define the following:</p>
* <ul>
Expand All @@ -63,24 +63,25 @@ export interface PutLifecycleConfigurationCommandOutput extends LifecycleConfigu
* and the General Purpose Performance mode. </p>
* </note>
* </li>
* </ul>
* <ul>
* <li>
* <p>
* <b>
* <code>TransitionToPrimaryStorageClass</code>
* </b> –
* 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.</p>
* </li>
* </ul>
* <p>For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html">
* Managing file system storage</a>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html"> Managing file system
* storage</a>.</p>
* <p>Each Amazon EFS file system supports one lifecycle configuration, which applies to
* all files in the file system. If a <code>LifecycleConfiguration</code> object already exists
* for the specified file system, a <code>PutLifecycleConfiguration</code> call modifies the
* existing configuration. A <code>PutLifecycleConfiguration</code> call with an empty
* <code>LifecyclePolicies</code> array in the request body deletes any existing
* <code>LifecycleConfiguration</code> for the file system.</p>
* <p>In the request, specify the following: </p>
* <code>LifecycleConfiguration</code>. In the request, specify the following: </p>
* <ul>
* <li>
* <p>The ID for the file system for which you are enabling, disabling, or modifying
Expand Down
3 changes: 3 additions & 0 deletions clients/client-efs/src/commands/UpdateFileSystemCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export interface UpdateFileSystemCommandOutput extends FileSystemDescription, __
* // Value: "STRING_VALUE", // required
* // },
* // ],
* // FileSystemProtection: { // FileSystemProtectionDescription
* // ReplicationOverwriteProtection: "ENABLED" || "DISABLED" || "REPLICATING",
* // },
* // };
*
* ```
Expand Down
Loading

0 comments on commit 15498ce

Please sign in to comment.