createTags method

Future<void> createTags({
  1. required String resourceName,
  2. required List<Tag> tags,
})

Adds tags to a cluster.

A resource can have up to 50 tags. If you try to create more than 50 tags for a resource, you will receive an error and the attempt will fail.

If you specify a key that already exists for the resource, the value for that key will be updated with the new value.

May throw TagLimitExceededFault. May throw ResourceNotFoundFault. May throw InvalidTagFault. May throw InvalidClusterStateFault.

Parameter resourceName : The Amazon Resource Name (ARN) to which you want to add the tag or tags. For example, arn:aws:redshift:us-east-2:123456789:cluster:t1.

Parameter tags : One or more name/value pairs to add as tags to the specified resource. Each tag name is passed in with the parameter Key and the corresponding value is passed in with the parameter Value. The Key and Value parameters are separated by a comma (,). Separate multiple tags with a space. For example, --tags "Key"="owner","Value"="admin" "Key"="environment","Value"="test" "Key"="version","Value"="1.0".

Implementation

Future<void> createTags({
  required String resourceName,
  required List<Tag> tags,
}) async {
  ArgumentError.checkNotNull(resourceName, 'resourceName');
  _s.validateStringLength(
    'resourceName',
    resourceName,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tags, 'tags');
  final $request = <String, dynamic>{};
  $request['ResourceName'] = resourceName;
  $request['Tags'] = tags;
  await _protocol.send(
    $request,
    action: 'CreateTags',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateTagsMessage'],
    shapes: shapes,
  );
}