Skip to content

Commit 4d27881

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add API spec for security monitoring terraform export endpoints (#3219)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0a2e481 commit 4d27881

26 files changed

+2113
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,20 @@ components:
13881388
required: true
13891389
schema:
13901390
type: string
1391+
SecurityMonitoringTerraformResourceId:
1392+
description: The ID of the security monitoring resource to export.
1393+
in: path
1394+
name: resource_id
1395+
required: true
1396+
schema:
1397+
type: string
1398+
SecurityMonitoringTerraformResourceType:
1399+
description: The type of security monitoring resource to export.
1400+
in: path
1401+
name: resource_type
1402+
required: true
1403+
schema:
1404+
$ref: "#/components/schemas/SecurityMonitoringTerraformResourceType"
13911405
SensitiveDataScannerGroupID:
13921406
description: The ID of a group of rules.
13931407
in: path
@@ -64963,6 +64977,134 @@ components:
6496364977
$ref: "#/components/schemas/SecurityMonitoringSuppression"
6496464978
type: array
6496564979
type: object
64980+
SecurityMonitoringTerraformBulkExportAttributes:
64981+
description: Attributes for the bulk export request.
64982+
properties:
64983+
resource_ids:
64984+
description: The list of resource IDs to export. Maximum 1000 items.
64985+
example:
64986+
- ""
64987+
items:
64988+
description: The ID of the resource to export.
64989+
type: string
64990+
maxItems: 1000
64991+
type: array
64992+
required:
64993+
- resource_ids
64994+
type: object
64995+
SecurityMonitoringTerraformBulkExportData:
64996+
description: The bulk export request data object.
64997+
properties:
64998+
attributes:
64999+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportAttributes"
65000+
type:
65001+
description: The JSON:API type. Always `bulk_export_resources`.
65002+
example: bulk_export_resources
65003+
type: string
65004+
required:
65005+
- type
65006+
- attributes
65007+
type: object
65008+
SecurityMonitoringTerraformBulkExportRequest:
65009+
description: Request body for bulk exporting security monitoring resources to Terraform.
65010+
properties:
65011+
data:
65012+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportData"
65013+
required:
65014+
- data
65015+
type: object
65016+
SecurityMonitoringTerraformConvertAttributes:
65017+
description: Attributes for the convert request.
65018+
properties:
65019+
resource_json:
65020+
additionalProperties: {}
65021+
description: The resource attributes as a JSON object, matching the structure returned by the corresponding Datadog API (for example, the attributes of a suppression rule).
65022+
example:
65023+
enabled: true
65024+
name: Custom suppression
65025+
rule_query: type:log_detection source:cloudtrail
65026+
suppression_query: env:staging status:low
65027+
type: object
65028+
required:
65029+
- resource_json
65030+
type: object
65031+
SecurityMonitoringTerraformConvertData:
65032+
description: The convert request data object.
65033+
properties:
65034+
attributes:
65035+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertAttributes"
65036+
id:
65037+
description: The ID of the resource being converted.
65038+
example: abc-123
65039+
type: string
65040+
type:
65041+
description: The JSON:API type. Always `convert_resource`.
65042+
example: convert_resource
65043+
type: string
65044+
required:
65045+
- type
65046+
- id
65047+
- attributes
65048+
type: object
65049+
SecurityMonitoringTerraformConvertRequest:
65050+
description: Request body for converting a security monitoring resource JSON to Terraform.
65051+
properties:
65052+
data:
65053+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertData"
65054+
required:
65055+
- data
65056+
type: object
65057+
SecurityMonitoringTerraformExportAttributes:
65058+
description: Attributes of the Terraform export response.
65059+
properties:
65060+
output:
65061+
description: The Terraform configuration for the resource.
65062+
type: string
65063+
resource_id:
65064+
description: The ID of the exported resource.
65065+
example: abc-123
65066+
type: string
65067+
type_name:
65068+
description: The Terraform resource type name.
65069+
example: datadog_security_monitoring_suppression
65070+
type: string
65071+
required:
65072+
- type_name
65073+
- resource_id
65074+
type: object
65075+
SecurityMonitoringTerraformExportData:
65076+
description: The Terraform export data object.
65077+
properties:
65078+
attributes:
65079+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportAttributes"
65080+
id:
65081+
description: The resource identifier composed of the Terraform type name and the resource ID separated by `|`.
65082+
example: datadog_security_monitoring_suppression|abc-123
65083+
type: string
65084+
type:
65085+
description: The JSON:API type. Always `format_resource`.
65086+
example: format_resource
65087+
type: string
65088+
required:
65089+
- type
65090+
- id
65091+
- attributes
65092+
type: object
65093+
SecurityMonitoringTerraformExportResponse:
65094+
description: Response containing the Terraform configuration for a security monitoring resource.
65095+
properties:
65096+
data:
65097+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportData"
65098+
type: object
65099+
SecurityMonitoringTerraformResourceType:
65100+
description: The type of security monitoring resource to export to Terraform.
65101+
enum:
65102+
- suppressions
65103+
- critical_assets
65104+
type: string
65105+
x-enum-varnames:
65106+
- SUPPRESSIONS
65107+
- CRITICAL_ASSETS
6496665108
SecurityMonitoringThirdPartyRootQuery:
6496765109
description: A query to be combined with the third party case query.
6496865110
properties:
@@ -114337,6 +114479,141 @@ paths:
114337114479
permissions:
114338114480
- security_monitoring_rules_read
114339114481
- security_monitoring_signals_read
114482+
/api/v2/security_monitoring/terraform/{resource_type}/bulk:
114483+
post:
114484+
description: |-
114485+
Export multiple security monitoring resources to Terraform, packaged as a zip archive.
114486+
The `resource_type` path parameter specifies the type of resources to export
114487+
and must be one of `suppressions` or `critical_assets`.
114488+
A maximum of 1000 resources can be exported in a single request.
114489+
operationId: BulkExportSecurityMonitoringTerraformResources
114490+
parameters:
114491+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
114492+
requestBody:
114493+
content:
114494+
application/json:
114495+
schema:
114496+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportRequest"
114497+
description: The resource IDs to export.
114498+
required: true
114499+
responses:
114500+
"200":
114501+
content:
114502+
application/zip:
114503+
schema:
114504+
format: binary
114505+
type: string
114506+
description: OK
114507+
"400":
114508+
$ref: "#/components/responses/BadRequestResponse"
114509+
"403":
114510+
$ref: "#/components/responses/NotAuthorizedResponse"
114511+
"404":
114512+
$ref: "#/components/responses/NotFoundResponse"
114513+
"429":
114514+
$ref: "#/components/responses/TooManyRequestsResponse"
114515+
security:
114516+
- apiKeyAuth: []
114517+
appKeyAuth: []
114518+
- AuthZ:
114519+
- security_monitoring_suppressions_read
114520+
- AuthZ:
114521+
- security_monitoring_rules_read
114522+
summary: Export security monitoring resources to Terraform
114523+
tags:
114524+
- Security Monitoring
114525+
x-codegen-request-body-name: body
114526+
"x-permission":
114527+
operator: OR
114528+
permissions:
114529+
- security_monitoring_suppressions_read
114530+
- security_monitoring_rules_read
114531+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
114532+
/api/v2/security_monitoring/terraform/{resource_type}/convert:
114533+
post:
114534+
description: |-
114535+
Convert a security monitoring resource that doesn't (yet) exist from JSON to Terraform.
114536+
The `resource_type` path parameter specifies the type of resource to convert
114537+
and must be one of `suppressions` or `critical_assets`.
114538+
operationId: ConvertSecurityMonitoringTerraformResource
114539+
parameters:
114540+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
114541+
requestBody:
114542+
content:
114543+
application/json:
114544+
schema:
114545+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertRequest"
114546+
description: The resource JSON to convert.
114547+
required: true
114548+
responses:
114549+
"200":
114550+
content:
114551+
application/json:
114552+
schema:
114553+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportResponse"
114554+
description: OK
114555+
"400":
114556+
$ref: "#/components/responses/BadRequestResponse"
114557+
"403":
114558+
$ref: "#/components/responses/NotAuthorizedResponse"
114559+
"429":
114560+
$ref: "#/components/responses/TooManyRequestsResponse"
114561+
security:
114562+
- apiKeyAuth: []
114563+
appKeyAuth: []
114564+
- AuthZ:
114565+
- security_monitoring_suppressions_read
114566+
- AuthZ:
114567+
- security_monitoring_rules_read
114568+
summary: Convert security monitoring resource to Terraform
114569+
tags:
114570+
- Security Monitoring
114571+
x-codegen-request-body-name: body
114572+
"x-permission":
114573+
operator: OR
114574+
permissions:
114575+
- security_monitoring_suppressions_read
114576+
- security_monitoring_rules_read
114577+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
114578+
/api/v2/security_monitoring/terraform/{resource_type}/{resource_id}:
114579+
get:
114580+
description: |-
114581+
Export a security monitoring resource to a Terraform configuration.
114582+
The `resource_type` path parameter specifies the type of resource to export
114583+
and must be one of `suppressions` or `critical_assets`.
114584+
operationId: ExportSecurityMonitoringTerraformResource
114585+
parameters:
114586+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
114587+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceId"
114588+
responses:
114589+
"200":
114590+
content:
114591+
application/json:
114592+
schema:
114593+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportResponse"
114594+
description: OK
114595+
"403":
114596+
$ref: "#/components/responses/NotAuthorizedResponse"
114597+
"404":
114598+
$ref: "#/components/responses/NotFoundResponse"
114599+
"429":
114600+
$ref: "#/components/responses/TooManyRequestsResponse"
114601+
security:
114602+
- apiKeyAuth: []
114603+
appKeyAuth: []
114604+
- AuthZ:
114605+
- security_monitoring_suppressions_read
114606+
- AuthZ:
114607+
- security_monitoring_rules_read
114608+
summary: Export security monitoring resource to Terraform
114609+
tags:
114610+
- Security Monitoring
114611+
"x-permission":
114612+
operator: OR
114613+
permissions:
114614+
- security_monitoring_suppressions_read
114615+
- security_monitoring_rules_read
114616+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
114340114617
/api/v2/sensitive-data-scanner/config:
114341114618
get:
114342114619
description: List all the Scanning groups in your organization.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-04-10T08:55:44.730Z

cassettes/features/v2/security_monitoring/Convert-security-monitoring-resource-to-Terraform-returns-OK-response.yml

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-04-10T08:56:17.310Z

cassettes/features/v2/security_monitoring/Export-security-monitoring-resource-to-Terraform-returns-OK-response.yml

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)