createDomainName method
- required String domainName,
- String? certificateArn,
- String? certificateBody,
- String? certificateChain,
- String? certificateName,
- String? certificatePrivateKey,
- EndpointAccessMode? endpointAccessMode,
- EndpointConfiguration? endpointConfiguration,
- MutualTlsAuthenticationInput? mutualTlsAuthentication,
- String? ownershipVerificationCertificateArn,
- String? policy,
- String? regionalCertificateArn,
- String? regionalCertificateName,
- RoutingMode? routingMode,
- SecurityPolicy? securityPolicy,
- Map<
String, String> ? tags,
Creates a new domain name.
May throw BadRequestException.
May throw ConflictException.
May throw LimitExceededException.
May throw TooManyRequestsException.
May throw UnauthorizedException.
Parameter domainName :
The name of the DomainName resource.
Parameter certificateArn :
The reference to an Amazon Web Services-managed certificate that will be
used by edge-optimized endpoint or private endpoint for this domain name.
Certificate Manager is the only supported source.
Parameter certificateBody :
[Deprecated] The body of the server certificate that will be used by
edge-optimized endpoint or private endpoint for this domain name provided
by your certificate authority.
Parameter certificateChain :
[Deprecated] The intermediate certificates and optionally the root
certificate, one after the other without any blank lines, used by an
edge-optimized endpoint for this domain name. If you include the root
certificate, your certificate chain must start with intermediate
certificates and end with the root certificate. Use the intermediate
certificates that were provided by your certificate authority. Do not
include any intermediaries that are not in the chain of trust path.
Parameter certificateName :
The user-friendly name of the certificate that will be used by
edge-optimized endpoint or private endpoint for this domain name.
Parameter certificatePrivateKey :
[Deprecated] Your edge-optimized endpoint's domain name certificate's
private key.
Parameter endpointAccessMode :
The endpoint access mode of the DomainName. Only available for DomainNames
that use security policies that start with SecurityPolicy_.
Parameter endpointConfiguration :
The endpoint configuration of this DomainName showing the endpoint types
and IP address types of the domain name.
Parameter ownershipVerificationCertificateArn :
The ARN of the public certificate issued by ACM to validate ownership of
your custom domain. Only required when configuring mutual TLS and using an
ACM imported or private CA certificate ARN as the regionalCertificateArn.
Parameter policy :
A stringified JSON policy document that applies to the
execute-api service for this DomainName regardless of the
caller and Method configuration. Supported only for private custom domain
names.
Parameter regionalCertificateArn :
The reference to an Amazon Web Services-managed certificate that will be
used by regional endpoint for this domain name. Certificate Manager is the
only supported source.
Parameter regionalCertificateName :
The user-friendly name of the certificate that will be used by regional
endpoint for this domain name.
Parameter routingMode :
The routing mode for this domain name. The routing mode determines how API
Gateway sends traffic from your custom domain name to your private APIs.
Parameter securityPolicy :
The Transport Layer Security (TLS) version + cipher suite for this
DomainName.
Parameter tags :
The key-value map of strings. The valid character set is
[a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not
start with aws:. The tag value can be up to 256 characters.
Implementation
Future<DomainName> createDomainName({
required String domainName,
String? certificateArn,
String? certificateBody,
String? certificateChain,
String? certificateName,
String? certificatePrivateKey,
EndpointAccessMode? endpointAccessMode,
EndpointConfiguration? endpointConfiguration,
MutualTlsAuthenticationInput? mutualTlsAuthentication,
String? ownershipVerificationCertificateArn,
String? policy,
String? regionalCertificateArn,
String? regionalCertificateName,
RoutingMode? routingMode,
SecurityPolicy? securityPolicy,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'domainName': domainName,
if (certificateArn != null) 'certificateArn': certificateArn,
if (certificateBody != null) 'certificateBody': certificateBody,
if (certificateChain != null) 'certificateChain': certificateChain,
if (certificateName != null) 'certificateName': certificateName,
if (certificatePrivateKey != null)
'certificatePrivateKey': certificatePrivateKey,
if (endpointAccessMode != null)
'endpointAccessMode': endpointAccessMode.value,
if (endpointConfiguration != null)
'endpointConfiguration': endpointConfiguration,
if (mutualTlsAuthentication != null)
'mutualTlsAuthentication': mutualTlsAuthentication,
if (ownershipVerificationCertificateArn != null)
'ownershipVerificationCertificateArn':
ownershipVerificationCertificateArn,
if (policy != null) 'policy': policy,
if (regionalCertificateArn != null)
'regionalCertificateArn': regionalCertificateArn,
if (regionalCertificateName != null)
'regionalCertificateName': regionalCertificateName,
if (routingMode != null) 'routingMode': routingMode.value,
if (securityPolicy != null) 'securityPolicy': securityPolicy.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/domainnames',
exceptionFnMap: _exceptionFns,
);
return DomainName.fromJson(response);
}