Skip to content

update_vpc_attachment async

update_vpc_attachment(
    attachment_id: AttachmentId,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    add_subnet_arns: Optional[SubnetArnList] = None,
    remove_subnet_arns: Optional[SubnetArnList] = None,
    options: Optional[VpcOptions] = None,
) -> UpdateVpcAttachmentResponse

Updates a VPC attachment.

Parameters:

  • attachment_id (AttachmentId) –

    The ID of the attachment.

  • add_subnet_arns (Optional[SubnetArnList], default: None ) –

    Adds a subnet ARN to the VPC attachment.

  • remove_subnet_arns (Optional[SubnetArnList], default: None ) –

    Removes a subnet ARN from the attachment.

  • options (Optional[VpcOptions], default: None ) –

    Additional options for updating the VPC attachment.

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def update_vpc_attachment(
    self,
    attachment_id: "capo_networkmanager.types.attachment_id.AttachmentId",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    add_subnet_arns: Optional[
        "capo_networkmanager.types.subnet_arn_list.SubnetArnList"
    ] = None,
    remove_subnet_arns: Optional[
        "capo_networkmanager.types.subnet_arn_list.SubnetArnList"
    ] = None,
    options: Optional["capo_networkmanager.types.vpc_options.VpcOptions"] = None,
) -> "capo_networkmanager.types.update_vpc_attachment_response.UpdateVpcAttachmentResponse":
    """<p>Updates a VPC attachment.</p>

    Args:
        attachment_id: <p>The ID of the attachment.</p>
        add_subnet_arns: <p>Adds a subnet ARN to the VPC attachment.</p>
        remove_subnet_arns: <p>Removes a subnet ARN from the attachment.</p>
        options: <p>Additional options for updating the VPC attachment. </p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.conflict_exception.ConflictException: <p>There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmanager.types.update_vpc_attachment_request.UpdateVpcAttachmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.update_vpc_attachment_response.UpdateVpcAttachmentResponse"
    ]:
        import capo_networkmanager._operations.network_manager.update_vpc_attachment

        (
            output,
            http_response,
        ) = await capo_networkmanager._operations.network_manager.update_vpc_attachment.async_update_vpc_attachment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateVpcAttachment")
    )
    input_: capo_networkmanager.types.update_vpc_attachment_request.UpdateVpcAttachmentRequest = {
        "attachment_id": attachment_id
    }
    if add_subnet_arns is not None:
        input_["add_subnet_arns"] = add_subnet_arns
    if remove_subnet_arns is not None:
        input_["remove_subnet_arns"] = remove_subnet_arns
    if options is not None:
        input_["options"] = options

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