Skip to content

modify_instance_connect_endpoint async

modify_instance_connect_endpoint(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    instance_connect_endpoint_id: Optional[InstanceConnectEndpointId] = None,
    ip_address_type: Optional[IpAddressType] = None,
    security_group_ids: Optional[SecurityGroupIdStringListRequest] = None,
    preserve_client_ip: Optional[Boolean] = None,
) -> ModifyInstanceConnectEndpointResult

Modifies the specified EC2 Instance Connect Endpoint.

For more information, see Modify an EC2 Instance Connect Endpoint in the Amazon EC2 User Guide.

Parameters:

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

    Checks whether you have the required permissions for the operation, 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.

  • instance_connect_endpoint_id (Optional[InstanceConnectEndpointId], default: None ) –

    The ID of the EC2 Instance Connect Endpoint to modify.

  • ip_address_type (Optional[IpAddressType], default: None ) –

    The new IP address type for the EC2 Instance Connect Endpoint.

    PreserveClientIp is only supported on IPv4 EC2 Instance Connect Endpoints. To use PreserveClientIp, the value for IpAddressType must be ipv4.

  • security_group_ids (Optional[SecurityGroupIdStringListRequest], default: None ) –

    Changes the security groups for the EC2 Instance Connect Endpoint. The new set of groups you specify replaces the current set. You must specify at least one group, even if it's just the default security group in the VPC. You must specify the ID of the security group, not the name.

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

    Indicates whether the client IP address is preserved as the source when you connect to a resource. The following are the possible values.

    • true - Use the IP address of the client. Your instance must have an IPv4 address.

    • false - Use the IP address of the network interface.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_instance_connect_endpoint(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_connect_endpoint_id: Optional[
        "capo_ec2.types.instance_connect_endpoint_id.InstanceConnectEndpointId"
    ] = None,
    ip_address_type: Optional[
        "capo_ec2.types.ip_address_type.IpAddressType"
    ] = None,
    security_group_ids: Optional[
        "capo_ec2.types.security_group_id_string_list_request.SecurityGroupIdStringListRequest"
    ] = None,
    preserve_client_ip: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.modify_instance_connect_endpoint_result.ModifyInstanceConnectEndpointResult":
    """<p>Modifies the specified EC2 Instance Connect Endpoint.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/modify-ec2-instance-connect-endpoint.html">Modify an EC2 Instance Connect Endpoint</a> in the <i>Amazon EC2 User Guide</i>.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the operation, 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>
        instance_connect_endpoint_id: <p>The ID of the EC2 Instance Connect Endpoint to modify.</p>
        ip_address_type: <p>The new IP address type for the EC2 Instance Connect Endpoint.</p> <note> <p> <code>PreserveClientIp</code> is only supported on IPv4 EC2 Instance Connect Endpoints. To use <code>PreserveClientIp</code>, the value for <code>IpAddressType</code> must be <code>ipv4</code>.</p> </note>
        security_group_ids: <p>Changes the security groups for the EC2 Instance Connect Endpoint. The new set of groups you specify replaces the current set. You must specify at least one group, even if it's just the default security group in the VPC. You must specify the ID of the security group, not the name.</p>
        preserve_client_ip: <p>Indicates whether the client IP address is preserved as the source when you connect to a resource. The following are the possible values.</p> <ul> <li> <p> <code>true</code> - Use the IP address of the client. Your instance must have an IPv4 address.</p> </li> <li> <p> <code>false</code> - Use the IP address of the network interface.</p> </li> </ul>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.modify_instance_connect_endpoint_request.ModifyInstanceConnectEndpointRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_instance_connect_endpoint_result.ModifyInstanceConnectEndpointResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_instance_connect_endpoint

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.modify_instance_connect_endpoint.async_modify_instance_connect_endpoint(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyInstanceConnectEndpoint")
    )
    input_: capo_ec2.types.modify_instance_connect_endpoint_request.ModifyInstanceConnectEndpointRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if instance_connect_endpoint_id is not None:
        input_["instance_connect_endpoint_id"] = instance_connect_endpoint_id
    if ip_address_type is not None:
        input_["ip_address_type"] = ip_address_type
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if preserve_client_ip is not None:
        input_["preserve_client_ip"] = preserve_client_ip

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