createLookupTable method
Creates a lookup table by uploading CSV data. You can use lookup tables to enrich log data in CloudWatch Logs Insights queries with reference data such as user details, application names, or error descriptions.
The table name must be unique within your account and Region. The CSV content must include a header row with column names, use UTF-8 encoding, and not exceed 10 MB.
May throw AccessDeniedException.
May throw InvalidParameterException.
May throw LimitExceededException.
May throw ResourceAlreadyExistsException.
May throw ServiceUnavailableException.
May throw ValidationException.
Parameter lookupTableName :
The name of the lookup table. The name must be unique within your account
and Region. The name can contain only alphanumeric characters and
underscores, and can be up to 256 characters long.
Parameter tableBody :
The CSV content of the lookup table. The first row must be a header row
with column names. The content must use UTF-8 encoding and not exceed 10
MB.
Parameter description :
A description of the lookup table. The description can be up to 1024
characters long.
Parameter kmsKeyId :
The ARN of the KMS key to use to encrypt the lookup table data. If you
don't specify a key, the data is encrypted with an Amazon Web
Services-owned key.
Parameter tags :
A list of key-value pairs to associate with the lookup table. You can
associate as many as 50 tags with a lookup table. Tags can help you
organize and categorize your resources.
Implementation
Future<CreateLookupTableResponse> createLookupTable({
required String lookupTableName,
required String tableBody,
String? description,
String? kmsKeyId,
Map<String, String>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Logs_20140328.CreateLookupTable'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'lookupTableName': lookupTableName,
'tableBody': tableBody,
if (description != null) 'description': description,
if (kmsKeyId != null) 'kmsKeyId': kmsKeyId,
if (tags != null) 'tags': tags,
},
);
return CreateLookupTableResponse.fromJson(jsonResponse.body);
}