tagResource method
Adds one or more tags to a specified Amazon QLDB resource.
A resource can have up to 50 tags. If you try to create more than 50 tags for a resource, your request fails and returns an error.
May throw InvalidParameterException. May throw ResourceNotFoundException.
Parameter resourceArn
:
The Amazon Resource Name (ARN) to which you want to add the tags. For
example:
arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger
Parameter tags
:
The key-value pairs to add as tags to the specified QLDB resource. Tag
keys are case sensitive. If you specify a key that already exists for the
resource, your request fails and returns an error. Tag values are case
sensitive and can be null.
Implementation
Future<void> tagResource({
required String resourceArn,
required Map<String, String> tags,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
_s.validateStringLength(
'resourceArn',
resourceArn,
20,
1600,
isRequired: true,
);
ArgumentError.checkNotNull(tags, 'tags');
final $payload = <String, dynamic>{
'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}