Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22330,6 +22330,13 @@ components:
product for this service account. Note: This requires resource_collection_enabled
to be set to true.'
type: boolean
is_global_location_enabled:
default: true
description: "When enabled, metrics, events, and resources where location
is explicitly stated as \u201Cglobal\u201D or where location information
could not be deduced from GCP labels will be collected."
example: true
type: boolean
is_per_project_quota_enabled:
default: false
description: When enabled, Datadog applies the `X-Goog-User-Project` header,
Expand Down Expand Up @@ -22371,6 +22378,16 @@ components:
items:
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
type: array
region_filter_configs:
description: Filters to limit metric collection by GCP region. By default
Datadog collects from all regions.
example:
- us-east1
- europe-north1
items:
description: Region Filter Configs
type: string
type: array
resource_collection_enabled:
description: When enabled, Datadog scans for all resources in your GCP environment.
type: boolean
Expand Down
8 changes: 4 additions & 4 deletions features/v2/gcp_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ Feature: GCP Integration
@generated @skip @team:DataDog/gcp-integrations
Scenario: Create a new entry for your service account returns "Bad Request" response
Given new "CreateGCPSTSAccount" request
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["us-east1", "europe-north1"]}, "type": "gcp_service_account"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/gcp-integrations
Scenario: Create a new entry for your service account returns "Conflict" response
Given new "CreateGCPSTSAccount" request
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["us-east1", "europe-north1"]}, "type": "gcp_service_account"}}
When the request is sent
Then the response status is 409 Conflict

Expand Down Expand Up @@ -151,15 +151,15 @@ Feature: GCP Integration
Scenario: Update STS Service Account returns "Bad Request" response
Given new "UpdateGCPSTSAccount" request
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["us-east1", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/gcp-integrations
Scenario: Update STS Service Account returns "Not Found" response
Given new "UpdateGCPSTSAccount" request
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["us-east1", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
When the request is sent
Then the response status is 404 Not Found

Expand Down
2 changes: 1 addition & 1 deletion features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate-{{ unique_lower_alnum }}\",\n \"dry_run\": false\n }\n }\n}"
"value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate\",\n \"dry_run\": false\n }\n }\n}"
}
],
"step": "there is a valid \"deployment_gate\" in the system",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export class GCPSTSServiceAccountAttributes {
* When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.
*/
"isCspmEnabled"?: boolean;
/**
* When enabled, metrics, events, and resources where location is explicitly stated as “global” or where location information could not be deduced from GCP labels will be collected.
*/
"isGlobalLocationEnabled"?: boolean;
/**
* When enabled, Datadog applies the `X-Goog-User-Project` header, attributing Google Cloud billing and quota usage to the project being monitored rather than the default service account project.
*/
Expand All @@ -55,6 +59,10 @@ export class GCPSTSServiceAccountAttributes {
* Configurations for GCP monitored resources.
*/
"monitoredResourceConfigs"?: Array<GCPMonitoredResourceConfig>;
/**
* Filters to limit metric collection by GCP region. By default Datadog collects from all regions.
*/
"regionFilterConfigs"?: Array<string>;
/**
* When enabled, Datadog scans for all resources in your GCP environment.
*/
Expand Down Expand Up @@ -98,6 +106,10 @@ export class GCPSTSServiceAccountAttributes {
baseName: "is_cspm_enabled",
type: "boolean",
},
isGlobalLocationEnabled: {
baseName: "is_global_location_enabled",
type: "boolean",
},
isPerProjectQuotaEnabled: {
baseName: "is_per_project_quota_enabled",
type: "boolean",
Expand All @@ -118,6 +130,10 @@ export class GCPSTSServiceAccountAttributes {
baseName: "monitored_resource_configs",
type: "Array<GCPMonitoredResourceConfig>",
},
regionFilterConfigs: {
baseName: "region_filter_configs",
type: "Array<string>",
},
resourceCollectionEnabled: {
baseName: "resource_collection_enabled",
type: "boolean",
Expand Down
Loading