Skip to main content

links

Creates, updates, deletes, gets or lists a links resource.

Overview

Namelinks
TypeResource
Idaws.oam.links

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN of the link.
idstringThe random ID string that Amazon Web Services generated as part of the link ARN.
labelstringThe label that you assigned to this link, with the variables resolved to their actual values.
label_templatestringThe exact label template that was specified when the link was created, with the template variables not resolved.
link_configurationobjectUse this structure to optionally create filters that specify that only some metric namespaces or log groups are to be shared from the source account to the monitoring account.
resource_typesarrayThe resource types supported by this link.
sink_arnstringThe ARN of the sink that is used for this link.
tagsobjectThe tags assigned to the link.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_linkselectregionReturns complete information about one link. To use this operation, provide the link ARN. To retrieve a list of link ARNs, use ListLinks.
list_linksselectregionUse this operation in a source account to return a list of links to monitoring account sinks that this source account has. To find a list of links for one monitoring account sink, use ListAttachedLinks from within the monitoring account.
create_linkinsertregion, LabelTemplate, ResourceTypes, SinkIdentifierCreates a link between a source account and a sink that you have created in a monitoring account. After the link is created, data is sent from the source account to the monitoring account. When you create 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. Before you create a link, you must create a sink in the monitoring account and create a sink policy in that account. The sink policy must permit the source account to link to it. You can grant permission to source accounts by granting permission to an entire organization or to individual accounts. For more information, see CreateSink and PutSinkPolicy. Each monitoring account can be linked to as many as 100,000 source accounts. Each source account can be linked to as many as five monitoring accounts.
update_linkupdateregion, Identifier, ResourceTypesUse 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.
delete_linkdeleteregionDeletes a link between a monitoring account sink and a source account. You must run this operation in the source account.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns complete information about one link. To use this operation, provide the link ARN. To retrieve a list of link ARNs, use ListLinks.

SELECT
arn,
id,
label,
label_template,
link_configuration,
resource_types,
sink_arn,
tags
FROM aws.oam.links
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a link between a source account and a sink that you have created in a monitoring account. After the link is created, data is sent from the source account to the monitoring account. When you create 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. Before you create a link, you must create a sink in the monitoring account and create a sink policy in that account. The sink policy must permit the source account to link to it. You can grant permission to source accounts by granting permission to an entire organization or to individual accounts. For more information, see CreateSink and PutSinkPolicy. Each monitoring account can be linked to as many as 100,000 source accounts. Each source account can be linked to as many as five monitoring accounts.

INSERT INTO aws.oam.links (
LabelTemplate,
LinkConfiguration,
ResourceTypes,
SinkIdentifier,
Tags,
region
)
SELECT
'{{ LabelTemplate }}' /* required */,
'{{ LinkConfiguration }}',
'{{ ResourceTypes }}' /* required */,
'{{ SinkIdentifier }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
arn,
id,
label,
label_template,
link_configuration,
resource_types,
sink_arn,
tags
;

UPDATE examples

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.

UPDATE aws.oam.links
SET
Identifier = '{{ Identifier }}',
IncludeTags = {{ IncludeTags }},
LinkConfiguration = '{{ LinkConfiguration }}',
ResourceTypes = '{{ ResourceTypes }}'
WHERE
region = '{{ region }}' --required
AND Identifier = '{{ Identifier }}' --required
AND ResourceTypes = '{{ ResourceTypes }}' --required
RETURNING
arn,
id,
label,
label_template,
link_configuration,
resource_types,
sink_arn,
tags;

DELETE examples

Deletes a link between a monitoring account sink and a source account. You must run this operation in the source account.

DELETE FROM aws.oam.links
WHERE region = '{{ region }}' --required
;