Skip to main content

account_associations

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

Overview

Nameaccount_associations
TypeResource
Idaws.iot_managed_integrations.account_associations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_association_idstringThe unique identifier of the retrieved account association. (pattern: <code>[0-9a-zA-Z]+</code>)
arnstringThe Amazon Resource Name (ARN) of the account association. (pattern: <code>arn:aws:iotmanagedintegrations:[0-9a-zA-Z-]+:[0-9]+:account-association/[0-9a-zA-Z]+</code>)
association_statestringThe current status state for the account association. (ASSOCIATION_IN_PROGRESS, ASSOCIATION_FAILED, ASSOCIATION_SUCCEEDED, ASSOCIATION_DELETING, REFRESH_TOKEN_EXPIRED)
connector_destination_idstringThe identifier of the connector destination associated with this account association. (pattern: <code>[A-Za-z0-9-_]+</code>)
descriptionstringThe description of the account association. (pattern: <code>[A-Za-z0-9-_ ]+</code>)
error_messagestringThe error message explaining the current account association error. (pattern: <code>[A-Za-z0-9-_ ]+</code>)
general_authorizationobjectThe General Authorization reference by authorization material name.
namestringThe name of the account association. (pattern: <code>[A-Za-z0-9-_ ]+</code>)
o_auth_authorization_urlstringThird party IoT platform OAuth authorization server URL backed with all the required parameters to perform end-user authentication. This field will be empty when using General Authorization flows that do not require OAuth. (pattern: <code>$|^(https)://.*</code>)
tagsobjectA set of key/value pairs that are used to manage the account association.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_account_associationselectaccount_association_id, regionGet an account association for an Amazon Web Services account linked to a customer-managed destination.
list_account_associationsselectregionConnectorDestinationId, MaxResults, NextTokenLists all account associations, with optional filtering by connector destination ID.
register_account_associationinsertregion, ManagedThingId, AccountAssociationId, DeviceDiscoveryIdRegisters an account association with a managed thing, establishing a connection between a device and a third-party account.
create_account_associationinsertregion, ConnectorDestinationIdCreates a new account association via the destination id.
update_account_associationupdateaccount_association_id, regionUpdates the properties of an existing account association.
deregister_account_associationdeleteregionDeregister an account association from a managed thing.
delete_account_associationdeleteaccount_association_id, regionRemove a third-party account association for an end user. You must first call the DeregisterAccountAssociation to remove the connection between the managed thing and the third-party account before calling the DeleteAccountAssociation API.
start_account_association_refreshexecaccount_association_id, regionInitiates a refresh of an existing account association to update its authorization and connection status.

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
account_association_idstringThe unique identifier of the account association to refresh.
regionstringAWS region (default: us-east-1)
ConnectorDestinationIdstringThe identifier of the connector destination to filter account associations by.
MaxResultsintegerThe maximum number of account associations to return in a single response.
NextTokenstringA token used for pagination of results.

SELECT examples

Get an account association for an Amazon Web Services account linked to a customer-managed destination.

SELECT
account_association_id,
arn,
association_state,
connector_destination_id,
description,
error_message,
general_authorization,
name,
o_auth_authorization_url,
tags
FROM aws.iot_managed_integrations.account_associations
WHERE account_association_id = '{{ account_association_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Registers an account association with a managed thing, establishing a connection between a device and a third-party account.

INSERT INTO aws.iot_managed_integrations.account_associations (
ManagedThingId,
AccountAssociationId,
DeviceDiscoveryId,
region
)
SELECT
'{{ ManagedThingId }}' /* required */,
'{{ AccountAssociationId }}' /* required */,
'{{ DeviceDiscoveryId }}' /* required */,
'{{ region }}'
RETURNING
account_association_id,
device_discovery_id,
managed_thing_id
;

UPDATE examples

Updates the properties of an existing account association.

UPDATE aws.iot_managed_integrations.account_associations
SET
Name = '{{ Name }}',
Description = '{{ Description }}'
WHERE
account_association_id = '{{ account_association_id }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deregister an account association from a managed thing.

DELETE FROM aws.iot_managed_integrations.account_associations
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Initiates a refresh of an existing account association to update its authorization and connection status.

EXEC aws.iot_managed_integrations.account_associations.start_account_association_refresh
@account_association_id='{{ account_association_id }}' --required,
@region='{{ region }}' --required
;