Skip to content

create_backup_vault async

create_backup_vault(
    backup_vault_name: BackupVaultName,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    backup_vault_tags: Optional[Tags] = None,
    encryption_key_arn: Optional[ARN] = None,
    creator_request_id: Optional[string] = None,
) -> CreateBackupVaultOutput

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.

Do not include sensitive data, such as passport numbers, in the name of a backup vault.

Parameters:

  • backup_vault_name (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.

  • backup_vault_tags (Optional[Tags], default: None ) –

    The tags to assign to the backup vault.

  • encryption_key_arn (Optional[ARN], default: None ) –

    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.

  • creator_request_id (Optional[string], default: None ) –

    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.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def create_backup_vault(
    self,
    backup_vault_name: "capo_backup.types.backup_vault_name.BackupVaultName",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    backup_vault_tags: Optional["capo_backup.types.tags.Tags"] = None,
    encryption_key_arn: Optional["capo_backup.types.arn.ARN"] = None,
    creator_request_id: Optional["capo_backup.types.string.string"] = None,
) -> "capo_backup.types.create_backup_vault_output.CreateBackupVaultOutput":
    """<p>Creates a logical container where backups are stored. A <code>CreateBackupVault</code> request includes a name, optionally one or more resource tags, an encryption key, and a request ID.</p> <note> <p>Do not include sensitive data, such as passport numbers, in the name of a backup vault.</p> </note>

    Args:
        backup_vault_name: <p>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.</p>
        backup_vault_tags: <p>The tags to assign to the backup vault.</p>
        encryption_key_arn: <p>The server-side encryption key that is used to protect your backups; for example, <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>.</p>
        creator_request_id: <p>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.</p> <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>

    Raises:
        capo_backup.errors.already_exists_exception.AlreadyExistsException: <p>The required resource already exists.</p>
        capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
        capo_backup.errors.limit_exceeded_exception.LimitExceededException: <p>A limit in the request has been exceeded; for example, a maximum number of items allowed in a request.</p>
        capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
        capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup.types.create_backup_vault_input.CreateBackupVaultInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.create_backup_vault_output.CreateBackupVaultOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.create_backup_vault

        (
            output,
            http_response,
        ) = await capo_backup._operations.cryo_controller_user_manager.create_backup_vault.async_create_backup_vault(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_backup.types.create_backup_vault_input.CreateBackupVaultInput",
    ) -> dict[str, Any]:
        import capo_backup.types.create_backup_vault_input

        return capo_backup.types.create_backup_vault_input.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateBackupVault", redact_input=_redact_input),
    )
    input_: capo_backup.types.create_backup_vault_input.CreateBackupVaultInput = {
        "backup_vault_name": backup_vault_name
    }
    if backup_vault_tags is not None:
        input_["backup_vault_tags"] = backup_vault_tags
    if encryption_key_arn is not None:
        input_["encryption_key_arn"] = encryption_key_arn
    if creator_request_id is None:
        creator_request_id = str(uuid.uuid4())
    input_["creator_request_id"] = creator_request_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output