createTable method

Future<CreateTableResponse> createTable({
  1. required OpenTableFormat format,
  2. required String name,
  3. required String namespace,
  4. required String tableBucketARN,
  5. EncryptionConfiguration? encryptionConfiguration,
  6. TableMetadata? metadata,
  7. StorageClassConfiguration? storageClassConfiguration,
  8. Map<String, String>? tags,
})

Creates a new table associated with the given namespace in a table bucket. For more information, see Creating an Amazon S3 table in the Amazon Simple Storage Service User Guide.

Permissions
  • You must have the s3tables:CreateTable permission to use this operation.
  • If you use this operation with the optional metadata request parameter you must have the s3tables:PutTableData permission.
  • If you use this operation with the optional encryptionConfiguration request parameter you must have the s3tables:PutTableEncryption permission.
  • If you use this operation with the storageClassConfiguration request parameter, you must have the s3tables:PutTableStorageClass permission.
  • To create a table with tags, you must have the s3tables:TagResource permission in addition to s3tables:CreateTable permission.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw InternalServerErrorException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter format : The format for the table.

Parameter name : The name for the table.

Parameter namespace : The namespace to associated with the table.

Parameter tableBucketARN : The Amazon Resource Name (ARN) of the table bucket to create the table in.

Parameter encryptionConfiguration : The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table.

Parameter metadata : The metadata for the table.

Parameter storageClassConfiguration : The storage class configuration for the table. If not specified, the table inherits the storage class configuration from its table bucket. Specify this parameter to override the bucket's default storage class for this table.

Parameter tags : A map of user-defined tags that you would like to apply to the table that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize, track costs for, and control access to resources. For more information, see Tagging for cost allocation or attribute-based access control (ABAC).

Implementation

Future<CreateTableResponse> createTable({
  required OpenTableFormat format,
  required String name,
  required String namespace,
  required String tableBucketARN,
  EncryptionConfiguration? encryptionConfiguration,
  TableMetadata? metadata,
  StorageClassConfiguration? storageClassConfiguration,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'format': format.value,
    'name': name,
    if (encryptionConfiguration != null)
      'encryptionConfiguration': encryptionConfiguration,
    if (metadata != null) 'metadata': metadata,
    if (storageClassConfiguration != null)
      'storageClassConfiguration': storageClassConfiguration,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/tables/${Uri.encodeComponent(tableBucketARN)}/${Uri.encodeComponent(namespace)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateTableResponse.fromJson(response);
}