Skip to content

update_vpc_origin async

update_vpc_origin(
    vpc_origin_endpoint_config: VpcOriginEndpointConfig,
    id: string,
    if_match: string,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
) -> UpdateVpcOriginResult

Update an Amazon CloudFront VPC origin in your account.

Parameters:

  • vpc_origin_endpoint_config (VpcOriginEndpointConfig) –

    The VPC origin endpoint configuration.

  • id (string) –

    The VPC origin ID.

  • if_match (string) –

    The VPC origin to update, if a match occurs.

Raises:

Examples:

To update a VPC origin The following command updates a VPC origin:

>>> await client.update_vpc_origin(vpc_origin_endpoint_config={'Name': 'my-vpcorigin-name', 'Arn': 'arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-alb-us-west-2/e6aa5c7d26415c6d', 'HTTPPort': 80, 'HTTPSPort': 443, 'OriginProtocolPolicy': 'match-viewer', 'OriginSslProtocols': {'Quantity': 2, 'Items': ['TLSv1.1', 'TLSv1.2']}}, id='vo_BQwjxxQxjCaBcQLzJUFkDM', if_match='ETVPDKIKX0DER')
Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def update_vpc_origin(
    self,
    vpc_origin_endpoint_config: "capo_cloudfront.types.vpc_origin_endpoint_config.VpcOriginEndpointConfig",
    id: "capo_cloudfront.types.string.string",
    if_match: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
) -> "capo_cloudfront.types.update_vpc_origin_result.UpdateVpcOriginResult":
    """<p>Update an Amazon CloudFront VPC origin in your account.</p>

    Args:
        vpc_origin_endpoint_config: <p>The VPC origin endpoint configuration.</p>
        id: <p>The VPC origin ID.</p>
        if_match: <p>The VPC origin to update, if a match occurs.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.cannot_update_entity_while_in_use.CannotUpdateEntityWhileInUse: <p>The entity cannot be updated while it is in use.</p>
        capo_cloudfront.errors.entity_already_exists.EntityAlreadyExists: <p>The entity already exists. You must provide a unique entity.</p>
        capo_cloudfront.errors.entity_limit_exceeded.EntityLimitExceeded: <p>The entity limit has been exceeded.</p>
        capo_cloudfront.errors.entity_not_found.EntityNotFound: <p>The entity was not found.</p>
        capo_cloudfront.errors.illegal_update.IllegalUpdate: <p>The update contains modifications that are not allowed.</p>
        capo_cloudfront.errors.inconsistent_quantities.InconsistentQuantities: <p>The value of <code>Quantity</code> and the size of <code>Items</code> don't match.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.invalid_if_match_version.InvalidIfMatchVersion: <p>The <code>If-Match</code> version is missing or not valid.</p>
        capo_cloudfront.errors.precondition_failed.PreconditionFailed: <p>The precondition in one or more of the request fields evaluated to <code>false</code>.</p>
        capo_cloudfront.errors.unsupported_operation.UnsupportedOperation: <p>This operation is not supported in this Amazon Web Services Region.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update a VPC origin
        The following command updates a VPC origin:

        >>> await client.update_vpc_origin(vpc_origin_endpoint_config={'Name': 'my-vpcorigin-name', 'Arn': 'arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-alb-us-west-2/e6aa5c7d26415c6d', 'HTTPPort': 80, 'HTTPSPort': 443, 'OriginProtocolPolicy': 'match-viewer', 'OriginSslProtocols': {'Quantity': 2, 'Items': ['TLSv1.1', 'TLSv1.2']}}, id='vo_BQwjxxQxjCaBcQLzJUFkDM', if_match='ETVPDKIKX0DER')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.update_vpc_origin_request.UpdateVpcOriginRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.update_vpc_origin_result.UpdateVpcOriginResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.update_vpc_origin

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.update_vpc_origin.async_update_vpc_origin(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateVpcOrigin")
    )
    input_: capo_cloudfront.types.update_vpc_origin_request.UpdateVpcOriginRequest = {
        "vpc_origin_endpoint_config": vpc_origin_endpoint_config,
        "id": id,
        "if_match": if_match,
    }

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