Skip to main content

account_links

Creates, updates, deletes, gets or lists an account_links resource.

Overview

Nameaccount_links
TypeResource
Idaws.workspaces.account_links

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_link_idstringThe identifier of the account link. (pattern: <code>^link-.{8,24}$</code>)
account_link_statusstringThe status of the account link. (LINKED, LINKING_FAILED, LINK_NOT_FOUND, PENDING_ACCEPTANCE_BY_TARGET_ACCOUNT, REJECTED)
source_account_idstringThe identifier of the source account. (pattern: <code>^\d{12}$</code>)
target_account_idstringThe identifier of the target account. (pattern: <code>^\d{12}$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_account_linkselectregionRetrieves account link information.
create_account_link_invitationinsertregion, TargetAccountIdCreates the account link invitation.
delete_account_link_invitationdeleteregionDeletes the account link invitation.
accept_account_link_invitationexecregion, LinkIdAccepts the account link invitation. There's currently no unlinking capability after you accept the account linking invitation.
list_account_linksexecregionLists all account links.
reject_account_link_invitationexecregion, LinkIdRejects the account link invitation.

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

Retrieves account link information.

SELECT
account_link_id,
account_link_status,
source_account_id,
target_account_id
FROM aws.workspaces.account_links
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates the account link invitation.

INSERT INTO aws.workspaces.account_links (
TargetAccountId,
ClientToken,
region
)
SELECT
'{{ TargetAccountId }}' /* required */,
'{{ ClientToken }}',
'{{ region }}'
RETURNING
account_link
;

DELETE examples

Deletes the account link invitation.

DELETE FROM aws.workspaces.account_links
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Accepts the account link invitation. There's currently no unlinking capability after you accept the account linking invitation.

EXEC aws.workspaces.account_links.accept_account_link_invitation
@region='{{ region }}' --required
@@json=
'{
"LinkId": "{{ LinkId }}",
"ClientToken": "{{ ClientToken }}"
}'
;