createFileSystemFromBackup method

Future<CreateFileSystemFromBackupResponse> createFileSystemFromBackup({
  1. required String backupId,
  2. required List<String> subnetIds,
  3. String? clientRequestToken,
  4. String? fileSystemTypeVersion,
  5. String? kmsKeyId,
  6. CreateFileSystemLustreConfiguration? lustreConfiguration,
  7. NetworkType? networkType,
  8. CreateFileSystemOpenZFSConfiguration? openZFSConfiguration,
  9. List<String>? securityGroupIds,
  10. int? storageCapacity,
  11. StorageType? storageType,
  12. List<Tag>? tags,
  13. CreateFileSystemWindowsConfiguration? windowsConfiguration,
})

Creates a new Amazon FSx for Lustre, Amazon FSx for Windows File Server, or Amazon FSx for OpenZFS file system from an existing Amazon FSx backup.

If a file system with the specified client request token exists and the parameters match, this operation returns the description of the file system. If a file system with the specified client request token exists but the parameters don't match, this call returns IncompatibleParameterError. If a file system with the specified client request token doesn't exist, this operation does the following:

  • Creates a new Amazon FSx file system from backup with an assigned ID, and an initial lifecycle state of CREATING.
  • Returns the description of the file system.
Parameters like the Active Directory, default share name, automatic backup, and backup settings default to the parameters of the file system that was backed up, unless overridden. You can explicitly supply other settings.

By using the idempotent operation, you can retry a CreateFileSystemFromBackup call without the risk of creating an extra file system. This approach can be useful when an initial call fails in a way that makes it unclear whether a file system was created. Examples are if a transport level timeout occurred, or your connection was reset. If you use the same client request token and the initial call created a file system, the client receives a success message as long as the parameters are the same.

May throw ActiveDirectoryError. May throw BackupNotFound. May throw BadRequest. May throw IncompatibleParameterError. May throw InternalServerError. May throw InvalidNetworkSettings. May throw InvalidPerUnitStorageThroughput. May throw MissingFileSystemConfiguration. May throw ServiceLimitExceeded.

Parameter subnetIds : Specifies the IDs of the subnets that the file system will be accessible from. For Windows MULTI_AZ_1 file system deployment types, provide exactly two subnet IDs, one for the preferred file server and one for the standby file server. You specify one of these subnets as the preferred subnet using the WindowsConfiguration > PreferredSubnetID property.

Windows SINGLE_AZ_1 and SINGLE_AZ_2 file system deployment types, Lustre file systems, and OpenZFS file systems provide exactly one subnet ID. The file server is launched in that subnet's Availability Zone.

Parameter clientRequestToken : A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.

Parameter fileSystemTypeVersion : Sets the version for the Amazon FSx for Lustre file system that you're creating from a backup. Valid values are 2.10, 2.12, and 2.15.

You can enter a Lustre version that is newer than the backup's FileSystemTypeVersion setting. If you don't enter a newer Lustre version, it defaults to the backup's setting.

Parameter networkType : Sets the network type for the Amazon FSx for OpenZFS file system that you're creating from a backup.

Parameter openZFSConfiguration : The OpenZFS configuration for the file system that's being created.

Parameter securityGroupIds : A list of IDs for the security groups that apply to the specified network interfaces created for file system access. These security groups apply to all network interfaces. This value isn't returned in later DescribeFileSystem requests.

Parameter storageCapacity : Sets the storage capacity of the OpenZFS file system that you're creating from a backup, in gibibytes (GiB). Valid values are from 64 GiB up to 524,288 GiB (512 TiB). However, the value that you specify must be equal to or greater than the backup's storage capacity value. If you don't use the StorageCapacity parameter, the default is the backup's StorageCapacity value.

If used to create a file system other than OpenZFS, you must provide a value that matches the backup's StorageCapacity value. If you provide any other value, Amazon FSx responds with an HTTP status code 400 Bad Request.

Parameter storageType : Sets the storage type for the Windows, OpenZFS, or Lustre file system that you're creating from a backup. Valid values are SSD, HDD, and INTELLIGENT_TIERING.

  • Set to SSD to use solid state drive storage. SSD is supported on all Windows and OpenZFS deployment types.
  • Set to HDD to use hard disk drive storage. HDD is supported on SINGLE_AZ_2 and MULTI_AZ_1 FSx for Windows File Server file system deployment types.
  • Set to INTELLIGENT_TIERING to use fully elastic, intelligently-tiered storage. Intelligent-Tiering is only available for OpenZFS file systems with the Multi-AZ deployment type and for Lustre file systems with the Persistent_2 deployment type.
The default value is SSD.

Parameter tags : The tags to be applied to the file system at file system creation. The key value of the Name tag appears in the console as the file system name.

Parameter windowsConfiguration : The configuration for this Microsoft Windows file system.

Implementation

Future<CreateFileSystemFromBackupResponse> createFileSystemFromBackup({
  required String backupId,
  required List<String> subnetIds,
  String? clientRequestToken,
  String? fileSystemTypeVersion,
  String? kmsKeyId,
  CreateFileSystemLustreConfiguration? lustreConfiguration,
  NetworkType? networkType,
  CreateFileSystemOpenZFSConfiguration? openZFSConfiguration,
  List<String>? securityGroupIds,
  int? storageCapacity,
  StorageType? storageType,
  List<Tag>? tags,
  CreateFileSystemWindowsConfiguration? windowsConfiguration,
}) async {
  _s.validateNumRange(
    'storageCapacity',
    storageCapacity,
    0,
    2147483647,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSSimbaAPIService_v20180301.CreateFileSystemFromBackup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BackupId': backupId,
      'SubnetIds': subnetIds,
      'ClientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (fileSystemTypeVersion != null)
        'FileSystemTypeVersion': fileSystemTypeVersion,
      if (kmsKeyId != null) 'KmsKeyId': kmsKeyId,
      if (lustreConfiguration != null)
        'LustreConfiguration': lustreConfiguration,
      if (networkType != null) 'NetworkType': networkType.value,
      if (openZFSConfiguration != null)
        'OpenZFSConfiguration': openZFSConfiguration,
      if (securityGroupIds != null) 'SecurityGroupIds': securityGroupIds,
      if (storageCapacity != null) 'StorageCapacity': storageCapacity,
      if (storageType != null) 'StorageType': storageType.value,
      if (tags != null) 'Tags': tags,
      if (windowsConfiguration != null)
        'WindowsConfiguration': windowsConfiguration,
    },
  );

  return CreateFileSystemFromBackupResponse.fromJson(jsonResponse.body);
}