Skip to main content

gcp_configs

Creates, updates, deletes, gets or lists a gcp_configs resource.

Overview

Namegcp_configs
TypeResource
Iddatadog.cloud_costs.gcp_configs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the Google Cloud Usage Cost config.
attributesobjectAttributes for a Google Cloud Usage Cost config.
typestringType of Google Cloud Usage Cost config. (gcp_uc_config) (default: gcp_uc_config, example: gcp_uc_config)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_cost_gcpusage_cost_configsselectList the Google Cloud Usage Cost configs.
create_cost_gcpusage_cost_configinsertdataCreate a Cloud Cost Management account for an Google Cloud Usage Cost config.
update_cost_gcpusage_cost_configupdatecloud_account_id, dataUpdate the status of an Google Cloud Usage Cost config (active/archived).
delete_cost_gcpusage_cost_configdeletecloud_account_idArchive a Cloud Cost Management 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.

NameDatatypeDescription
cloud_account_idinteger (int64)Cloud 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.

SELECT examples

List the Google Cloud Usage Cost configs.

SELECT
id,
attributes,
type
FROM datadog.cloud_costs.gcp_configs
;

INSERT examples

Create a Cloud Cost Management account for an Google Cloud Usage Cost config.

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

UPDATE examples

Update the status of an Google Cloud Usage Cost config (active/archived).

UPDATE datadog.cloud_costs.gcp_configs
SET
data = '{{ data }}'
WHERE
cloud_account_id = '{{ cloud_account_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Archive a Cloud Cost Management account.

DELETE FROM datadog.cloud_costs.gcp_configs
WHERE cloud_account_id = '{{ cloud_account_id }}' --required
;