tagResource method

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

Associates the specified tags to an Amazon EKS resource with the specified resourceArn. If existing tags on a resource are not specified in the request parameters, they aren't changed. When a resource is deleted, the tags associated with that resource are also deleted. Tags that you create for Amazon EKS resources don't propagate to any other resources associated with the cluster. For example, if you tag a cluster with this operation, that tag doesn't automatically propagate to the subnets and nodes associated with the cluster.

May throw BadRequestException. May throw NotFoundException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource to add tags to.

Parameter tags : Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required Map<String, String> tags,
}) async {
  final $payload = <String, dynamic>{
    'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
    exceptionFnMap: _exceptionFns,
  );
}