createDomainConfiguration method
- required String domainConfigurationName,
- ApplicationProtocol? applicationProtocol,
- AuthenticationType? authenticationType,
- AuthorizerConfig? authorizerConfig,
- ClientCertificateConfig? clientCertificateConfig,
- String? domainName,
- List<
String> ? serverCertificateArns, - ServerCertificateConfig? serverCertificateConfig,
- ServiceType? serviceType,
- List<
Tag> ? tags, - TlsConfig? tlsConfig,
- String? validationCertificateArn,
Creates a domain configuration.
Requires permission to access the CreateDomainConfiguration action.
May throw CertificateValidationException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceAlreadyExistsException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedException.
Parameter domainConfigurationName :
The name of the domain configuration. This value must be unique to a
region.
Parameter applicationProtocol :
An enumerated string that specifies the application-layer protocol.
-
SECURE_MQTT- MQTT over TLS.
-
MQTT_WSS- MQTT over WebSocket.
-
HTTPS- HTTP over TLS.
-
DEFAULT- Use a combination of port and Application Layer Protocol Negotiation (ALPN) to specify application_layer protocol. For more information, see Device communication protocols.
Parameter authenticationType :
An enumerated string that specifies the authentication type.
-
CUSTOM_AUTH_X509- Use custom authentication and authorization with additional details from the X.509 client certificate.
-
CUSTOM_AUTH- Use custom authentication and authorization. For more information, see Custom authentication and authorization.
-
AWS_X509- Use X.509 client certificates without custom authentication and authorization. For more information, see X.509 client certificates.
-
AWS_SIGV4- Use Amazon Web Services Signature Version 4. For more information, see IAM users, groups, and roles.
-
DEFAULT- Use a combination of port and Application Layer Protocol Negotiation (ALPN) to specify authentication type. For more information, see Device communication protocols.
Parameter authorizerConfig :
An object that specifies the authorization service for a domain.
Parameter clientCertificateConfig :
An object that specifies the client certificate configuration for a domain.
Parameter domainName :
The name of the domain.
Parameter serverCertificateArns :
The ARNs of the certificates that IoT passes to the device during the TLS
handshake. Currently you can specify only one certificate ARN. This value
is not required for Amazon Web Services-managed domains.
Parameter serverCertificateConfig :
The server certificate configuration.
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 tlsConfig :
An object that specifies the TLS configuration for a domain.
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 Amazon Web Services-managed
domains.
Implementation
Future<CreateDomainConfigurationResponse> createDomainConfiguration({
required String domainConfigurationName,
ApplicationProtocol? applicationProtocol,
AuthenticationType? authenticationType,
AuthorizerConfig? authorizerConfig,
ClientCertificateConfig? clientCertificateConfig,
String? domainName,
List<String>? serverCertificateArns,
ServerCertificateConfig? serverCertificateConfig,
ServiceType? serviceType,
List<Tag>? tags,
TlsConfig? tlsConfig,
String? validationCertificateArn,
}) async {
final $payload = <String, dynamic>{
if (applicationProtocol != null)
'applicationProtocol': applicationProtocol.value,
if (authenticationType != null)
'authenticationType': authenticationType.value,
if (authorizerConfig != null) 'authorizerConfig': authorizerConfig,
if (clientCertificateConfig != null)
'clientCertificateConfig': clientCertificateConfig,
if (domainName != null) 'domainName': domainName,
if (serverCertificateArns != null)
'serverCertificateArns': serverCertificateArns,
if (serverCertificateConfig != null)
'serverCertificateConfig': serverCertificateConfig,
if (serviceType != null) 'serviceType': serviceType.value,
if (tags != null) 'tags': tags,
if (tlsConfig != null) 'tlsConfig': tlsConfig,
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);
}