Skip to content

create_carrier_gateway

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

Creates a carrier gateway. For more information about carrier gateways, see Carrier gateways in the Amazon Web Services Wavelength Developer Guide.

Parameters:

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

    The ID of the VPC to associate with the carrier gateway.

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

    The tags to associate with the carrier gateway.

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

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

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

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def create_carrier_gateway(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    vpc_id: Optional["capo_ec2.types.vpc_id.VpcId"] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.create_carrier_gateway_result.CreateCarrierGatewayResult":
    """<p>Creates a carrier gateway. For more information about carrier gateways, see <a href="https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#wavelength-carrier-gateway">Carrier gateways</a> in the <i>Amazon Web Services Wavelength Developer Guide</i>.</p>

    Args:
        vpc_id: <p>The ID of the VPC to associate with the carrier gateway.</p>
        tag_specifications: <p>The tags to associate with the carrier gateway.</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>
        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">How to ensure idempotency</a>.</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_carrier_gateway_request.CreateCarrierGatewayRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.create_carrier_gateway_result.CreateCarrierGatewayResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_carrier_gateway

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCarrierGateway")
    )
    input_: capo_ec2.types.create_carrier_gateway_request.CreateCarrierGatewayRequest = {}
    if vpc_id is not None:
        input_["vpc_id"] = vpc_id
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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