createBackupVault method

Future<CreateBackupVaultOutput> createBackupVault({
  1. required String backupVaultName,
  2. Map<String, String>? backupVaultTags,
  3. String? creatorRequestId,
  4. String? encryptionKeyArn,
})

Creates a logical container where backups are stored. A CreateBackupVault request includes a name, optionally one or more resource tags, an encryption key, and a request ID.

May throw InvalidParameterValueException. May throw MissingParameterValueException. May throw ServiceUnavailableException. May throw LimitExceededException. May throw AlreadyExistsException.

Parameter backupVaultName : The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Parameter backupVaultTags : Metadata that you can assign to help organize the resources that you create. Each tag is a key-value pair.

Parameter creatorRequestId : A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice.

Parameter encryptionKeyArn : The server-side encryption key that is used to protect your backups; for example, arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

Implementation

Future<CreateBackupVaultOutput> createBackupVault({
  required String backupVaultName,
  Map<String, String>? backupVaultTags,
  String? creatorRequestId,
  String? encryptionKeyArn,
}) async {
  ArgumentError.checkNotNull(backupVaultName, 'backupVaultName');
  final $payload = <String, dynamic>{
    if (backupVaultTags != null) 'BackupVaultTags': backupVaultTags,
    if (creatorRequestId != null) 'CreatorRequestId': creatorRequestId,
    if (encryptionKeyArn != null) 'EncryptionKeyArn': encryptionKeyArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/backup-vaults/${Uri.encodeComponent(backupVaultName)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBackupVaultOutput.fromJson(response);
}