links
Creates, updates, deletes, gets or lists a links resource.
Overview
| Name | links |
| Type | Resource |
| Id | aws.oam.links |
Fields
The following fields are returned by SELECT queries:
- get_link
- list_links
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the link. |
id | string | The random ID string that Amazon Web Services generated as part of the link ARN. |
label | string | The label that you assigned to this link, with the variables resolved to their actual values. |
label_template | string | The exact label template that was specified when the link was created, with the template variables not resolved. |
link_configuration | object | Use 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_types | array | The resource types supported by this link. |
sink_arn | string | The ARN of the sink that is used for this link. |
tags | object | The tags assigned to the link. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the link. |
id | string | The random ID string that Amazon Web Services generated as part of the link ARN. |
label | string | The label that was assigned to this link at creation, with the variables resolved to their actual values. |
resource_types | array | The resource types supported by this link. |
sink_arn | string | The ARN of the sink that this link is attached to. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_link | select | region | Returns complete information about one link. To use this operation, provide the link ARN. To retrieve a list of link ARNs, use ListLinks. | |
list_links | select | region | Use 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_link | insert | region, LabelTemplate, ResourceTypes, SinkIdentifier | 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. | |
update_link | update | region, Identifier, ResourceTypes | 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. | |
delete_link | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_link
- list_links
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
;
Use 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.
SELECT
arn,
id,
label,
resource_types,
sink_arn
FROM aws.oam.links
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_link
- Manifest
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
;
# Description fields are for documentation purposes
- name: links
props:
- name: region
value: "{{ region }}"
description: Required parameter for the links resource.
- name: LabelTemplate
value: "{{ LabelTemplate }}"
- name: LinkConfiguration
description: |
Use 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.
value:
LogGroupConfiguration:
Filter: "{{ Filter }}"
MetricConfiguration:
Filter: "{{ Filter }}"
- name: ResourceTypes
value:
- "{{ ResourceTypes }}"
- name: SinkIdentifier
value: "{{ SinkIdentifier }}"
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- update_link
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
- delete_link
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
;