account_associations
Creates, updates, deletes, gets or lists an account_associations resource.
Overview
| Name | account_associations |
| Type | Resource |
| Id | aws.iot_managed_integrations.account_associations |
Fields
The following fields are returned by SELECT queries:
- get_account_association
- list_account_associations
| Name | Datatype | Description |
|---|---|---|
account_association_id | string | The unique identifier of the retrieved account association. (pattern: <code>[0-9a-zA-Z]+</code>) |
arn | string | The 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_state | string | The current status state for the account association. (ASSOCIATION_IN_PROGRESS, ASSOCIATION_FAILED, ASSOCIATION_SUCCEEDED, ASSOCIATION_DELETING, REFRESH_TOKEN_EXPIRED) |
connector_destination_id | string | The identifier of the connector destination associated with this account association. (pattern: <code>[A-Za-z0-9-_]+</code>) |
description | string | The description of the account association. (pattern: <code>[A-Za-z0-9-_ ]+</code>) |
error_message | string | The error message explaining the current account association error. (pattern: <code>[A-Za-z0-9-_ ]+</code>) |
general_authorization | object | The General Authorization reference by authorization material name. |
name | string | The name of the account association. (pattern: <code>[A-Za-z0-9-_ ]+</code>) |
o_auth_authorization_url | string | Third 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>) |
tags | object | A set of key/value pairs that are used to manage the account association. |
| Name | Datatype | Description |
|---|---|---|
account_association_id | string | The unique identifier of the account association. (pattern: <code>[0-9a-zA-Z]+</code>) |
arn | string | The 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_state | string | The current state of the account association, indicating its status in the association lifecycle. (ASSOCIATION_IN_PROGRESS, ASSOCIATION_FAILED, ASSOCIATION_SUCCEEDED, ASSOCIATION_DELETING, REFRESH_TOKEN_EXPIRED) |
connector_destination_id | string | The identifier of the connector destination associated with this account association. (pattern: <code>[A-Za-z0-9-_]+</code>) |
description | string | A description of the account association. (pattern: <code>[A-Za-z0-9-_ ]+</code>) |
error_message | string | The error message explaining any issues with the account association, if applicable. (pattern: <code>[A-Za-z0-9-_ ]+</code>) |
name | string | The name of the account association. (pattern: <code>[A-Za-z0-9-_ ]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_account_association | select | account_association_id, region | Get an account association for an Amazon Web Services account linked to a customer-managed destination. | |
list_account_associations | select | region | ConnectorDestinationId, MaxResults, NextToken | Lists all account associations, with optional filtering by connector destination ID. |
register_account_association | insert | region, ManagedThingId, AccountAssociationId, DeviceDiscoveryId | Registers an account association with a managed thing, establishing a connection between a device and a third-party account. | |
create_account_association | insert | region, ConnectorDestinationId | Creates a new account association via the destination id. | |
update_account_association | update | account_association_id, region | Updates the properties of an existing account association. | |
deregister_account_association | delete | region | Deregister an account association from a managed thing. | |
delete_account_association | delete | account_association_id, region | Remove 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_refresh | exec | account_association_id, region | Initiates 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.
| Name | Datatype | Description |
|---|---|---|
account_association_id | string | The unique identifier of the account association to refresh. |
region | string | AWS region (default: us-east-1) |
ConnectorDestinationId | string | The identifier of the connector destination to filter account associations by. |
MaxResults | integer | The maximum number of account associations to return in a single response. |
NextToken | string | A token used for pagination of results. |
SELECT examples
- get_account_association
- list_account_associations
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
;
Lists all account associations, with optional filtering by connector destination ID.
SELECT
account_association_id,
arn,
association_state,
connector_destination_id,
description,
error_message,
name
FROM aws.iot_managed_integrations.account_associations
WHERE region = '{{ region }}' -- required
AND ConnectorDestinationId = '{{ ConnectorDestinationId }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
INSERT examples
- register_account_association
- create_account_association
- Manifest
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
;
Creates a new account association via the destination id.
INSERT INTO aws.iot_managed_integrations.account_associations (
ClientToken,
ConnectorDestinationId,
Name,
Description,
Tags,
GeneralAuthorization,
region
)
SELECT
'{{ ClientToken }}',
'{{ ConnectorDestinationId }}' /* required */,
'{{ Name }}',
'{{ Description }}',
'{{ Tags }}',
'{{ GeneralAuthorization }}',
'{{ region }}'
RETURNING
account_association_id,
arn,
association_state,
o_auth_authorization_url
;
# Description fields are for documentation purposes
- name: account_associations
props:
- name: region
value: "{{ region }}"
description: Required parameter for the account_associations resource.
- name: ManagedThingId
value: "{{ ManagedThingId }}"
- name: AccountAssociationId
value: "{{ AccountAssociationId }}"
- name: DeviceDiscoveryId
value: "{{ DeviceDiscoveryId }}"
- name: ClientToken
value: "{{ ClientToken }}"
- name: ConnectorDestinationId
value: "{{ ConnectorDestinationId }}"
- name: Name
value: "{{ Name }}"
- name: Description
value: "{{ Description }}"
- name: Tags
value: "{{ Tags }}"
- name: GeneralAuthorization
description: |
The General Authorization reference by authorization material name.
value:
AuthMaterialName: "{{ AuthMaterialName }}"
UPDATE examples
- update_account_association
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_account_association
- delete_account_association
Deregister an account association from a managed thing.
DELETE FROM aws.iot_managed_integrations.account_associations
WHERE region = '{{ region }}' --required
;
Remove 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.
DELETE FROM aws.iot_managed_integrations.account_associations
WHERE account_association_id = '{{ account_association_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- start_account_association_refresh
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
;