createDomainName method

Future<DomainName> createDomainName({
  1. required String domainName,
  2. String? certificateArn,
  3. String? certificateBody,
  4. String? certificateChain,
  5. String? certificateName,
  6. String? certificatePrivateKey,
  7. EndpointConfiguration? endpointConfiguration,
  8. MutualTlsAuthenticationInput? mutualTlsAuthentication,
  9. String? regionalCertificateArn,
  10. String? regionalCertificateName,
  11. SecurityPolicy? securityPolicy,
  12. Map<String, String>? tags,
})

Creates a new domain name.

May throw UnauthorizedException. May throw BadRequestException. May throw ConflictException. May throw TooManyRequestsException.

Parameter domainName : Required The name of the DomainName resource.

Parameter certificateArn : The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.

Parameter certificateBody : Deprecated The body of the server certificate that will be used by edge-optimized 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 for this domain name.

Parameter certificatePrivateKey : Deprecated Your edge-optimized endpoint's domain name certificate's private key.

Parameter endpointConfiguration : The endpoint configuration of this DomainName showing the endpoint types of the domain name.

Parameter regionalCertificateArn : The reference to an AWS-managed certificate that will be used by regional endpoint for this domain name. AWS 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 securityPolicy : The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are TLS_1_0 and TLS_1_2.

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,
  EndpointConfiguration? endpointConfiguration,
  MutualTlsAuthenticationInput? mutualTlsAuthentication,
  String? regionalCertificateArn,
  String? regionalCertificateName,
  SecurityPolicy? securityPolicy,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  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 (endpointConfiguration != null)
      'endpointConfiguration': endpointConfiguration,
    if (mutualTlsAuthentication != null)
      'mutualTlsAuthentication': mutualTlsAuthentication,
    if (regionalCertificateArn != null)
      'regionalCertificateArn': regionalCertificateArn,
    if (regionalCertificateName != null)
      'regionalCertificateName': regionalCertificateName,
    if (securityPolicy != null) 'securityPolicy': securityPolicy.toValue(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/domainnames',
    exceptionFnMap: _exceptionFns,
  );
  return DomainName.fromJson(response);
}