Skip to content

put_backup_vault_access_policy async

put_backup_vault_access_policy(
    backup_vault_name: BackupVaultName,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    policy: Optional[IAMPolicy] = None,
) -> None

Sets a resource-based policy that is used to manage access permissions on the target backup vault. Requires a backup vault name and an access policy document in JSON format.

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.

  • policy (Optional[IAMPolicy], default: None ) –

    The backup vault access policy document in JSON format.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def put_backup_vault_access_policy(
    self,
    backup_vault_name: "capo_backup.types.backup_vault_name.BackupVaultName",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    policy: Optional["capo_backup.types.iam_policy.IAMPolicy"] = None,
) -> None:
    """<p>Sets a resource-based policy that is used to manage access permissions on the target backup vault. Requires a backup vault name and an access policy document in JSON format.</p>

    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.</p>
        policy: <p>The backup vault access policy document in JSON format.</p>

    Raises:
        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.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource that is required for the action doesn't exist.</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.put_backup_vault_access_policy_input.PutBackupVaultAccessPolicyInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_backup._operations.cryo_controller_user_manager.put_backup_vault_access_policy

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutBackupVaultAccessPolicy")
    )
    input_: capo_backup.types.put_backup_vault_access_policy_input.PutBackupVaultAccessPolicyInput = {
        "backup_vault_name": backup_vault_name
    }
    if policy is not None:
        input_["policy"] = policy

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