createBackupVault method
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 AlreadyExistsException.
May throw InvalidParameterValueException.
May throw LimitExceededException.
May throw MissingParameterValueException.
May throw ServiceUnavailableException.
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 Amazon Web Services Region where they are created. They consist of
letters, numbers, and hyphens.
Parameter backupVaultTags :
The tags to assign to the backup vault.
Parameter creatorRequestId :
A unique string that identifies the request and allows failed requests to
be retried without the risk of running the operation twice. This parameter
is optional.
If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.
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 {
final $payload = <String, dynamic>{
if (backupVaultTags != null) 'BackupVaultTags': backupVaultTags,
'CreatorRequestId': creatorRequestId ?? _s.generateIdempotencyToken(),
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);
}