tagResource method

Future<void> tagResource({
  1. required String resourceArn,
  2. required Map<String, String> tags,
})

Assigns a set of key-value pairs to a resource.

May throw InvalidParameterValueException. May throw LimitExceededException. May throw MissingParameterValueException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter resourceArn : The ARN that uniquely identifies the resource.

Parameter tags : Key-value pairs that are used to help organize your resources. You can assign your own metadata to the resources you create. For clarity, this is the structure to assign tags: [{"Key":"string","Value":"string"}].

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: '/tags/${Uri.encodeComponent(resourceArn)}',
    exceptionFnMap: _exceptionFns,
  );
}