Skip to content

create_resource_gateway

create_resource_gateway(
    name: ResourceGatewayName,
    *,
    config_overrides: Optional[VPCLatticeClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    vpc_identifier: Optional[VpcId] = None,
    subnet_ids: Optional[SubnetList] = None,
    security_group_ids: Optional[SecurityGroupList] = None,
    ip_address_type: Optional[ResourceGatewayIpAddressType] = None,
    ipv4_addresses_per_eni: Optional[Ipv4AddressesPerEni] = None,
    resource_config_dns_resolution: Optional[ResourceConfigDnsResolution] = None,
    tags: Optional[TagMap] = None,
) -> CreateResourceGatewayResponse

A resource gateway is a point of ingress into the VPC where a resource resides. It spans multiple Availability Zones. For your resource to be accessible from all Availability Zones, you should create your resource gateways to span as many Availability Zones as possible. A VPC can have multiple resource gateways.

Parameters:

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.

  • name (ResourceGatewayName) –

    The name of the resource gateway.

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

    The ID of the VPC for the resource gateway.

  • subnet_ids (Optional[SubnetList], default: None ) –

    The IDs of the VPC subnets in which to create the resource gateway.

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

    The IDs of the security groups to apply to the resource gateway. The security groups must be in the same VPC.

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

    A resource gateway can have IPv4, IPv6 or dualstack addresses. The IP address type of a resource gateway must be compatible with the subnets of the resource gateway and the IP address type of the resource, as described here:

    • IPv4Assign IPv4 addresses to your resource gateway network interfaces. This option is supported only if all selected subnets have IPv4 address ranges, and the resource also has an IPv4 address.

    • IPv6Assign IPv6 addresses to your resource gateway network interfaces. This option is supported only if all selected subnets are IPv6 only subnets, and the resource also has an IPv6 address.

    • DualstackAssign both IPv4 and IPv6 addresses to your resource gateway network interfaces. This option is supported only if all selected subnets have both IPv4 and IPv6 address ranges, and the resource either has an IPv4 or IPv6 address.

    The IP address type of the resource gateway is independent of the IP address type of the client or the VPC endpoint through which the resource is accessed.

  • ipv4_addresses_per_eni (Optional[Ipv4AddressesPerEni], default: None ) –

    The number of IPv4 addresses in each ENI for the resource gateway.

  • resource_config_dns_resolution (Optional[ResourceConfigDnsResolution], default: None ) –

    Indicates how DNS is resolved for resource configurations associated with this resource gateway. This value is set when you create the resource gateway and can't be changed afterward. The default is PUBLIC.

    • IN_VPC - DNS resolution occurs privately within the resource gateway's VPC. DNS queries for resources behind this resource gateway resolve using the DNS resolvers defined in the VPC's DHCP option sets. Use this when your resource domain names are hosted in private Route 53 hosted zones or on-premises DNS servers reachable from the VPC. A CIDR resource configuration requires a resource gateway that uses IN_VPC, and an IN_VPC resource gateway can't be used for ARN resource configurations, so a single resource gateway can't serve both ARN and CIDR resource configurations.

    • PUBLIC - DNS resolution occurs against public DNS resolvers. DNS queries for resources behind this resource gateway resolve using standard public DNS. Use this when your resource domain names are publicly resolvable.

  • tags (Optional[TagMap], default: None ) –

    The tags for the resource gateway.

Raises:

Source code in docs_src/capo_vpc_lattice/_services/vpc_lattice.py
def create_resource_gateway(
    self,
    name: "capo_vpc_lattice.types.resource_gateway_name.ResourceGatewayName",
    *,
    config_overrides: Optional[VPCLatticeClientConfig] = None,
    client_token: Optional[
        "capo_vpc_lattice.types.client_token.ClientToken"
    ] = None,
    vpc_identifier: Optional["capo_vpc_lattice.types.vpc_id.VpcId"] = None,
    subnet_ids: Optional["capo_vpc_lattice.types.subnet_list.SubnetList"] = None,
    security_group_ids: Optional[
        "capo_vpc_lattice.types.security_group_list.SecurityGroupList"
    ] = None,
    ip_address_type: Optional[
        "capo_vpc_lattice.types.resource_gateway_ip_address_type.ResourceGatewayIpAddressType"
    ] = None,
    ipv4_addresses_per_eni: Optional[
        "capo_vpc_lattice.types.ipv4_addresses_per_eni.Ipv4AddressesPerEni"
    ] = None,
    resource_config_dns_resolution: Optional[
        "capo_vpc_lattice.types.resource_config_dns_resolution.ResourceConfigDnsResolution"
    ] = None,
    tags: Optional["capo_vpc_lattice.types.tag_map.TagMap"] = None,
) -> "capo_vpc_lattice.types.create_resource_gateway_response.CreateResourceGatewayResponse":
    """<p>A resource gateway is a point of ingress into the VPC where a resource resides. It spans multiple Availability Zones. For your resource to be accessible from all Availability Zones, you should create your resource gateways to span as many Availability Zones as possible. A VPC can have multiple resource gateways.</p>

    Args:
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.</p>
        name: <p>The name of the resource gateway.</p>
        vpc_identifier: <p>The ID of the VPC for the resource gateway.</p>
        subnet_ids: <p>The IDs of the VPC subnets in which to create the resource gateway.</p>
        security_group_ids: <p>The IDs of the security groups to apply to the resource gateway. The security groups must be in the same VPC.</p>
        ip_address_type: <p>A resource gateway can have IPv4, IPv6 or dualstack addresses. The IP address type of a resource gateway must be compatible with the subnets of the resource gateway and the IP address type of the resource, as described here: </p> <ul> <li> <p> <b>IPv4</b>Assign IPv4 addresses to your resource gateway network interfaces. This option is supported only if all selected subnets have IPv4 address ranges, and the resource also has an IPv4 address.</p> </li> <li> <p> <b>IPv6</b>Assign IPv6 addresses to your resource gateway network interfaces. This option is supported only if all selected subnets are IPv6 only subnets, and the resource also has an IPv6 address.</p> </li> <li> <p> <b>Dualstack</b>Assign both IPv4 and IPv6 addresses to your resource gateway network interfaces. This option is supported only if all selected subnets have both IPv4 and IPv6 address ranges, and the resource either has an IPv4 or IPv6 address.</p> </li> </ul> <p>The IP address type of the resource gateway is independent of the IP address type of the client or the VPC endpoint through which the resource is accessed.</p>
        ipv4_addresses_per_eni: <p>The number of IPv4 addresses in each ENI for the resource gateway.</p>
        resource_config_dns_resolution: <p>Indicates how DNS is resolved for resource configurations associated with this resource gateway. This value is set when you create the resource gateway and can't be changed afterward. The default is <code>PUBLIC</code>.</p> <ul> <li> <p> <code>IN_VPC</code> - DNS resolution occurs privately within the resource gateway's VPC. DNS queries for resources behind this resource gateway resolve using the DNS resolvers defined in the VPC's DHCP option sets. Use this when your resource domain names are hosted in private Route 53 hosted zones or on-premises DNS servers reachable from the VPC. A CIDR resource configuration requires a resource gateway that uses <code>IN_VPC</code>, and an <code>IN_VPC</code> resource gateway can't be used for ARN resource configurations, so a single resource gateway can't serve both ARN and CIDR resource configurations.</p> </li> <li> <p> <code>PUBLIC</code> - DNS resolution occurs against public DNS resolvers. DNS queries for resources behind this resource gateway resolve using standard public DNS. Use this when your resource domain names are publicly resolvable.</p> </li> </ul>
        tags: <p>The tags for the resource gateway.</p>

    Raises:
        capo_vpc_lattice.errors.access_denied_exception.AccessDeniedException: <p>The user does not have sufficient access to perform this action.</p>
        capo_vpc_lattice.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Updating or deleting a resource can cause an inconsistent state.</p>
        capo_vpc_lattice.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing the request.</p>
        capo_vpc_lattice.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist.</p>
        capo_vpc_lattice.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota to be exceeded.</p>
        capo_vpc_lattice.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_vpc_lattice.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_vpc_lattice.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_vpc_lattice.types.create_resource_gateway_request.CreateResourceGatewayRequest]",
    ) -> OperationResponse[
        "capo_vpc_lattice.types.create_resource_gateway_response.CreateResourceGatewayResponse"
    ]:
        import capo_vpc_lattice._operations.mercury_control_plane.create_resource_gateway

        output, http_response = (
            capo_vpc_lattice._operations.mercury_control_plane.create_resource_gateway.create_resource_gateway(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateResourceGateway")
    )
    input_: capo_vpc_lattice.types.create_resource_gateway_request.CreateResourceGatewayRequest = {
        "name": name
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if vpc_identifier is not None:
        input_["vpc_identifier"] = vpc_identifier
    if subnet_ids is not None:
        input_["subnet_ids"] = subnet_ids
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if ip_address_type is not None:
        input_["ip_address_type"] = ip_address_type
    if ipv4_addresses_per_eni is not None:
        input_["ipv4_addresses_per_eni"] = ipv4_addresses_per_eni
    if resource_config_dns_resolution is not None:
        input_["resource_config_dns_resolution"] = resource_config_dns_resolution
    if tags is not None:
        input_["tags"] = tags

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