createTable method
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:CreateTablepermission to use this operation. -
If you use this operation with the optional
metadatarequest parameter you must have thes3tables:PutTableDatapermission. -
If you use this operation with the optional
encryptionConfigurationrequest parameter you must have thes3tables:PutTableEncryptionpermission. -
If you use this operation with the
storageClassConfigurationrequest parameter, you must have thes3tables:PutTableStorageClasspermission. -
To create a table with tags, you must have the
s3tables:TagResourcepermission in addition tos3tables:CreateTablepermission.
-
You must have the
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);
}