Skip to main content

aws_accounts

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

Overview

Nameaws_accounts
TypeResource
Iddatadog.integrations.aws_accounts

Fields

The following fields are returned by SELECT queries:

AWS Account object

NameDatatypeDescription
idstringUnique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https:​//docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) endpoint and query by AWS Account ID. (example: 00000000-abcd-0001-0000-000000000000)
attributesobjectAWS Account response attributes.
typestringAWS Account resource type. (account) (default: account, example: account)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_awsaccountselectaws_account_config_idGet an AWS Account Integration Config by config ID.
list_awsaccountsselectaws_account_idGet a list of AWS Account Integration Configs.
create_awsaccountinsertdataCreate a new AWS Account Integration Config.
update_awsaccountupdateaws_account_config_id, dataUpdate an AWS Account Integration Config by config ID.
delete_awsaccountdeleteaws_account_config_idDelete an AWS Account Integration Config by config ID.
preview_awsmetric_name_filterexecaws_account_config_id, dataPreview which collected CloudWatch metrics would be filtered by the supplied metric name filters.<br />The filters are not persisted.
create_new_awsexternal_idexecGenerate a new external ID for AWS role-based authentication.
validate_awsccmconfigexecdataValidate a Cloud Cost Management config for an AWS account using Cost and Usage Report<br />(CUR) 2.0 against Datadog's ingest requirements without persisting it.

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
aws_account_config_idstringUnique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https:​//docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) endpoint and query by AWS Account ID.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
aws_account_idstringOptional query parameter to filter accounts by AWS Account ID. If not provided, all accounts are returned. (example: 123456789012)

SELECT examples

Get an AWS Account Integration Config by config ID.

SELECT
id,
attributes,
type
FROM datadog.integrations.aws_accounts
WHERE aws_account_config_id = '{{ aws_account_config_id }}' -- required
;

INSERT examples

Create a new AWS Account Integration Config.

INSERT INTO datadog.integrations.aws_accounts (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

UPDATE examples

Update an AWS Account Integration Config by config ID.

UPDATE datadog.integrations.aws_accounts
SET
data = '{{ data }}'
WHERE
aws_account_config_id = '{{ aws_account_config_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete an AWS Account Integration Config by config ID.

DELETE FROM datadog.integrations.aws_accounts
WHERE aws_account_config_id = '{{ aws_account_config_id }}' --required
;

Lifecycle Methods

EXEC variables use wire (API) names.

Preview which collected CloudWatch metrics would be filtered by the supplied metric name filters.<br />The filters are not persisted.

EXEC datadog.integrations.aws_accounts.preview_awsmetric_name_filter
@aws_account_config_id='{{ aws_account_config_id }}' --required,
@@json=
'{
"data": "{{ data }}"
}'
;