createResourceGateway method
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.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
The name of the resource gateway.
Parameter clientToken :
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.
Parameter ipAddressType :
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.
Parameter ipv4AddressesPerEni :
The number of IPv4 addresses in each ENI for the resource gateway.
Parameter resourceConfigDnsResolution :
Indicates how DNS is resolved for resource configurations associated to
this resource gateway. ResourceConfigDnsResolution is set at creation time
and cannot be changed.
-
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. -
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.
Parameter securityGroupIds :
The IDs of the security groups to apply to the resource gateway. The
security groups must be in the same VPC.
Parameter subnetIds :
The IDs of the VPC subnets in which to create the resource gateway.
Parameter tags :
The tags for the resource gateway.
Parameter vpcIdentifier :
The ID of the VPC for the resource gateway.
Implementation
Future<CreateResourceGatewayResponse> createResourceGateway({
required String name,
String? clientToken,
ResourceGatewayIpAddressType? ipAddressType,
int? ipv4AddressesPerEni,
ResourceConfigDnsResolution? resourceConfigDnsResolution,
List<String>? securityGroupIds,
List<String>? subnetIds,
Map<String, String>? tags,
String? vpcIdentifier,
}) async {
_s.validateNumRange(
'ipv4AddressesPerEni',
ipv4AddressesPerEni,
1,
62,
);
final $payload = <String, dynamic>{
'name': name,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (ipAddressType != null) 'ipAddressType': ipAddressType.value,
if (ipv4AddressesPerEni != null)
'ipv4AddressesPerEni': ipv4AddressesPerEni,
if (resourceConfigDnsResolution != null)
'resourceConfigDnsResolution': resourceConfigDnsResolution.value,
if (securityGroupIds != null) 'securityGroupIds': securityGroupIds,
if (subnetIds != null) 'subnetIds': subnetIds,
if (tags != null) 'tags': tags,
if (vpcIdentifier != null) 'vpcIdentifier': vpcIdentifier,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/resourcegateways',
exceptionFnMap: _exceptionFns,
);
return CreateResourceGatewayResponse.fromJson(response);
}