Skip to content

modify_vpc_peering_connection_options

modify_vpc_peering_connection_options(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    accepter_peering_connection_options: Optional[
        PeeringConnectionOptionsRequest
    ] = None,
    dry_run: Optional[Boolean] = None,
    requester_peering_connection_options: Optional[
        PeeringConnectionOptionsRequest
    ] = None,
    vpc_peering_connection_id: Optional[VpcPeeringConnectionId] = None,
) -> ModifyVpcPeeringConnectionOptionsResult

Modifies the VPC peering connection options on one side of a VPC peering connection.

If the peered VPCs are in the same Amazon Web Services account, you can enable DNS resolution for queries from the local VPC. This ensures that queries from the local VPC resolve to private IP addresses in the peer VPC. This option is not available if the peered VPCs are in different Amazon Web Services accounts or different Regions. For peered VPCs in different Amazon Web Services accounts, each Amazon Web Services account owner must initiate a separate request to modify the peering connection options. For inter-region peering connections, you must use the Region for the requester VPC to modify the requester VPC peering options and the Region for the accepter VPC to modify the accepter VPC peering options. To verify which VPCs are the accepter and the requester for a VPC peering connection, use the DescribeVpcPeeringConnections command.

Parameters:

  • accepter_peering_connection_options (Optional[PeeringConnectionOptionsRequest], default: None ) –

    The VPC peering connection options for the accepter VPC.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • requester_peering_connection_options (Optional[PeeringConnectionOptionsRequest], default: None ) –

    The VPC peering connection options for the requester VPC.

  • vpc_peering_connection_id (Optional[VpcPeeringConnectionId], default: None ) –

    The ID of the VPC peering connection.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def modify_vpc_peering_connection_options(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    accepter_peering_connection_options: Optional[
        "capo_ec2.types.peering_connection_options_request.PeeringConnectionOptionsRequest"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    requester_peering_connection_options: Optional[
        "capo_ec2.types.peering_connection_options_request.PeeringConnectionOptionsRequest"
    ] = None,
    vpc_peering_connection_id: Optional[
        "capo_ec2.types.vpc_peering_connection_id.VpcPeeringConnectionId"
    ] = None,
) -> "capo_ec2.types.modify_vpc_peering_connection_options_result.ModifyVpcPeeringConnectionOptionsResult":
    """<p>Modifies the VPC peering connection options on one side of a VPC peering connection.</p> <p>If the peered VPCs are in the same Amazon Web Services account, you can enable DNS resolution for queries from the local VPC. This ensures that queries from the local VPC resolve to private IP addresses in the peer VPC. This option is not available if the peered VPCs are in different Amazon Web Services accounts or different Regions. For peered VPCs in different Amazon Web Services accounts, each Amazon Web Services account owner must initiate a separate request to modify the peering connection options. For inter-region peering connections, you must use the Region for the requester VPC to modify the requester VPC peering options and the Region for the accepter VPC to modify the accepter VPC peering options. To verify which VPCs are the accepter and the requester for a VPC peering connection, use the <a>DescribeVpcPeeringConnections</a> command.</p>

    Args:
        accepter_peering_connection_options: <p>The VPC peering connection options for the accepter VPC.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        requester_peering_connection_options: <p>The VPC peering connection options for the requester VPC.</p>
        vpc_peering_connection_id: <p>The ID of the VPC peering connection.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.modify_vpc_peering_connection_options_request.ModifyVpcPeeringConnectionOptionsRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.modify_vpc_peering_connection_options_result.ModifyVpcPeeringConnectionOptionsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_vpc_peering_connection_options

        output, http_response = (
            capo_ec2._operations.amazon_ec2.modify_vpc_peering_connection_options.modify_vpc_peering_connection_options(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyVpcPeeringConnectionOptions")
    )
    input_: capo_ec2.types.modify_vpc_peering_connection_options_request.ModifyVpcPeeringConnectionOptionsRequest = {}
    if accepter_peering_connection_options is not None:
        input_["accepter_peering_connection_options"] = (
            accepter_peering_connection_options
        )
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if requester_peering_connection_options is not None:
        input_["requester_peering_connection_options"] = (
            requester_peering_connection_options
        )
    if vpc_peering_connection_id is not None:
        input_["vpc_peering_connection_id"] = vpc_peering_connection_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output