tagResource method

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

Add a tag to a Step Functions resource.

An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide, and Controlling Access Using IAM Tags.

Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @.

May throw InvalidArn. May throw ResourceNotFound. May throw TooManyTags.

Parameter resourceArn : The Amazon Resource Name (ARN) for the Step Functions state machine or activity.

Parameter tags : The list of tags to add to a resource.

Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required List<Tag> tags,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tags, 'tags');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSStepFunctions.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'resourceArn': resourceArn,
      'tags': tags,
    },
  );
}