tagResource method
Associates the specified tags to the resource identified by the specified resourceArn in the current region. If existing tags on a resource are not specified in the request parameters, they are not changed. When a resource is deleted, the tags associated with that resource are also deleted.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerErrorException.
May throw ResourceNotFoundException.
May throw TooManyRequestException.
May throw ValidationException.
Parameter resourceArn :
The ARN of the resource where you want to add tags.
Parameter tags :
A list of tags to add to the resource.
Implementation
Future<void> tagResource({
required String resourceArn,
required Map<String, String> tags,
}) async {
final $payload = <String, dynamic>{
'tags': tags,
};
await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}