Skip to content
Merged
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
65 changes: 57 additions & 8 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3288,15 +3288,19 @@ components:
example: https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
type: string
cloud_run_revision_filters:
description: 'Limit the Cloud Run revisions that are pulled into Datadog
by using tags.
deprecated: true
description: 'List of filters to limit the Cloud Run revisions that are
pulled into Datadog by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
imported into Datadog.

**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
with `type=cloud_run_revision`'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
description: Cloud Run revision filters
type: string
type: array
errors:
Expand All @@ -3309,11 +3313,16 @@ components:
type: string
type: array
host_filters:
description: 'Limit the GCE instances that are pulled into Datadog by using
tags.
deprecated: true
description: 'A comma-separated list of filters to limit the VM instances
that are pulled into Datadog by using tags.

Only hosts that match one of the defined tags are imported into Datadog.'
example: key:value,filter:example
Only VM instance resources that apply to specified filters are imported
into Datadog.

**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
with `type=gce_instance`'
example: $KEY1:$VALUE1,$KEY2:$VALUE2
type: string
is_cspm_enabled:
description: 'When enabled, Datadog will activate the Cloud Security Monitoring
Expand All @@ -3334,6 +3343,15 @@ components:
account.'
example: true
type: boolean
monitored_resource_configs:
description: Configurations for GCP monitored resources.
example:
- filters:
- $KEY:$VALUE
type: gce_instance
items:
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
type: array
private_key:
description: Your private key name found in your JSON service account key.
example: private_key
Expand Down Expand Up @@ -3366,6 +3384,37 @@ components:
items:
$ref: '#/components/schemas/GCPAccount'
type: array
GCPMonitoredResourceConfig:
description: Configuration for a GCP monitored resource.
properties:
filters:
description: 'List of filters to limit the monitored resources that are
pulled into Datadog by using tags.

Only monitored resources that apply to specified filters are imported
into Datadog.'
example:
- $KEY:$VALUE
items:
description: A monitored resource filter
type: string
type: array
type:
$ref: '#/components/schemas/GCPMonitoredResourceConfigType'
type: object
GCPMonitoredResourceConfigType:
description: The GCP monitored resource type. Only a subset of resource types
are supported.
enum:
- cloud_function
- cloud_run_revision
- gce_instance
example: gce_instance
type: string
x-enum-varnames:
- CLOUD_FUNCTION
- CLOUD_RUN_REVISION
- GCE_INSTANCE
GeomapWidgetDefinition:
description: This visualization displays a series of values by country on a
world map.
Expand Down
62 changes: 58 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17694,6 +17694,37 @@ components:
example: aiplatform
type: string
type: object
GCPMonitoredResourceConfig:
description: Configuration for a GCP monitored resource.
properties:
filters:
description: 'List of filters to limit the monitored resources that are
pulled into Datadog by using tags.

Only monitored resources that apply to specified filters are imported
into Datadog.'
example:
- $KEY:$VALUE
items:
description: A monitored resource filter
type: string
type: array
type:
$ref: '#/components/schemas/GCPMonitoredResourceConfigType'
type: object
GCPMonitoredResourceConfigType:
description: The GCP monitored resource type. Only a subset of resource types
are supported.
enum:
- cloud_function
- cloud_run_revision
- gce_instance
example: gce_instance
type: string
x-enum-varnames:
- CLOUD_FUNCTION
- CLOUD_RUN_REVISION
- GCE_INSTANCE
GCPSTSDelegateAccount:
description: Datadog principal service account info.
properties:
Expand Down Expand Up @@ -17761,21 +17792,35 @@ components:
example: datadog-service-account@test-project.iam.gserviceaccount.com
type: string
cloud_run_revision_filters:
deprecated: true
description: 'List of filters to limit the Cloud Run revisions that are
pulled into Datadog by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
imported into Datadog.

**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
with `type=cloud_run_revision`'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
description: Cloud Run revision filters
type: string
type: array
host_filters:
description: Your Host Filters.
deprecated: true
description: 'List of filters to limit the VM instances that are pulled
into Datadog by using tags.

Only VM instance resources that apply to specified filters are imported
into Datadog.

**Note:** This field is deprecated. Instead, use `monitored_resource_configs`
with `type=gce_instance`'
example:
- $KEY:$VALUE
items:
description: Host Filters
description: VM instance filters
type: string
type: array
is_cspm_enabled:
Expand Down Expand Up @@ -17811,6 +17856,15 @@ components:
items:
$ref: '#/components/schemas/GCPMetricNamespaceConfig'
type: array
monitored_resource_configs:
description: Configurations for GCP monitored resources.
example:
- filters:
- $KEY:$VALUE
type: gce_instance
items:
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
type: array
resource_collection_enabled:
description: When enabled, Datadog scans for all resources in your GCP environment.
type: boolean
Expand Down
6 changes: 3 additions & 3 deletions features/v1/gcp_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: GCP Integration
@generated @skip @team:DataDog/gcp-integrations
Scenario: Create a GCP integration returns "Bad Request" response
Given new "CreateGCPIntegration" request
And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "$KEY1:$VALUE1,$KEY2:$VALUE2", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -27,7 +27,7 @@ Feature: GCP Integration
@generated @skip @team:DataDog/gcp-integrations
Scenario: Delete a GCP integration returns "Bad Request" response
Given new "DeleteGCPIntegration" request
And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "$KEY1:$VALUE1,$KEY2:$VALUE2", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 400 Bad Request

Expand Down Expand Up @@ -62,7 +62,7 @@ Feature: GCP Integration
@generated @skip @team:DataDog/gcp-integrations
Scenario: Update a GCP integration returns "Bad Request" response
Given new "UpdateGCPIntegration" request
And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "$KEY1:$VALUE1,$KEY2:$VALUE2", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 400 Bad Request

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": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "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"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "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"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "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"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "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"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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: 2 additions & 0 deletions services/gcp_integration/src/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export {

export { APIErrorResponse } from "./models/APIErrorResponse";
export { GCPAccount } from "./models/GCPAccount";
export { GCPMonitoredResourceConfig } from "./models/GCPMonitoredResourceConfig";
export { GCPMonitoredResourceConfigType } from "./models/GCPMonitoredResourceConfigType";
Loading