TagResourceCommand

Add tags to, or update the tag values of, an App Runner resource. A tag is a key-value pair.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AppRunnerClient, TagResourceCommand } from "@aws-sdk/client-apprunner"; // ES Modules import
// const { AppRunnerClient, TagResourceCommand } = require("@aws-sdk/client-apprunner"); // CommonJS import
const client = new AppRunnerClient(config);
const input = { // TagResourceRequest
  ResourceArn: "STRING_VALUE", // required
  Tags: [ // TagList // required
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
};
const command = new TagResourceCommand(input);
const response = await client.send(command);
// {};

TagResourceCommand Input

See TagResourceCommandInput for more details

Parameter
Type
Description
ResourceArn
Required
string | undefined

The Amazon Resource Name (ARN) of the resource that you want to update tags for.

It must be the ARN of an App Runner resource.

Tags
Required
Tag[] | undefined

A list of tag key-value pairs to add or update. If a key is new to the resource, the tag is added with the provided value. If a key is already associated with the resource, the value of the tag is updated.

TagResourceCommand Output

See TagResourceCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
InternalServiceErrorException
server

An unexpected service exception occurred.

InvalidRequestException
client

One or more input parameters aren't valid. Refer to the API action's document page, correct the input parameters, and try the action again.

InvalidStateException
client

You can't perform this action when the resource is in its current state.

ResourceNotFoundException
client

A resource doesn't exist for the specified Amazon Resource Name (ARN) in your Amazon Web Services account.

AppRunnerServiceException
Base exception class for all service exceptions from AppRunner service.