Skip to content

create_egress_only_internet_gateway

create_egress_only_internet_gateway(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    client_token: Optional[String] = None,
    dry_run: Optional[Boolean] = None,
    vpc_id: Optional[VpcId] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
) -> CreateEgressOnlyInternetGatewayResult

[IPv6 only] Creates an egress-only internet gateway for your VPC. An egress-only internet gateway is used to enable outbound communication over IPv6 from instances in your VPC to the internet, and prevents hosts outside of your VPC from initiating an IPv6 connection with your instance.

Parameters:

  • client_token (Optional[String], default: None ) –

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

  • 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.

  • vpc_id (Optional[VpcId], default: None ) –

    The ID of the VPC for which to create the egress-only internet gateway.

  • tag_specifications (Optional[TagSpecificationList], default: None ) –

    The tags to assign to the egress-only internet gateway.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def create_egress_only_internet_gateway(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    vpc_id: Optional["capo_ec2.types.vpc_id.VpcId"] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
) -> "capo_ec2.types.create_egress_only_internet_gateway_result.CreateEgressOnlyInternetGatewayResult":
    """<p>[IPv6 only] Creates an egress-only internet gateway for your VPC. An egress-only internet gateway is used to enable outbound communication over IPv6 from instances in your VPC to the internet, and prevents hosts outside of your VPC from initiating an IPv6 connection with your instance.</p>

    Args:
        client_token: <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</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>
        vpc_id: <p>The ID of the VPC for which to create the egress-only internet gateway.</p>
        tag_specifications: <p>The tags to assign to the egress-only internet gateway.</p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.create_egress_only_internet_gateway_request.CreateEgressOnlyInternetGatewayRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.create_egress_only_internet_gateway_result.CreateEgressOnlyInternetGatewayResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_egress_only_internet_gateway

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEgressOnlyInternetGateway")
    )
    input_: capo_ec2.types.create_egress_only_internet_gateway_request.CreateEgressOnlyInternetGatewayRequest = {}
    if client_token is not None:
        input_["client_token"] = client_token
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if vpc_id is not None:
        input_["vpc_id"] = vpc_id
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications

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