createDomainConfiguration method

Future<CreateDomainConfigurationResponse> createDomainConfiguration({
  1. required String domainConfigurationName,
  2. AuthorizerConfig? authorizerConfig,
  3. String? domainName,
  4. List<String>? serverCertificateArns,
  5. ServiceType? serviceType,
  6. List<Tag>? tags,
  7. String? validationCertificateArn,
})

Creates a domain configuration.

May throw LimitExceededException. May throw CertificateValidationException. May throw ResourceAlreadyExistsException. May throw ServiceUnavailableException. May throw InternalFailureException. May throw InvalidRequestException. May throw UnauthorizedException. May throw ThrottlingException.

Parameter domainConfigurationName : The name of the domain configuration. This value must be unique to a region.

Parameter authorizerConfig : An object that specifies the authorization service for a domain.

Parameter domainName : The name of the domain.

Parameter serverCertificateArns : The ARNs of the certificates that AWS IoT passes to the device during the TLS handshake. Currently you can specify only one certificate ARN. This value is not required for AWS-managed domains.

Parameter serviceType : The type of service delivered by the endpoint.

Parameter tags : Metadata which can be used to manage the domain configuration.

For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."

For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."

Parameter validationCertificateArn : The certificate used to validate the server certificate and prove domain name ownership. This certificate must be signed by a public certificate authority. This value is not required for AWS-managed domains.

Implementation

Future<CreateDomainConfigurationResponse> createDomainConfiguration({
  required String domainConfigurationName,
  AuthorizerConfig? authorizerConfig,
  String? domainName,
  List<String>? serverCertificateArns,
  ServiceType? serviceType,
  List<Tag>? tags,
  String? validationCertificateArn,
}) async {
  ArgumentError.checkNotNull(
      domainConfigurationName, 'domainConfigurationName');
  _s.validateStringLength(
    'domainConfigurationName',
    domainConfigurationName,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'domainName',
    domainName,
    1,
    253,
  );
  _s.validateStringLength(
    'validationCertificateArn',
    validationCertificateArn,
    1,
    2048,
  );
  final $payload = <String, dynamic>{
    if (authorizerConfig != null) 'authorizerConfig': authorizerConfig,
    if (domainName != null) 'domainName': domainName,
    if (serverCertificateArns != null)
      'serverCertificateArns': serverCertificateArns,
    if (serviceType != null) 'serviceType': serviceType.toValue(),
    if (tags != null) 'tags': tags,
    if (validationCertificateArn != null)
      'validationCertificateArn': validationCertificateArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/domainConfigurations/${Uri.encodeComponent(domainConfigurationName)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDomainConfigurationResponse.fromJson(response);
}