tagResource method
This API works with the following fleet types: EC2, Anywhere, Container
Assigns a tag to an Amazon GameLift Servers resource. You can use tags to organize resources, create IAM permissions policies to manage access to groups of resources, customize Amazon Web Services cost breakdowns, and more. This operation handles the permissions necessary to manage tags for Amazon GameLift Servers resources that support tagging.
To add a tag to a resource, specify the unique ARN value for the resource and provide a tag list containing one or more tags. The operation succeeds even if the list includes tags that are already assigned to the resource.
Learn more
Tagging Amazon Web Services Resources in the Amazon Web Services General Reference
Amazon Web Services Tagging Strategies
Related actions
May throw InternalServiceException.
May throw InvalidRequestException.
May throw NotFoundException.
May throw TaggingFailedException.
May throw UnsupportedRegionException.
Parameter resourceARN :
The Amazon Resource Name (ARN)
that uniquely identifies the Amazon GameLift Servers resource that you
want to assign tags to. Amazon GameLift Servers includes resource ARNs in
the data object for the resource. You can retrieve the ARN by calling a
List or Describe operation for the resource
type.
Parameter tags :
A list of one or more tags to assign to the specified Amazon GameLift
Servers resource. Tags are developer-defined and structured as key-value
pairs. The maximum tag limit may be lower than stated. See
Tagging Amazon Web Services Resources for tagging limits.
Implementation
Future<void> tagResource({
required String resourceARN,
required List<Tag> tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.TagResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ResourceARN': resourceARN,
'Tags': tags,
},
);
}