UpdateLinkCommand

Use this operation to change what types of data are shared from a source account to its linked monitoring account sink. You can't change the sink or change the monitoring account with this operation.

When you update a link, you can optionally specify filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.

To update the list of tags associated with the sink, use TagResource .

Example Syntax

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

import { OAMClient, UpdateLinkCommand } from "@aws-sdk/client-oam"; // ES Modules import
// const { OAMClient, UpdateLinkCommand } = require("@aws-sdk/client-oam"); // CommonJS import
const client = new OAMClient(config);
const input = { // UpdateLinkInput
  Identifier: "STRING_VALUE", // required
  ResourceTypes: [ // ResourceTypesInput // required
    "AWS::CloudWatch::Metric" || "AWS::Logs::LogGroup" || "AWS::XRay::Trace" || "AWS::ApplicationInsights::Application" || "AWS::InternetMonitor::Monitor" || "AWS::ApplicationSignals::Service" || "AWS::ApplicationSignals::ServiceLevelObjective",
  ],
  LinkConfiguration: { // LinkConfiguration
    LogGroupConfiguration: { // LogGroupConfiguration
      Filter: "STRING_VALUE", // required
    },
    MetricConfiguration: { // MetricConfiguration
      Filter: "STRING_VALUE", // required
    },
  },
};
const command = new UpdateLinkCommand(input);
const response = await client.send(command);
// { // UpdateLinkOutput
//   Arn: "STRING_VALUE",
//   Id: "STRING_VALUE",
//   Label: "STRING_VALUE",
//   LabelTemplate: "STRING_VALUE",
//   ResourceTypes: [ // ResourceTypesOutput
//     "STRING_VALUE",
//   ],
//   SinkArn: "STRING_VALUE",
//   Tags: { // TagMapOutput
//     "<keys>": "STRING_VALUE",
//   },
//   LinkConfiguration: { // LinkConfiguration
//     LogGroupConfiguration: { // LogGroupConfiguration
//       Filter: "STRING_VALUE", // required
//     },
//     MetricConfiguration: { // MetricConfiguration
//       Filter: "STRING_VALUE", // required
//     },
//   },
// };

UpdateLinkCommand Input

See UpdateLinkCommandInput for more details

Parameter
Type
Description
Identifier
Required
string | undefined

The ARN of the link that you want to update.

ResourceTypes
Required
ResourceType[] | undefined

An array of strings that define which types of data that the source account will send to the monitoring account.

Your input here replaces the current set of data types that are shared.

LinkConfiguration
LinkConfiguration | undefined

Use this structure to filter which metric namespaces and which log groups are to be shared from the source account to the monitoring account.

UpdateLinkCommand Output

See UpdateLinkCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Arn
string | undefined

The ARN of the link that you have updated.

Id
string | undefined

The random ID string that Amazon Web Services generated as part of the sink ARN.

Label
string | undefined

The label assigned to this link, with the variables resolved to their actual values.

LabelTemplate
string | undefined

The exact label template that was specified when the link was created, with the template variables not resolved.

LinkConfiguration
LinkConfiguration | undefined

This structure includes filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.

ResourceTypes
string[] | undefined

The resource types now supported by this link.

SinkArn
string | undefined

The ARN of the sink that is used for this link.

Tags
Record<string, string> | undefined

The tags assigned to the link.

Throws

Name
Fault
Details
InternalServiceFault
server

Unexpected error while processing the request. Retry the request.

InvalidParameterException
client

A parameter is specified incorrectly.

MissingRequiredParameterException
client

A required parameter is missing from the request.

ResourceNotFoundException
client

The request references a resource that does not exist.

OAMServiceException
Base exception class for all service exceptions from OAM service.