createElasticsearchDomain method

Future<CreateElasticsearchDomainResponse> createElasticsearchDomain({
  1. required String domainName,
  2. String? accessPolicies,
  3. Map<String, String>? advancedOptions,
  4. AdvancedSecurityOptionsInput? advancedSecurityOptions,
  5. CognitoOptions? cognitoOptions,
  6. DomainEndpointOptions? domainEndpointOptions,
  7. EBSOptions? eBSOptions,
  8. ElasticsearchClusterConfig? elasticsearchClusterConfig,
  9. String? elasticsearchVersion,
  10. EncryptionAtRestOptions? encryptionAtRestOptions,
  11. Map<LogType, LogPublishingOption>? logPublishingOptions,
  12. NodeToNodeEncryptionOptions? nodeToNodeEncryptionOptions,
  13. SnapshotOptions? snapshotOptions,
  14. VPCOptions? vPCOptions,
})

Creates a new Elasticsearch domain. For more information, see Creating Elasticsearch Domains in the Amazon Elasticsearch Service Developer Guide.

May throw BaseException. May throw DisabledOperationException. May throw InternalException. May throw InvalidTypeException. May throw LimitExceededException. May throw ResourceAlreadyExistsException. May throw ValidationException.

Parameter domainName : The name of the Elasticsearch domain that you are creating. Domain names are unique across the domains owned by an account within an AWS region. Domain names must start with a lowercase letter and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).

Parameter accessPolicies : IAM access policy as a JSON-formatted string.

Parameter advancedOptions : Option to allow references to indices in an HTTP request body. Must be false when configuring access to individual sub-resources. By default, the value is true. See Configuration Advanced Options for more information.

Parameter advancedSecurityOptions : Specifies advanced security options.

Parameter cognitoOptions : Options to specify the Cognito user and identity pools for Kibana authentication. For more information, see Amazon Cognito Authentication for Kibana.

Parameter domainEndpointOptions : Options to specify configuration that will be applied to the domain endpoint.

Parameter eBSOptions : Options to enable, disable and specify the type and size of EBS storage volumes.

Parameter elasticsearchClusterConfig : Configuration options for an Elasticsearch domain. Specifies the instance type and number of instances in the domain cluster.

Parameter elasticsearchVersion : String of format X.Y to specify version for the Elasticsearch domain eg. "1.5" or "2.3". For more information, see Creating Elasticsearch Domains in the Amazon Elasticsearch Service Developer Guide.

Parameter encryptionAtRestOptions : Specifies the Encryption At Rest Options.

Parameter logPublishingOptions : Map of LogType and LogPublishingOption, each containing options to publish a given type of Elasticsearch log.

Parameter nodeToNodeEncryptionOptions : Specifies the NodeToNodeEncryptionOptions.

Parameter snapshotOptions : Option to set time, in UTC format, of the daily automated snapshot. Default value is 0 hours.

Parameter vPCOptions : Options to specify the subnets and security groups for VPC endpoint. For more information, see Creating a VPC in VPC Endpoints for Amazon Elasticsearch Service Domains

Implementation

Future<CreateElasticsearchDomainResponse> createElasticsearchDomain({
  required String domainName,
  String? accessPolicies,
  Map<String, String>? advancedOptions,
  AdvancedSecurityOptionsInput? advancedSecurityOptions,
  CognitoOptions? cognitoOptions,
  DomainEndpointOptions? domainEndpointOptions,
  EBSOptions? eBSOptions,
  ElasticsearchClusterConfig? elasticsearchClusterConfig,
  String? elasticsearchVersion,
  EncryptionAtRestOptions? encryptionAtRestOptions,
  Map<LogType, LogPublishingOption>? logPublishingOptions,
  NodeToNodeEncryptionOptions? nodeToNodeEncryptionOptions,
  SnapshotOptions? snapshotOptions,
  VPCOptions? vPCOptions,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'DomainName': domainName,
    if (accessPolicies != null) 'AccessPolicies': accessPolicies,
    if (advancedOptions != null) 'AdvancedOptions': advancedOptions,
    if (advancedSecurityOptions != null)
      'AdvancedSecurityOptions': advancedSecurityOptions,
    if (cognitoOptions != null) 'CognitoOptions': cognitoOptions,
    if (domainEndpointOptions != null)
      'DomainEndpointOptions': domainEndpointOptions,
    if (eBSOptions != null) 'EBSOptions': eBSOptions,
    if (elasticsearchClusterConfig != null)
      'ElasticsearchClusterConfig': elasticsearchClusterConfig,
    if (elasticsearchVersion != null)
      'ElasticsearchVersion': elasticsearchVersion,
    if (encryptionAtRestOptions != null)
      'EncryptionAtRestOptions': encryptionAtRestOptions,
    if (logPublishingOptions != null)
      'LogPublishingOptions':
          logPublishingOptions.map((k, e) => MapEntry(k.toValue(), e)),
    if (nodeToNodeEncryptionOptions != null)
      'NodeToNodeEncryptionOptions': nodeToNodeEncryptionOptions,
    if (snapshotOptions != null) 'SnapshotOptions': snapshotOptions,
    if (vPCOptions != null) 'VPCOptions': vPCOptions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2015-01-01/es/domain',
    exceptionFnMap: _exceptionFns,
  );
  return CreateElasticsearchDomainResponse.fromJson(response);
}