From b42b4fa6c1eb8eadaafc21047570d1e7dbbf0a1b Mon Sep 17 00:00:00 2001 From: stack72 Date: Thu, 26 Nov 2020 14:27:38 +0000 Subject: [PATCH] Upgrade to v2.17.0 of the DataDog Terraform Provider --- CHANGELOG.md | 2 +- .../cmd/pulumi-resource-datadog/schema.json | 158 +++++++++++++++- provider/go.mod | 3 +- provider/go.sum | 13 +- provider/resources.go | 99 +++------- sdk/dotnet/GetPermissions.cs | 61 ++++++ sdk/dotnet/GetRole.cs | 83 ++++++++ sdk/dotnet/Inputs/RolePermissionArgs.cs | 25 +++ sdk/dotnet/Inputs/RolePermissionGetArgs.cs | 25 +++ sdk/dotnet/Outputs/RolePermission.cs | 29 +++ sdk/dotnet/Role.cs | 174 +++++++++++++++++ sdk/dotnet/SyntheticsTest.cs | 2 +- sdk/go/datadog/getPermissions.go | 46 +++++ sdk/go/datadog/getRole.go | 55 ++++++ sdk/go/datadog/pulumiTypes.go | 102 ++++++++++ sdk/go/datadog/role.go | 177 ++++++++++++++++++ sdk/go/datadog/syntheticsTest.go | 2 +- sdk/nodejs/getPermissions.ts | 41 ++++ sdk/nodejs/getRole.ts | 53 ++++++ sdk/nodejs/index.ts | 3 + sdk/nodejs/role.ts | 146 +++++++++++++++ sdk/nodejs/syntheticsTest.ts | 2 +- sdk/nodejs/tsconfig.json | 3 + sdk/nodejs/types/input.ts | 5 + sdk/nodejs/types/output.ts | 5 + sdk/python/pulumi_datadog/__init__.py | 3 + sdk/python/pulumi_datadog/_inputs.py | 29 +++ sdk/python/pulumi_datadog/_tables.py | 2 + sdk/python/pulumi_datadog/get_permissions.py | 76 ++++++++ sdk/python/pulumi_datadog/get_role.py | 98 ++++++++++ sdk/python/pulumi_datadog/outputs.py | 24 +++ sdk/python/pulumi_datadog/role.py | 145 ++++++++++++++ sdk/python/pulumi_datadog/synthetics_test.py | 2 +- 33 files changed, 1602 insertions(+), 91 deletions(-) create mode 100644 sdk/dotnet/GetPermissions.cs create mode 100644 sdk/dotnet/GetRole.cs create mode 100644 sdk/dotnet/Inputs/RolePermissionArgs.cs create mode 100644 sdk/dotnet/Inputs/RolePermissionGetArgs.cs create mode 100644 sdk/dotnet/Outputs/RolePermission.cs create mode 100644 sdk/dotnet/Role.cs create mode 100644 sdk/go/datadog/getPermissions.go create mode 100644 sdk/go/datadog/getRole.go create mode 100644 sdk/go/datadog/role.go create mode 100644 sdk/nodejs/getPermissions.ts create mode 100644 sdk/nodejs/getRole.ts create mode 100644 sdk/nodejs/role.ts create mode 100644 sdk/python/pulumi_datadog/get_permissions.py create mode 100644 sdk/python/pulumi_datadog/get_role.py create mode 100644 sdk/python/pulumi_datadog/role.py diff --git a/CHANGELOG.md b/CHANGELOG.md index efd8d3e38..4fa225802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ CHANGELOG ========= ## HEAD (Unreleased) -_(none)_ +* Upgrade to v2.17.0 of the datadog Terraform Provider --- diff --git a/provider/cmd/pulumi-resource-datadog/schema.json b/provider/cmd/pulumi-resource-datadog/schema.json index 18831a888..8314ce396 100644 --- a/provider/cmd/pulumi-resource-datadog/schema.json +++ b/provider/cmd/pulumi-resource-datadog/schema.json @@ -28849,6 +28849,38 @@ }, "type": "object" }, + "datadog:index/RolePermission:RolePermission": { + "properties": { + "id": { + "type": "string", + "language": { + "python": { + "mapCase": false + } + } + }, + "name": { + "type": "string", + "language": { + "python": { + "mapCase": false + } + } + } + }, + "type": "object", + "required": [ + "id" + ], + "language": { + "nodejs": { + "requiredOutputs": [ + "id", + "name" + ] + } + } + }, "datadog:index/ScreenBoardTemplateVariable:ScreenBoardTemplateVariable": { "properties": { "default": { @@ -33168,6 +33200,67 @@ "type": "object" } }, + "datadog:index/role:Role": { + "description": "Provides a Datadog role resource. This can be used to create and manage Datadog roles.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst bar = datadog.getPermissions({});\n// Create a new Datadog role\nconst foo = new datadog.Role(\"foo\", {\n name: \"foo\",\n permissions: [\n {\n id: bar.then(bar =\u003e bar.permissions.monitorsDowntime),\n },\n {\n id: bar.then(bar =\u003e bar.permissions.monitorsWrite),\n },\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\nbar = datadog.get_permissions()\n# Create a new Datadog role\nfoo = datadog.Role(\"foo\",\n name=\"foo\",\n permissions=[\n datadog.RolePermissionArgs(\n id=bar.permissions[\"monitorsDowntime\"],\n ),\n datadog.RolePermissionArgs(\n id=bar.permissions[\"monitorsWrite\"],\n ),\n ])\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var bar = Output.Create(Datadog.GetPermissions.InvokeAsync());\n // Create a new Datadog role\n var foo = new Datadog.Role(\"foo\", new Datadog.RoleArgs\n {\n Name = \"foo\",\n Permissions = \n {\n new Datadog.Inputs.RolePermissionArgs\n {\n Id = bar.Apply(bar =\u003e bar.Permissions.MonitorsDowntime),\n },\n new Datadog.Inputs.RolePermissionArgs\n {\n Id = bar.Apply(bar =\u003e bar.Permissions.MonitorsWrite),\n },\n },\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tbar, err := datadog.GetPermissions(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = datadog.NewRole(ctx, \"foo\", \u0026datadog.RoleArgs{\n\t\t\tName: pulumi.String(\"foo\"),\n\t\t\tPermissions: datadog.RolePermissionArray{\n\t\t\t\t\u0026datadog.RolePermissionArgs{\n\t\t\t\t\tId: pulumi.String(bar.Permissions.MonitorsDowntime),\n\t\t\t\t},\n\t\t\t\t\u0026datadog.RolePermissionArgs{\n\t\t\t\t\tId: pulumi.String(bar.Permissions.MonitorsWrite),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nRoles can be imported using their ID, e.g.\n\n```sh\n $ pulumi import datadog:index/role:Role example_role 000000-0000-0000-0000-000000000000\n```\n\n ", + "properties": { + "name": { + "type": "string", + "description": "Name of the role.\n" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/types/datadog:index/RolePermission:RolePermission" + }, + "description": "Set of objects containing the permission ID and the name of the permissions granted to this role.\n" + }, + "userCount": { + "type": "integer", + "description": "Number of users that have this role.\n" + } + }, + "required": [ + "name", + "userCount" + ], + "inputProperties": { + "name": { + "type": "string", + "description": "Name of the role.\n" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/types/datadog:index/RolePermission:RolePermission" + }, + "description": "Set of objects containing the permission ID and the name of the permissions granted to this role.\n" + } + }, + "requiredInputs": [ + "name" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering Role resources.\n", + "properties": { + "name": { + "type": "string", + "description": "Name of the role.\n" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/types/datadog:index/RolePermission:RolePermission" + }, + "description": "Set of objects containing the permission ID and the name of the permissions granted to this role.\n" + }, + "userCount": { + "type": "integer", + "description": "Number of users that have this role.\n" + } + }, + "type": "object" + } + }, "datadog:index/screenBoard:ScreenBoard": { "description": "Provides a Datadog screenboard resource. This can be used to create and manage Datadog screenboards.\n\n\u003e **Note:** This resource is outdated. Use the new `datadog.Dashboard` resource instead.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\n// Create a new Datadog screenboard\nconst acceptanceTest = new datadog.ScreenBoard(\"acceptanceTest\", {\n title: \"Test Screenboard\",\n readOnly: true,\n templateVariables: [\n {\n name: \"varname 1\",\n prefix: \"pod_name\",\n \"default\": \"*\",\n },\n {\n name: \"varname 2\",\n prefix: \"service_name\",\n \"default\": \"autoscaling\",\n },\n ],\n widgets: [\n {\n type: \"free_text\",\n x: 5,\n y: 5,\n text: \"test text\",\n textAlign: \"right\",\n fontSize: \"36\",\n color: \"#ffc0cb\",\n },\n {\n type: \"timeseries\",\n x: 25,\n y: 5,\n title: \"graph title terraform\",\n titleSize: 16,\n titleAlign: \"right\",\n legend: true,\n legendSize: 16,\n time: {\n live_span: \"1d\",\n },\n tileDeves: [{\n viz: \"timeseries\",\n requests: [\n {\n q: \"avg:system.cpu.user{*}\",\n type: \"line\",\n style: {\n palette: \"purple\",\n type: \"dashed\",\n width: \"thin\",\n },\n metadataJson: JSON.stringify({\n \"avg:system.cpu.user{*}\": {\n alias: \"CPU Usage\",\n },\n }),\n },\n {\n logQuery: {\n index: \"mcnulty\",\n compute: {\n aggregation: \"avg\",\n facet: \"@duration\",\n interval: 5000,\n },\n search: {\n query: \"status:info\",\n },\n groupBies: [{\n facet: \"host\",\n limit: 10,\n sort: {\n aggregation: \"avg\",\n order: \"desc\",\n facet: \"@duration\",\n },\n }],\n },\n type: \"area\",\n },\n {\n apmQuery: {\n index: \"apm-search\",\n compute: {\n aggregation: \"avg\",\n facet: \"@duration\",\n interval: 5000,\n },\n search: {\n query: \"type:web\",\n },\n groupBies: [{\n facet: \"resource_name\",\n limit: 50,\n sort: {\n aggregation: \"avg\",\n order: \"desc\",\n facet: \"@string_query.interval\",\n },\n }],\n },\n type: \"bars\",\n },\n {\n processQuery: {\n metric: \"process.stat.cpu.total_pct\",\n searchBy: \"error\",\n filterBies: [\"active\"],\n limit: 50,\n },\n type: \"area\",\n },\n ],\n markers: [{\n label: \"test marker\",\n type: \"error dashed\",\n value: \"y \u003c 6\",\n }],\n events: [{\n q: \"test event\",\n }],\n }],\n },\n {\n type: \"query_value\",\n x: 45,\n y: 25,\n title: \"query value title terraform\",\n titleSize: 20,\n titleAlign: \"center\",\n legend: true,\n legendSize: 16,\n tileDeves: [{\n viz: \"query_value\",\n requests: [{\n q: \"avg:system.cpu.user{*}\",\n type: \"line\",\n style: {\n palette: \"purple\",\n type: \"dashed\",\n width: \"thin\",\n },\n conditionalFormats: [\n {\n comparator: \"\u003e\",\n value: \"1\",\n palette: \"white_on_red\",\n },\n {\n comparator: \"\u003e=\",\n value: \"2\",\n palette: \"white_on_yellow\",\n },\n ],\n aggregator: \"max\",\n }],\n customUnit: \"%\",\n autoscale: false,\n precision: \"6\",\n textAlign: \"right\",\n }],\n },\n {\n type: \"toplist\",\n x: 65,\n y: 5,\n title: \"toplist title terraform\",\n legend: true,\n legendSize: \"auto\",\n time: {\n live_span: \"1d\",\n },\n tileDeves: [{\n viz: \"toplist\",\n requests: [{\n q: \"top(avg:system.load.1{*} by {host}, 10, 'mean', 'desc')\",\n style: {\n palette: \"purple\",\n type: \"dashed\",\n width: \"thin\",\n },\n conditionalFormats: [{\n comparator: \"\u003e\",\n value: \"4\",\n palette: \"white_on_green\",\n }],\n }],\n }],\n },\n {\n type: \"change\",\n x: 85,\n y: 5,\n title: \"change title terraform\",\n tileDeves: [{\n viz: \"change\",\n requests: [{\n q: \"min:system.load.1{*} by {host}\",\n compareTo: \"week_before\",\n changeType: \"relative\",\n orderBy: \"present\",\n orderDir: \"asc\",\n extraCol: \"\",\n increaseGood: false,\n }],\n }],\n },\n {\n type: \"event_timeline\",\n x: 105,\n y: 5,\n title: \"event_timeline title terraform\",\n query: \"status:error\",\n time: {\n live_span: \"1d\",\n },\n },\n {\n type: \"event_stream\",\n x: 115,\n y: 5,\n title: \"event_stream title terraform\",\n query: \"*\",\n eventSize: \"l\",\n time: {\n live_span: \"4h\",\n },\n },\n {\n type: \"image\",\n x: 145,\n y: 5,\n title: \"image title terraform\",\n sizing: \"fit\",\n margin: \"large\",\n url: \"https://datadog-prod.imgix.net/img/dd_logo_70x75.png\",\n },\n {\n type: \"note\",\n x: 165,\n y: 5,\n bgcolor: \"pink\",\n textAlign: \"right\",\n fontSize: \"36\",\n tick: true,\n tickEdge: \"bottom\",\n tickPos: `50%`,\n html: \"\u003cb\u003etest note\u003c/b\u003e\",\n },\n {\n type: \"alert_graph\",\n x: 185,\n y: 5,\n title: \"alert graph title terraform\",\n alertId: \"123456\",\n vizType: \"toplist\",\n time: {\n live_span: \"15m\",\n },\n },\n {\n type: \"alert_value\",\n x: 205,\n y: 5,\n title: \"alert value title terraform\",\n alertId: \"123456\",\n textSize: \"fill_height\",\n textAlign: \"right\",\n precision: \"*\",\n unit: \"b\",\n },\n {\n type: \"iframe\",\n x: 225,\n y: 5,\n url: \"https://www.datadoghq.org\",\n },\n {\n type: \"check_status\",\n x: 245,\n y: 5,\n title: \"test title\",\n titleAlign: \"left\",\n grouping: \"check\",\n check: \"aws.ecs.agent_connected\",\n tags: [\"*\"],\n group: \"cluster:test\",\n time: {\n live_span: \"30m\",\n },\n },\n {\n type: \"trace_service\",\n x: 265,\n y: 5,\n env: \"testEnv\",\n serviceService: \"\",\n serviceName: \"\",\n sizeVersion: \"large\",\n layoutVersion: \"three_column\",\n mustShowHits: true,\n mustShowErrors: true,\n mustShowLatency: true,\n mustShowBreakdown: true,\n mustShowDistribution: true,\n mustShowResourceList: true,\n time: {\n live_span: \"30m\",\n },\n },\n {\n type: \"hostmap\",\n x: 285,\n y: 5,\n query: \"avg:system.load.1{*} by {host}\",\n tileDeves: [{\n viz: \"hostmap\",\n nodeType: \"container\",\n scopes: [\"datacenter:test\"],\n groups: [\"pod_name\"],\n noGroupHosts: false,\n noMetricHosts: false,\n requests: [{\n q: \"max:process.stat.container.io.wbps{datacenter:test} by {host}\",\n type: \"fill\",\n }],\n style: {\n palette: \"hostmap_blues\",\n palette_flip: true,\n fill_min: 20,\n fill_max: 300,\n },\n }],\n },\n {\n type: \"manage_status\",\n x: 305,\n y: 5,\n summaryType: \"monitors\",\n displayFormat: \"countsAndList\",\n colorPreference: \"background\",\n hideZeroCounts: true,\n showLastTriggered: false,\n manageStatusShowTitle: false,\n manageStatusTitleText: \"test title\",\n manageStatusTitleSize: \"20\",\n manageStatusTitleAlign: \"right\",\n params: {\n sort: \"status,asc\",\n text: \"status:alert\",\n },\n },\n {\n type: \"log_stream\",\n x: 325,\n y: 5,\n query: \"source:kubernetes\",\n columns: \"[\\\"column1\\\",\\\"column2\\\",\\\"column3\\\"]\",\n logset: \"1234\",\n time: {\n live_span: \"1h\",\n },\n },\n {\n type: \"process\",\n x: 365,\n y: 5,\n tileDeves: [{\n viz: \"process\",\n requests: [{\n queryType: \"process\",\n metric: \"process.stat.cpu.total_pct\",\n textFilter: \"\",\n tagFilters: [],\n limit: 200,\n style: {\n palette: \"dog_classic_area\",\n },\n }],\n }],\n },\n ],\n});\n```\n```python\nimport pulumi\nimport json\nimport pulumi_datadog as datadog\n\n# Create a new Datadog screenboard\nacceptance_test = datadog.ScreenBoard(\"acceptanceTest\",\n title=\"Test Screenboard\",\n read_only=True,\n template_variables=[\n datadog.ScreenBoardTemplateVariableArgs(\n name=\"varname 1\",\n prefix=\"pod_name\",\n default=\"*\",\n ),\n datadog.ScreenBoardTemplateVariableArgs(\n name=\"varname 2\",\n prefix=\"service_name\",\n default=\"autoscaling\",\n ),\n ],\n widgets=[\n datadog.ScreenBoardWidgetArgs(\n type=\"free_text\",\n x=5,\n y=5,\n text=\"test text\",\n text_align=\"right\",\n font_size=\"36\",\n color=\"#ffc0cb\",\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"timeseries\",\n x=25,\n y=5,\n title=\"graph title terraform\",\n title_size=16,\n title_align=\"right\",\n legend=True,\n legend_size=\"16\",\n time={\n \"live_span\": \"1d\",\n },\n tile_deves=[datadog.ScreenBoardWidgetTileDefArgs(\n viz=\"timeseries\",\n requests=[\n datadog.ScreenBoardWidgetTileDefRequestArgs(\n q=\"avg:system.cpu.user{*}\",\n type=\"line\",\n style={\n \"palette\": \"purple\",\n \"type\": \"dashed\",\n \"width\": \"thin\",\n },\n metadata_json=json.dumps({\n \"avg:system.cpu.user{*}\": {\n \"alias\": \"CPU Usage\",\n },\n }),\n ),\n datadog.ScreenBoardWidgetTileDefRequestArgs(\n log_query=datadog.ScreenBoardWidgetTileDefRequestLogQueryArgs(\n index=\"mcnulty\",\n compute=datadog.ScreenBoardWidgetTileDefRequestLogQueryComputeArgs(\n aggregation=\"avg\",\n facet=\"@duration\",\n interval=\"5000\",\n ),\n search=datadog.ScreenBoardWidgetTileDefRequestLogQuerySearchArgs(\n query=\"status:info\",\n ),\n group_bies=[datadog.ScreenBoardWidgetTileDefRequestLogQueryGroupByArgs(\n facet=\"host\",\n limit=10,\n sort=datadog.ScreenBoardWidgetTileDefRequestLogQueryGroupBySortArgs(\n aggregation=\"avg\",\n order=\"desc\",\n facet=\"@duration\",\n ),\n )],\n ),\n type=\"area\",\n ),\n datadog.ScreenBoardWidgetTileDefRequestArgs(\n apm_query=datadog.ScreenBoardWidgetTileDefRequestApmQueryArgs(\n index=\"apm-search\",\n compute=datadog.ScreenBoardWidgetTileDefRequestApmQueryComputeArgs(\n aggregation=\"avg\",\n facet=\"@duration\",\n interval=\"5000\",\n ),\n search=datadog.ScreenBoardWidgetTileDefRequestApmQuerySearchArgs(\n query=\"type:web\",\n ),\n group_bies=[datadog.ScreenBoardWidgetTileDefRequestApmQueryGroupByArgs(\n facet=\"resource_name\",\n limit=50,\n sort=datadog.ScreenBoardWidgetTileDefRequestApmQueryGroupBySortArgs(\n aggregation=\"avg\",\n order=\"desc\",\n facet=\"@string_query.interval\",\n ),\n )],\n ),\n type=\"bars\",\n ),\n datadog.ScreenBoardWidgetTileDefRequestArgs(\n process_query=datadog.ScreenBoardWidgetTileDefRequestProcessQueryArgs(\n metric=\"process.stat.cpu.total_pct\",\n search_by=\"error\",\n filter_bies=[\"active\"],\n limit=50,\n ),\n type=\"area\",\n ),\n ],\n markers=[datadog.ScreenBoardWidgetTileDefMarkerArgs(\n label=\"test marker\",\n type=\"error dashed\",\n value=\"y \u003c 6\",\n )],\n events=[datadog.ScreenBoardWidgetTileDefEventArgs(\n q=\"test event\",\n )],\n )],\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"query_value\",\n x=45,\n y=25,\n title=\"query value title terraform\",\n title_size=20,\n title_align=\"center\",\n legend=True,\n legend_size=\"16\",\n tile_deves=[datadog.ScreenBoardWidgetTileDefArgs(\n viz=\"query_value\",\n requests=[datadog.ScreenBoardWidgetTileDefRequestArgs(\n q=\"avg:system.cpu.user{*}\",\n type=\"line\",\n style={\n \"palette\": \"purple\",\n \"type\": \"dashed\",\n \"width\": \"thin\",\n },\n conditional_formats=[\n datadog.ScreenBoardWidgetTileDefRequestConditionalFormatArgs(\n comparator=\"\u003e\",\n value=\"1\",\n palette=\"white_on_red\",\n ),\n datadog.ScreenBoardWidgetTileDefRequestConditionalFormatArgs(\n comparator=\"\u003e=\",\n value=\"2\",\n palette=\"white_on_yellow\",\n ),\n ],\n aggregator=\"max\",\n )],\n custom_unit=\"%\",\n autoscale=False,\n precision=\"6\",\n text_align=\"right\",\n )],\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"toplist\",\n x=65,\n y=5,\n title=\"toplist title terraform\",\n legend=True,\n legend_size=\"auto\",\n time={\n \"live_span\": \"1d\",\n },\n tile_deves=[datadog.ScreenBoardWidgetTileDefArgs(\n viz=\"toplist\",\n requests=[datadog.ScreenBoardWidgetTileDefRequestArgs(\n q=\"top(avg:system.load.1{*} by {host}, 10, 'mean', 'desc')\",\n style={\n \"palette\": \"purple\",\n \"type\": \"dashed\",\n \"width\": \"thin\",\n },\n conditional_formats=[datadog.ScreenBoardWidgetTileDefRequestConditionalFormatArgs(\n comparator=\"\u003e\",\n value=\"4\",\n palette=\"white_on_green\",\n )],\n )],\n )],\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"change\",\n x=85,\n y=5,\n title=\"change title terraform\",\n tile_deves=[datadog.ScreenBoardWidgetTileDefArgs(\n viz=\"change\",\n requests=[datadog.ScreenBoardWidgetTileDefRequestArgs(\n q=\"min:system.load.1{*} by {host}\",\n compare_to=\"week_before\",\n change_type=\"relative\",\n order_by=\"present\",\n order_dir=\"asc\",\n extra_col=\"\",\n increase_good=False,\n )],\n )],\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"event_timeline\",\n x=105,\n y=5,\n title=\"event_timeline title terraform\",\n query=\"status:error\",\n time={\n \"live_span\": \"1d\",\n },\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"event_stream\",\n x=115,\n y=5,\n title=\"event_stream title terraform\",\n query=\"*\",\n event_size=\"l\",\n time={\n \"live_span\": \"4h\",\n },\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"image\",\n x=145,\n y=5,\n title=\"image title terraform\",\n sizing=\"fit\",\n margin=\"large\",\n url=\"https://datadog-prod.imgix.net/img/dd_logo_70x75.png\",\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"note\",\n x=165,\n y=5,\n bgcolor=\"pink\",\n text_align=\"right\",\n font_size=\"36\",\n tick=True,\n tick_edge=\"bottom\",\n tick_pos=\"50%\",\n html=\"\u003cb\u003etest note\u003c/b\u003e\",\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"alert_graph\",\n x=185,\n y=5,\n title=\"alert graph title terraform\",\n alert_id=123456,\n viz_type=\"toplist\",\n time={\n \"live_span\": \"15m\",\n },\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"alert_value\",\n x=205,\n y=5,\n title=\"alert value title terraform\",\n alert_id=123456,\n text_size=\"fill_height\",\n text_align=\"right\",\n precision=\"*\",\n unit=\"b\",\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"iframe\",\n x=225,\n y=5,\n url=\"https://www.datadoghq.org\",\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"check_status\",\n x=245,\n y=5,\n title=\"test title\",\n title_align=\"left\",\n grouping=\"check\",\n check=\"aws.ecs.agent_connected\",\n tags=[\"*\"],\n group=\"cluster:test\",\n time={\n \"live_span\": \"30m\",\n },\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"trace_service\",\n x=265,\n y=5,\n env=\"testEnv\",\n service_service=\"\",\n service_name=\"\",\n size_version=\"large\",\n layout_version=\"three_column\",\n must_show_hits=True,\n must_show_errors=True,\n must_show_latency=True,\n must_show_breakdown=True,\n must_show_distribution=True,\n must_show_resource_list=True,\n time={\n \"live_span\": \"30m\",\n },\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"hostmap\",\n x=285,\n y=5,\n query=\"avg:system.load.1{*} by {host}\",\n tile_deves=[datadog.ScreenBoardWidgetTileDefArgs(\n viz=\"hostmap\",\n node_type=\"container\",\n scopes=[\"datacenter:test\"],\n groups=[\"pod_name\"],\n no_group_hosts=False,\n no_metric_hosts=False,\n requests=[datadog.ScreenBoardWidgetTileDefRequestArgs(\n q=\"max:process.stat.container.io.wbps{datacenter:test} by {host}\",\n type=\"fill\",\n )],\n style={\n \"palette\": \"hostmap_blues\",\n \"palette_flip\": True,\n \"fill_min\": 20,\n \"fill_max\": 300,\n },\n )],\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"manage_status\",\n x=305,\n y=5,\n summary_type=\"monitors\",\n display_format=\"countsAndList\",\n color_preference=\"background\",\n hide_zero_counts=True,\n show_last_triggered=False,\n manage_status_show_title=False,\n manage_status_title_text=\"test title\",\n manage_status_title_size=\"20\",\n manage_status_title_align=\"right\",\n params={\n \"sort\": \"status,asc\",\n \"text\": \"status:alert\",\n },\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"log_stream\",\n x=325,\n y=5,\n query=\"source:kubernetes\",\n columns=\"[\\\"column1\\\",\\\"column2\\\",\\\"column3\\\"]\",\n logset=\"1234\",\n time={\n \"live_span\": \"1h\",\n },\n ),\n datadog.ScreenBoardWidgetArgs(\n type=\"process\",\n x=365,\n y=5,\n tile_deves=[datadog.ScreenBoardWidgetTileDefArgs(\n viz=\"process\",\n requests=[datadog.ScreenBoardWidgetTileDefRequestArgs(\n query_type=\"process\",\n metric=\"process.stat.cpu.total_pct\",\n text_filter=\"\",\n tag_filters=[],\n limit=200,\n style={\n \"palette\": \"dog_classic_area\",\n },\n )],\n )],\n ),\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Text.Json;\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n // Create a new Datadog screenboard\n var acceptanceTest = new Datadog.ScreenBoard(\"acceptanceTest\", new Datadog.ScreenBoardArgs\n {\n Title = \"Test Screenboard\",\n ReadOnly = true,\n TemplateVariables = \n {\n new Datadog.Inputs.ScreenBoardTemplateVariableArgs\n {\n Name = \"varname 1\",\n Prefix = \"pod_name\",\n Default = \"*\",\n },\n new Datadog.Inputs.ScreenBoardTemplateVariableArgs\n {\n Name = \"varname 2\",\n Prefix = \"service_name\",\n Default = \"autoscaling\",\n },\n },\n Widgets = \n {\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"free_text\",\n X = 5,\n Y = 5,\n Text = \"test text\",\n TextAlign = \"right\",\n FontSize = \"36\",\n Color = \"#ffc0cb\",\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"timeseries\",\n X = 25,\n Y = 5,\n Title = \"graph title terraform\",\n TitleSize = 16,\n TitleAlign = \"right\",\n Legend = true,\n LegendSize = \"16\",\n Time = \n {\n { \"live_span\", \"1d\" },\n },\n TileDeves = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefArgs\n {\n Viz = \"timeseries\",\n Requests = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n Q = \"avg:system.cpu.user{*}\",\n Type = \"line\",\n Style = \n {\n { \"palette\", \"purple\" },\n { \"type\", \"dashed\" },\n { \"width\", \"thin\" },\n },\n MetadataJson = JsonSerializer.Serialize(new Dictionary\u003cstring, object?\u003e\n {\n { \"avg:system.cpu.user{*}\", new Dictionary\u003cstring, object?\u003e\n {\n { \"alias\", \"CPU Usage\" },\n } },\n }),\n },\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n LogQuery = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestLogQueryArgs\n {\n Index = \"mcnulty\",\n Compute = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestLogQueryComputeArgs\n {\n Aggregation = \"avg\",\n Facet = \"@duration\",\n Interval = \"5000\",\n },\n Search = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestLogQuerySearchArgs\n {\n Query = \"status:info\",\n },\n GroupBies = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestLogQueryGroupByArgs\n {\n Facet = \"host\",\n Limit = 10,\n Sort = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestLogQueryGroupBySortArgs\n {\n Aggregation = \"avg\",\n Order = \"desc\",\n Facet = \"@duration\",\n },\n },\n },\n },\n Type = \"area\",\n },\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n ApmQuery = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestApmQueryArgs\n {\n Index = \"apm-search\",\n Compute = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestApmQueryComputeArgs\n {\n Aggregation = \"avg\",\n Facet = \"@duration\",\n Interval = \"5000\",\n },\n Search = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestApmQuerySearchArgs\n {\n Query = \"type:web\",\n },\n GroupBies = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestApmQueryGroupByArgs\n {\n Facet = \"resource_name\",\n Limit = 50,\n Sort = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestApmQueryGroupBySortArgs\n {\n Aggregation = \"avg\",\n Order = \"desc\",\n Facet = \"@string_query.interval\",\n },\n },\n },\n },\n Type = \"bars\",\n },\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n ProcessQuery = new Datadog.Inputs.ScreenBoardWidgetTileDefRequestProcessQueryArgs\n {\n Metric = \"process.stat.cpu.total_pct\",\n SearchBy = \"error\",\n FilterBies = \n {\n \"active\",\n },\n Limit = 50,\n },\n Type = \"area\",\n },\n },\n Markers = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefMarkerArgs\n {\n Label = \"test marker\",\n Type = \"error dashed\",\n Value = \"y \u003c 6\",\n },\n },\n Events = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefEventArgs\n {\n Q = \"test event\",\n },\n },\n },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"query_value\",\n X = 45,\n Y = 25,\n Title = \"query value title terraform\",\n TitleSize = 20,\n TitleAlign = \"center\",\n Legend = true,\n LegendSize = \"16\",\n TileDeves = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefArgs\n {\n Viz = \"query_value\",\n Requests = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n Q = \"avg:system.cpu.user{*}\",\n Type = \"line\",\n Style = \n {\n { \"palette\", \"purple\" },\n { \"type\", \"dashed\" },\n { \"width\", \"thin\" },\n },\n ConditionalFormats = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestConditionalFormatArgs\n {\n Comparator = \"\u003e\",\n Value = \"1\",\n Palette = \"white_on_red\",\n },\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestConditionalFormatArgs\n {\n Comparator = \"\u003e=\",\n Value = \"2\",\n Palette = \"white_on_yellow\",\n },\n },\n Aggregator = \"max\",\n },\n },\n CustomUnit = \"%\",\n Autoscale = false,\n Precision = \"6\",\n TextAlign = \"right\",\n },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"toplist\",\n X = 65,\n Y = 5,\n Title = \"toplist title terraform\",\n Legend = true,\n LegendSize = \"auto\",\n Time = \n {\n { \"live_span\", \"1d\" },\n },\n TileDeves = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefArgs\n {\n Viz = \"toplist\",\n Requests = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n Q = \"top(avg:system.load.1{*} by {host}, 10, 'mean', 'desc')\",\n Style = \n {\n { \"palette\", \"purple\" },\n { \"type\", \"dashed\" },\n { \"width\", \"thin\" },\n },\n ConditionalFormats = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestConditionalFormatArgs\n {\n Comparator = \"\u003e\",\n Value = \"4\",\n Palette = \"white_on_green\",\n },\n },\n },\n },\n },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"change\",\n X = 85,\n Y = 5,\n Title = \"change title terraform\",\n TileDeves = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefArgs\n {\n Viz = \"change\",\n Requests = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n Q = \"min:system.load.1{*} by {host}\",\n CompareTo = \"week_before\",\n ChangeType = \"relative\",\n OrderBy = \"present\",\n OrderDir = \"asc\",\n ExtraCol = \"\",\n IncreaseGood = false,\n },\n },\n },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"event_timeline\",\n X = 105,\n Y = 5,\n Title = \"event_timeline title terraform\",\n Query = \"status:error\",\n Time = \n {\n { \"live_span\", \"1d\" },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"event_stream\",\n X = 115,\n Y = 5,\n Title = \"event_stream title terraform\",\n Query = \"*\",\n EventSize = \"l\",\n Time = \n {\n { \"live_span\", \"4h\" },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"image\",\n X = 145,\n Y = 5,\n Title = \"image title terraform\",\n Sizing = \"fit\",\n Margin = \"large\",\n Url = \"https://datadog-prod.imgix.net/img/dd_logo_70x75.png\",\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"note\",\n X = 165,\n Y = 5,\n Bgcolor = \"pink\",\n TextAlign = \"right\",\n FontSize = \"36\",\n Tick = true,\n TickEdge = \"bottom\",\n TickPos = \"50%\",\n Html = \"\u003cb\u003etest note\u003c/b\u003e\",\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"alert_graph\",\n X = 185,\n Y = 5,\n Title = \"alert graph title terraform\",\n AlertId = 123456,\n VizType = \"toplist\",\n Time = \n {\n { \"live_span\", \"15m\" },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"alert_value\",\n X = 205,\n Y = 5,\n Title = \"alert value title terraform\",\n AlertId = 123456,\n TextSize = \"fill_height\",\n TextAlign = \"right\",\n Precision = \"*\",\n Unit = \"b\",\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"iframe\",\n X = 225,\n Y = 5,\n Url = \"https://www.datadoghq.org\",\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"check_status\",\n X = 245,\n Y = 5,\n Title = \"test title\",\n TitleAlign = \"left\",\n Grouping = \"check\",\n Check = \"aws.ecs.agent_connected\",\n Tags = \n {\n \"*\",\n },\n Group = \"cluster:test\",\n Time = \n {\n { \"live_span\", \"30m\" },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"trace_service\",\n X = 265,\n Y = 5,\n Env = \"testEnv\",\n ServiceService = \"\",\n ServiceName = \"\",\n SizeVersion = \"large\",\n LayoutVersion = \"three_column\",\n MustShowHits = true,\n MustShowErrors = true,\n MustShowLatency = true,\n MustShowBreakdown = true,\n MustShowDistribution = true,\n MustShowResourceList = true,\n Time = \n {\n { \"live_span\", \"30m\" },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"hostmap\",\n X = 285,\n Y = 5,\n Query = \"avg:system.load.1{*} by {host}\",\n TileDeves = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefArgs\n {\n Viz = \"hostmap\",\n NodeType = \"container\",\n Scopes = \n {\n \"datacenter:test\",\n },\n Groups = \n {\n \"pod_name\",\n },\n NoGroupHosts = false,\n NoMetricHosts = false,\n Requests = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n Q = \"max:process.stat.container.io.wbps{datacenter:test} by {host}\",\n Type = \"fill\",\n },\n },\n Style = \n {\n { \"palette\", \"hostmap_blues\" },\n { \"palette_flip\", true },\n { \"fill_min\", 20 },\n { \"fill_max\", 300 },\n },\n },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"manage_status\",\n X = 305,\n Y = 5,\n SummaryType = \"monitors\",\n DisplayFormat = \"countsAndList\",\n ColorPreference = \"background\",\n HideZeroCounts = true,\n ShowLastTriggered = false,\n ManageStatusShowTitle = false,\n ManageStatusTitleText = \"test title\",\n ManageStatusTitleSize = \"20\",\n ManageStatusTitleAlign = \"right\",\n Params = \n {\n { \"sort\", \"status,asc\" },\n { \"text\", \"status:alert\" },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"log_stream\",\n X = 325,\n Y = 5,\n Query = \"source:kubernetes\",\n Columns = \"[\\\"column1\\\",\\\"column2\\\",\\\"column3\\\"]\",\n Logset = \"1234\",\n Time = \n {\n { \"live_span\", \"1h\" },\n },\n },\n new Datadog.Inputs.ScreenBoardWidgetArgs\n {\n Type = \"process\",\n X = 365,\n Y = 5,\n TileDeves = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefArgs\n {\n Viz = \"process\",\n Requests = \n {\n new Datadog.Inputs.ScreenBoardWidgetTileDefRequestArgs\n {\n QueryType = \"process\",\n Metric = \"process.stat.cpu.total_pct\",\n TextFilter = \"\",\n TagFilters = {},\n Limit = 200,\n Style = \n {\n { \"palette\", \"dog_classic_area\" },\n },\n },\n },\n },\n },\n },\n },\n });\n }\n\n}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nscreenboards can be imported using their numeric ID, e.g.\n\n```sh\n $ pulumi import datadog:index/screenBoard:ScreenBoard my_service_screenboard 2081\n```\n\n ", "properties": { @@ -33507,7 +33600,7 @@ } }, "datadog:index/syntheticsTest:SyntheticsTest": { - "description": "Provides a Datadog synthetics test resource. This can be used to create and manage Datadog synthetics test.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Synthetics API Test)\n\nCreate a new Datadog Synthetics API/HTTP test on https://www.example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testApi = new datadog.SyntheticsTest(\"test_api\", {\n assertions: [{\n operator: \"is\",\n target: \"200\",\n type: \"statusCode\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n monitorOptions: {\n renotifyInterval: 100,\n },\n retry: {\n count: 2,\n interval: 300,\n },\n tickEvery: 900,\n },\n request: {\n method: \"GET\",\n url: \"https://www.example.org\",\n },\n requestHeaders: {\n Authentication: \"Token: 1234566789\",\n \"Content-Type\": \"application/json\",\n },\n status: \"live\",\n subtype: \"http\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_api = datadog.SyntheticsTest(\"testApi\",\n assertions=[{\n \"operator\": \"is\",\n \"target\": \"200\",\n \"type\": \"statusCode\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n monitor_options=datadog.SyntheticsTestOptionsListMonitorOptionsArgs(\n renotify_interval=100,\n ),\n retry=datadog.SyntheticsTestOptionsListRetryArgs(\n count=2,\n interval=300,\n ),\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n method=\"GET\",\n url=\"https://www.example.org\",\n ),\n request_headers={\n \"Authentication\": \"Token: 1234566789\",\n \"Content-Type\": \"application/json\",\n },\n status=\"live\",\n subtype=\"http\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testApi = new Datadog.SyntheticsTest(\"testApi\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"target\", \"200\" },\n { \"type\", \"statusCode\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n MonitorOptions = new Datadog.Inputs.SyntheticsTestOptionsListMonitorOptionsArgs\n {\n RenotifyInterval = 100,\n },\n Retry = new Datadog.Inputs.SyntheticsTestOptionsListRetryArgs\n {\n Count = 2,\n Interval = 300,\n },\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Method = \"GET\",\n Url = \"https://www.example.org\",\n },\n RequestHeaders = \n {\n { \"Authentication\", \"Token: 1234566789\" },\n { \"Content-Type\", \"application/json\" },\n },\n Status = \"live\",\n Subtype = \"http\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testApi\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"target\": pulumi.String(\"200\"),\n\t\t\t\t\t\"type\": pulumi.String(\"statusCode\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tMonitorOptions: \u0026datadog.SyntheticsTestOptionsListMonitorOptionsArgs{\n\t\t\t\t\tRenotifyInterval: pulumi.Int(100),\n\t\t\t\t},\n\t\t\t\tRetry: \u0026datadog.SyntheticsTestOptionsListRetryArgs{\n\t\t\t\t\tCount: pulumi.Int(2),\n\t\t\t\t\tInterval: pulumi.Int(300),\n\t\t\t\t},\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tMethod: pulumi.String(\"GET\"),\n\t\t\t\tUrl: pulumi.String(\"https://www.example.org\"),\n\t\t\t},\n\t\t\tRequestHeaders: pulumi.StringMap{\n\t\t\t\t\"Authentication\": pulumi.String(\"Token: 1234566789\"),\n\t\t\t\t\"Content-Type\": pulumi.String(\"application/json\"),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"http\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics SSL Test)\n\nCreate a new Datadog Synthetics API/SSL test on example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testSsl = new datadog.SyntheticsTest(\"test_ssl\", {\n assertions: [{\n operator: \"isInMoreThan\",\n target: \"30\",\n type: \"certificate\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n acceptSelfSigned: true,\n tickEvery: 900,\n },\n request: {\n host: \"example.org\",\n port: 443,\n },\n status: \"live\",\n subtype: \"ssl\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_ssl = datadog.SyntheticsTest(\"testSsl\",\n assertions=[{\n \"operator\": \"isInMoreThan\",\n \"target\": 30,\n \"type\": \"certificate\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n accept_self_signed=True,\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n host=\"example.org\",\n port=443,\n ),\n status=\"live\",\n subtype=\"ssl\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testSsl = new Datadog.SyntheticsTest(\"testSsl\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"isInMoreThan\" },\n { \"target\", 30 },\n { \"type\", \"certificate\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n AcceptSelfSigned = true,\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Host = \"example.org\",\n Port = 443,\n },\n Status = \"live\",\n Subtype = \"ssl\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testSsl\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.MapArray{\n\t\t\t\tpulumi.Map{\n\t\t\t\t\t\"operator\": pulumi.String(\"isInMoreThan\"),\n\t\t\t\t\t\"target\": pulumi.Float64(30),\n\t\t\t\t\t\"type\": pulumi.String(\"certificate\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tAcceptSelfSigned: pulumi.Bool(true),\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tHost: pulumi.String(\"example.org\"),\n\t\t\t\tPort: pulumi.Int(443),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"ssl\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics TCP Test)\n\nCreate a new Datadog Synthetics API/TCP test on example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testTcp = new datadog.SyntheticsTest(\"test_tcp\", {\n assertions: [{\n operator: \"lessThan\",\n target: \"2000\",\n type: \"responseTime\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n tickEvery: 900,\n },\n request: {\n host: \"example.org\",\n port: 443,\n },\n status: \"live\",\n subtype: \"tcp\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_tcp = datadog.SyntheticsTest(\"testTcp\",\n assertions=[{\n \"operator\": \"lessThan\",\n \"target\": 2000,\n \"type\": \"responseTime\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n host=\"example.org\",\n port=443,\n ),\n status=\"live\",\n subtype=\"tcp\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testTcp = new Datadog.SyntheticsTest(\"testTcp\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"lessThan\" },\n { \"target\", 2000 },\n { \"type\", \"responseTime\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Host = \"example.org\",\n Port = 443,\n },\n Status = \"live\",\n Subtype = \"tcp\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testTcp\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.MapArray{\n\t\t\t\tpulumi.Map{\n\t\t\t\t\t\"operator\": pulumi.String(\"lessThan\"),\n\t\t\t\t\t\"target\": pulumi.Float64(2000),\n\t\t\t\t\t\"type\": pulumi.String(\"responseTime\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tHost: pulumi.String(\"example.org\"),\n\t\t\t\tPort: pulumi.Int(443),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"tcp\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics DNS Test)\n\nCreate a new Datadog Synthetics API/DNS test on example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testTcp = new datadog.SyntheticsTest(\"test_tcp\", {\n assertions: [{\n operator: \"is\",\n property: \"A\",\n target: \"0.0.0.0\",\n type: \"recordSome\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n tickEvery: 900,\n },\n request: {\n host: \"example.org\",\n },\n status: \"live\",\n subtype: \"dns\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_tcp = datadog.SyntheticsTest(\"testTcp\",\n assertions=[{\n \"operator\": \"is\",\n \"property\": \"A\",\n \"target\": \"0.0.0.0\",\n \"type\": \"recordSome\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n host=\"example.org\",\n ),\n status=\"live\",\n subtype=\"dns\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testTcp = new Datadog.SyntheticsTest(\"testTcp\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"property\", \"A\" },\n { \"target\", \"0.0.0.0\" },\n { \"type\", \"recordSome\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Host = \"example.org\",\n },\n Status = \"live\",\n Subtype = \"dns\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testTcp\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"property\": pulumi.String(\"A\"),\n\t\t\t\t\t\"target\": pulumi.String(\"0.0.0.0\"),\n\t\t\t\t\t\"type\": pulumi.String(\"recordSome\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tHost: pulumi.String(\"example.org\"),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"dns\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics Browser Test)\n\nSupport for Synthetics Browser test steps is limited (see below)\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\n// Create a new Datadog Synthetics Browser test starting on https://www.example.org\nconst testBrowser = new datadog.SyntheticsTest(\"testBrowser\", {\n type: \"browser\",\n request: {\n method: \"GET\",\n url: \"https://app.datadoghq.com\",\n },\n deviceIds: [\"laptop_large\"],\n locations: [\"aws:eu-central-1\"],\n optionsList: {\n tickEvery: 3600,\n },\n name: \"A Browser test on example.org\",\n message: \"Notify @qa\",\n tags: [],\n status: \"paused\",\n steps: [{\n name: \"Check current url\",\n type: \"assertCurrentUrl\",\n params: JSON.stringify({\n check: \"contains\",\n value: \"datadoghq\",\n }),\n }],\n variables: [\n {\n type: \"text\",\n name: \"MY_PATTERN_VAR\",\n pattern: \"{{numeric(3)}}\",\n example: \"597\",\n },\n {\n type: \"email\",\n name: \"MY_EMAIL_VAR\",\n pattern: \"jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co\",\n example: \"jd8-afe-ydv.4546132139@synthetics.dtdg.co\",\n },\n {\n type: \"global\",\n name: \"MY_GLOBAL_VAR\",\n id: \"76636cd1-82e2-4aeb-9cfe-51366a8198a2\",\n },\n ],\n});\n```\n```python\nimport pulumi\nimport json\nimport pulumi_datadog as datadog\n\n# Create a new Datadog Synthetics Browser test starting on https://www.example.org\ntest_browser = datadog.SyntheticsTest(\"testBrowser\",\n type=\"browser\",\n request=datadog.SyntheticsTestRequestArgs(\n method=\"GET\",\n url=\"https://app.datadoghq.com\",\n ),\n device_ids=[\"laptop_large\"],\n locations=[\"aws:eu-central-1\"],\n options_list=datadog.SyntheticsTestOptionsListArgs(\n tick_every=3600,\n ),\n name=\"A Browser test on example.org\",\n message=\"Notify @qa\",\n tags=[],\n status=\"paused\",\n steps=[datadog.SyntheticsTestStepArgs(\n name=\"Check current url\",\n type=\"assertCurrentUrl\",\n params=json.dumps({\n \"check\": \"contains\",\n \"value\": \"datadoghq\",\n }),\n )],\n variables=[\n datadog.SyntheticsTestVariableArgs(\n type=\"text\",\n name=\"MY_PATTERN_VAR\",\n pattern=\"{{numeric(3)}}\",\n example=\"597\",\n ),\n datadog.SyntheticsTestVariableArgs(\n type=\"email\",\n name=\"MY_EMAIL_VAR\",\n pattern=\"jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co\",\n example=\"jd8-afe-ydv.4546132139@synthetics.dtdg.co\",\n ),\n datadog.SyntheticsTestVariableArgs(\n type=\"global\",\n name=\"MY_GLOBAL_VAR\",\n id=\"76636cd1-82e2-4aeb-9cfe-51366a8198a2\",\n ),\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Text.Json;\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n // Create a new Datadog Synthetics Browser test starting on https://www.example.org\n var testBrowser = new Datadog.SyntheticsTest(\"testBrowser\", new Datadog.SyntheticsTestArgs\n {\n Type = \"browser\",\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Method = \"GET\",\n Url = \"https://app.datadoghq.com\",\n },\n DeviceIds = \n {\n \"laptop_large\",\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n TickEvery = 3600,\n },\n Name = \"A Browser test on example.org\",\n Message = \"Notify @qa\",\n Tags = {},\n Status = \"paused\",\n Steps = \n {\n new Datadog.Inputs.SyntheticsTestStepArgs\n {\n Name = \"Check current url\",\n Type = \"assertCurrentUrl\",\n Params = JsonSerializer.Serialize(new Dictionary\u003cstring, object?\u003e\n {\n { \"check\", \"contains\" },\n { \"value\", \"datadoghq\" },\n }),\n },\n },\n Variables = \n {\n new Datadog.Inputs.SyntheticsTestVariableArgs\n {\n Type = \"text\",\n Name = \"MY_PATTERN_VAR\",\n Pattern = \"{{numeric(3)}}\",\n Example = \"597\",\n },\n new Datadog.Inputs.SyntheticsTestVariableArgs\n {\n Type = \"email\",\n Name = \"MY_EMAIL_VAR\",\n Pattern = \"jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co\",\n Example = \"jd8-afe-ydv.4546132139@synthetics.dtdg.co\",\n },\n new Datadog.Inputs.SyntheticsTestVariableArgs\n {\n Type = \"global\",\n Name = \"MY_GLOBAL_VAR\",\n Id = \"76636cd1-82e2-4aeb-9cfe-51366a8198a2\",\n },\n },\n });\n }\n\n}\n```\n{{% /example %}}\n{{% /examples %}}\n## Synthetics Browser test\n\nSupport for Synthetics Browser test is limited when creating steps. Some steps types (like steps involving elements) cannot be created, but they can be imported.\n\n## Assertion format\n\nThe resource was changed to have assertions be a list of `assertion` blocks instead of single `assertions` array, to support the JSON path operations. We'll remove `assertions` support in the future: to migrate, rename your attribute to `assertion` and turn array elements into independent blocks. For example:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testApi = new datadog.SyntheticsTest(\"test_api\", {\n assertions: [\n {\n operator: \"is\",\n target: \"200\",\n type: \"statusCode\",\n },\n {\n operator: \"lessThan\",\n target: \"1000\",\n type: \"responseTime\",\n },\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_api = datadog.SyntheticsTest(\"testApi\", assertions=[\n {\n \"operator\": \"is\",\n \"target\": \"200\",\n \"type\": \"statusCode\",\n },\n {\n \"operator\": \"lessThan\",\n \"target\": \"1000\",\n \"type\": \"responseTime\",\n },\n])\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testApi = new Datadog.SyntheticsTest(\"testApi\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"target\", \"200\" },\n { \"type\", \"statusCode\" },\n },\n \n {\n { \"operator\", \"lessThan\" },\n { \"target\", \"1000\" },\n { \"type\", \"responseTime\" },\n },\n },\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testApi\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"target\": pulumi.String(\"200\"),\n\t\t\t\t\t\"type\": pulumi.String(\"statusCode\"),\n\t\t\t\t},\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"lessThan\"),\n\t\t\t\t\t\"target\": pulumi.String(\"1000\"),\n\t\t\t\t\t\"type\": pulumi.String(\"responseTime\"),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\nturns into:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testApi = new datadog.SyntheticsTest(\"test_api\", {\n assertions: [\n {\n operator: \"is\",\n target: \"200\",\n type: \"statusCode\",\n },\n {\n operator: \"lessThan\",\n target: \"1000\",\n type: \"responsTime\",\n },\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_api = datadog.SyntheticsTest(\"testApi\", assertions=[\n {\n \"operator\": \"is\",\n \"target\": \"200\",\n \"type\": \"statusCode\",\n },\n {\n \"operator\": \"lessThan\",\n \"target\": \"1000\",\n \"type\": \"responsTime\",\n },\n])\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testApi = new Datadog.SyntheticsTest(\"testApi\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"target\", \"200\" },\n { \"type\", \"statusCode\" },\n },\n \n {\n { \"operator\", \"lessThan\" },\n { \"target\", \"1000\" },\n { \"type\", \"responsTime\" },\n },\n },\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testApi\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"target\": pulumi.String(\"200\"),\n\t\t\t\t\t\"type\": pulumi.String(\"statusCode\"),\n\t\t\t\t},\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"lessThan\"),\n\t\t\t\t\t\"target\": pulumi.String(\"1000\"),\n\t\t\t\t\t\"type\": pulumi.String(\"responsTime\"),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n\n## Import\n\nSynthetics tests can be imported using their public string ID, e.g.\n\n```sh\n $ pulumi import datadog:index/syntheticsTest:SyntheticsTest fizz abc-123-xyz\n```\n\n ", + "description": "Provides a Datadog synthetics test resource. This can be used to create and manage Datadog synthetics test.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Synthetics API Test)\n\nCreate a new Datadog Synthetics API/HTTP test on https://www.example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testApi = new datadog.SyntheticsTest(\"test_api\", {\n assertions: [{\n operator: \"is\",\n target: \"200\",\n type: \"statusCode\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n monitorOptions: {\n renotifyInterval: 100,\n },\n retry: {\n count: 2,\n interval: 300,\n },\n tickEvery: 900,\n },\n request: {\n method: \"GET\",\n url: \"https://www.example.org\",\n },\n requestHeaders: {\n Authentication: \"Token: 1234566789\",\n \"Content-Type\": \"application/json\",\n },\n status: \"live\",\n subtype: \"http\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_api = datadog.SyntheticsTest(\"testApi\",\n assertions=[{\n \"operator\": \"is\",\n \"target\": \"200\",\n \"type\": \"statusCode\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n monitor_options=datadog.SyntheticsTestOptionsListMonitorOptionsArgs(\n renotify_interval=100,\n ),\n retry=datadog.SyntheticsTestOptionsListRetryArgs(\n count=2,\n interval=300,\n ),\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n method=\"GET\",\n url=\"https://www.example.org\",\n ),\n request_headers={\n \"Authentication\": \"Token: 1234566789\",\n \"Content-Type\": \"application/json\",\n },\n status=\"live\",\n subtype=\"http\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testApi = new Datadog.SyntheticsTest(\"testApi\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"target\", \"200\" },\n { \"type\", \"statusCode\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n MonitorOptions = new Datadog.Inputs.SyntheticsTestOptionsListMonitorOptionsArgs\n {\n RenotifyInterval = 100,\n },\n Retry = new Datadog.Inputs.SyntheticsTestOptionsListRetryArgs\n {\n Count = 2,\n Interval = 300,\n },\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Method = \"GET\",\n Url = \"https://www.example.org\",\n },\n RequestHeaders = \n {\n { \"Authentication\", \"Token: 1234566789\" },\n { \"Content-Type\", \"application/json\" },\n },\n Status = \"live\",\n Subtype = \"http\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testApi\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"target\": pulumi.String(\"200\"),\n\t\t\t\t\t\"type\": pulumi.String(\"statusCode\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tMonitorOptions: \u0026datadog.SyntheticsTestOptionsListMonitorOptionsArgs{\n\t\t\t\t\tRenotifyInterval: pulumi.Int(100),\n\t\t\t\t},\n\t\t\t\tRetry: \u0026datadog.SyntheticsTestOptionsListRetryArgs{\n\t\t\t\t\tCount: pulumi.Int(2),\n\t\t\t\t\tInterval: pulumi.Int(300),\n\t\t\t\t},\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tMethod: pulumi.String(\"GET\"),\n\t\t\t\tUrl: pulumi.String(\"https://www.example.org\"),\n\t\t\t},\n\t\t\tRequestHeaders: pulumi.StringMap{\n\t\t\t\t\"Authentication\": pulumi.String(\"Token: 1234566789\"),\n\t\t\t\t\"Content-Type\": pulumi.String(\"application/json\"),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"http\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics SSL Test)\n\nCreate a new Datadog Synthetics API/SSL test on example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testSsl = new datadog.SyntheticsTest(\"test_ssl\", {\n assertions: [{\n operator: \"isInMoreThan\",\n target: \"30\",\n type: \"certificate\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n acceptSelfSigned: true,\n tickEvery: 900,\n },\n request: {\n host: \"example.org\",\n port: 443,\n },\n status: \"live\",\n subtype: \"ssl\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_ssl = datadog.SyntheticsTest(\"testSsl\",\n assertions=[{\n \"operator\": \"isInMoreThan\",\n \"target\": 30,\n \"type\": \"certificate\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n accept_self_signed=True,\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n host=\"example.org\",\n port=443,\n ),\n status=\"live\",\n subtype=\"ssl\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testSsl = new Datadog.SyntheticsTest(\"testSsl\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"isInMoreThan\" },\n { \"target\", 30 },\n { \"type\", \"certificate\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n AcceptSelfSigned = true,\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Host = \"example.org\",\n Port = 443,\n },\n Status = \"live\",\n Subtype = \"ssl\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testSsl\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.MapArray{\n\t\t\t\tpulumi.Map{\n\t\t\t\t\t\"operator\": pulumi.String(\"isInMoreThan\"),\n\t\t\t\t\t\"target\": pulumi.Float64(30),\n\t\t\t\t\t\"type\": pulumi.String(\"certificate\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tAcceptSelfSigned: pulumi.Bool(true),\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tHost: pulumi.String(\"example.org\"),\n\t\t\t\tPort: pulumi.Int(443),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"ssl\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics TCP Test)\n\nCreate a new Datadog Synthetics API/TCP test on example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testTcp = new datadog.SyntheticsTest(\"test_tcp\", {\n assertions: [{\n operator: \"lessThan\",\n target: \"2000\",\n type: \"responseTime\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n tickEvery: 900,\n },\n request: {\n host: \"example.org\",\n port: 443,\n },\n status: \"live\",\n subtype: \"tcp\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_tcp = datadog.SyntheticsTest(\"testTcp\",\n assertions=[{\n \"operator\": \"lessThan\",\n \"target\": 2000,\n \"type\": \"responseTime\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n host=\"example.org\",\n port=443,\n ),\n status=\"live\",\n subtype=\"tcp\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testTcp = new Datadog.SyntheticsTest(\"testTcp\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"lessThan\" },\n { \"target\", 2000 },\n { \"type\", \"responseTime\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Host = \"example.org\",\n Port = 443,\n },\n Status = \"live\",\n Subtype = \"tcp\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testTcp\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.MapArray{\n\t\t\t\tpulumi.Map{\n\t\t\t\t\t\"operator\": pulumi.String(\"lessThan\"),\n\t\t\t\t\t\"target\": pulumi.Float64(2000),\n\t\t\t\t\t\"type\": pulumi.String(\"responseTime\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tHost: pulumi.String(\"example.org\"),\n\t\t\t\tPort: pulumi.Int(443),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"tcp\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics DNS Test)\n\nCreate a new Datadog Synthetics API/DNS test on example.org\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testDns = new datadog.SyntheticsTest(\"test_dns\", {\n assertions: [{\n operator: \"is\",\n property: \"A\",\n target: \"0.0.0.0\",\n type: \"recordSome\",\n }],\n locations: [\"aws:eu-central-1\"],\n message: \"Notify @pagerduty\",\n name: \"An API test on example.org\",\n optionsList: {\n tickEvery: 900,\n },\n request: {\n host: \"example.org\",\n },\n status: \"live\",\n subtype: \"dns\",\n tags: [\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type: \"api\",\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_dns = datadog.SyntheticsTest(\"testDns\",\n assertions=[{\n \"operator\": \"is\",\n \"property\": \"A\",\n \"target\": \"0.0.0.0\",\n \"type\": \"recordSome\",\n }],\n locations=[\"aws:eu-central-1\"],\n message=\"Notify @pagerduty\",\n name=\"An API test on example.org\",\n options_list=datadog.SyntheticsTestOptionsListArgs(\n tick_every=900,\n ),\n request=datadog.SyntheticsTestRequestArgs(\n host=\"example.org\",\n ),\n status=\"live\",\n subtype=\"dns\",\n tags=[\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n ],\n type=\"api\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testDns = new Datadog.SyntheticsTest(\"testDns\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"property\", \"A\" },\n { \"target\", \"0.0.0.0\" },\n { \"type\", \"recordSome\" },\n },\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n Message = \"Notify @pagerduty\",\n Name = \"An API test on example.org\",\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n TickEvery = 900,\n },\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Host = \"example.org\",\n },\n Status = \"live\",\n Subtype = \"dns\",\n Tags = \n {\n \"foo:bar\",\n \"foo\",\n \"env:test\",\n },\n Type = \"api\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testDns\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"property\": pulumi.String(\"A\"),\n\t\t\t\t\t\"target\": pulumi.String(\"0.0.0.0\"),\n\t\t\t\t\t\"type\": pulumi.String(\"recordSome\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tLocations: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"aws:eu-central-1\"),\n\t\t\t},\n\t\t\tMessage: pulumi.String(\"Notify @pagerduty\"),\n\t\t\tName: pulumi.String(\"An API test on example.org\"),\n\t\t\tOptionsList: \u0026datadog.SyntheticsTestOptionsListArgs{\n\t\t\t\tTickEvery: pulumi.Int(900),\n\t\t\t},\n\t\t\tRequest: \u0026datadog.SyntheticsTestRequestArgs{\n\t\t\t\tHost: pulumi.String(\"example.org\"),\n\t\t\t},\n\t\t\tStatus: pulumi.String(\"live\"),\n\t\t\tSubtype: pulumi.String(\"dns\"),\n\t\t\tTags: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"foo:bar\"),\n\t\t\t\tpulumi.String(\"foo\"),\n\t\t\t\tpulumi.String(\"env:test\"),\n\t\t\t},\n\t\t\tType: pulumi.String(\"api\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n{{% /example %}}\n{{% example %}}\n### Synthetics Browser Test)\n\nSupport for Synthetics Browser test steps is limited (see below)\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\n// Create a new Datadog Synthetics Browser test starting on https://www.example.org\nconst testBrowser = new datadog.SyntheticsTest(\"testBrowser\", {\n type: \"browser\",\n request: {\n method: \"GET\",\n url: \"https://app.datadoghq.com\",\n },\n deviceIds: [\"laptop_large\"],\n locations: [\"aws:eu-central-1\"],\n optionsList: {\n tickEvery: 3600,\n },\n name: \"A Browser test on example.org\",\n message: \"Notify @qa\",\n tags: [],\n status: \"paused\",\n steps: [{\n name: \"Check current url\",\n type: \"assertCurrentUrl\",\n params: JSON.stringify({\n check: \"contains\",\n value: \"datadoghq\",\n }),\n }],\n variables: [\n {\n type: \"text\",\n name: \"MY_PATTERN_VAR\",\n pattern: \"{{numeric(3)}}\",\n example: \"597\",\n },\n {\n type: \"email\",\n name: \"MY_EMAIL_VAR\",\n pattern: \"jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co\",\n example: \"jd8-afe-ydv.4546132139@synthetics.dtdg.co\",\n },\n {\n type: \"global\",\n name: \"MY_GLOBAL_VAR\",\n id: \"76636cd1-82e2-4aeb-9cfe-51366a8198a2\",\n },\n ],\n});\n```\n```python\nimport pulumi\nimport json\nimport pulumi_datadog as datadog\n\n# Create a new Datadog Synthetics Browser test starting on https://www.example.org\ntest_browser = datadog.SyntheticsTest(\"testBrowser\",\n type=\"browser\",\n request=datadog.SyntheticsTestRequestArgs(\n method=\"GET\",\n url=\"https://app.datadoghq.com\",\n ),\n device_ids=[\"laptop_large\"],\n locations=[\"aws:eu-central-1\"],\n options_list=datadog.SyntheticsTestOptionsListArgs(\n tick_every=3600,\n ),\n name=\"A Browser test on example.org\",\n message=\"Notify @qa\",\n tags=[],\n status=\"paused\",\n steps=[datadog.SyntheticsTestStepArgs(\n name=\"Check current url\",\n type=\"assertCurrentUrl\",\n params=json.dumps({\n \"check\": \"contains\",\n \"value\": \"datadoghq\",\n }),\n )],\n variables=[\n datadog.SyntheticsTestVariableArgs(\n type=\"text\",\n name=\"MY_PATTERN_VAR\",\n pattern=\"{{numeric(3)}}\",\n example=\"597\",\n ),\n datadog.SyntheticsTestVariableArgs(\n type=\"email\",\n name=\"MY_EMAIL_VAR\",\n pattern=\"jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co\",\n example=\"jd8-afe-ydv.4546132139@synthetics.dtdg.co\",\n ),\n datadog.SyntheticsTestVariableArgs(\n type=\"global\",\n name=\"MY_GLOBAL_VAR\",\n id=\"76636cd1-82e2-4aeb-9cfe-51366a8198a2\",\n ),\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Text.Json;\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n // Create a new Datadog Synthetics Browser test starting on https://www.example.org\n var testBrowser = new Datadog.SyntheticsTest(\"testBrowser\", new Datadog.SyntheticsTestArgs\n {\n Type = \"browser\",\n Request = new Datadog.Inputs.SyntheticsTestRequestArgs\n {\n Method = \"GET\",\n Url = \"https://app.datadoghq.com\",\n },\n DeviceIds = \n {\n \"laptop_large\",\n },\n Locations = \n {\n \"aws:eu-central-1\",\n },\n OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs\n {\n TickEvery = 3600,\n },\n Name = \"A Browser test on example.org\",\n Message = \"Notify @qa\",\n Tags = {},\n Status = \"paused\",\n Steps = \n {\n new Datadog.Inputs.SyntheticsTestStepArgs\n {\n Name = \"Check current url\",\n Type = \"assertCurrentUrl\",\n Params = JsonSerializer.Serialize(new Dictionary\u003cstring, object?\u003e\n {\n { \"check\", \"contains\" },\n { \"value\", \"datadoghq\" },\n }),\n },\n },\n Variables = \n {\n new Datadog.Inputs.SyntheticsTestVariableArgs\n {\n Type = \"text\",\n Name = \"MY_PATTERN_VAR\",\n Pattern = \"{{numeric(3)}}\",\n Example = \"597\",\n },\n new Datadog.Inputs.SyntheticsTestVariableArgs\n {\n Type = \"email\",\n Name = \"MY_EMAIL_VAR\",\n Pattern = \"jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co\",\n Example = \"jd8-afe-ydv.4546132139@synthetics.dtdg.co\",\n },\n new Datadog.Inputs.SyntheticsTestVariableArgs\n {\n Type = \"global\",\n Name = \"MY_GLOBAL_VAR\",\n Id = \"76636cd1-82e2-4aeb-9cfe-51366a8198a2\",\n },\n },\n });\n }\n\n}\n```\n{{% /example %}}\n{{% /examples %}}\n## Synthetics Browser test\n\nSupport for Synthetics Browser test is limited when creating steps. Some steps types (like steps involving elements) cannot be created, but they can be imported.\n\n## Assertion format\n\nThe resource was changed to have assertions be a list of `assertion` blocks instead of single `assertions` array, to support the JSON path operations. We'll remove `assertions` support in the future: to migrate, rename your attribute to `assertion` and turn array elements into independent blocks. For example:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testApi = new datadog.SyntheticsTest(\"test_api\", {\n assertions: [\n {\n operator: \"is\",\n target: \"200\",\n type: \"statusCode\",\n },\n {\n operator: \"lessThan\",\n target: \"1000\",\n type: \"responseTime\",\n },\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_api = datadog.SyntheticsTest(\"testApi\", assertions=[\n {\n \"operator\": \"is\",\n \"target\": \"200\",\n \"type\": \"statusCode\",\n },\n {\n \"operator\": \"lessThan\",\n \"target\": \"1000\",\n \"type\": \"responseTime\",\n },\n])\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testApi = new Datadog.SyntheticsTest(\"testApi\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"target\", \"200\" },\n { \"type\", \"statusCode\" },\n },\n \n {\n { \"operator\", \"lessThan\" },\n { \"target\", \"1000\" },\n { \"type\", \"responseTime\" },\n },\n },\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testApi\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"target\": pulumi.String(\"200\"),\n\t\t\t\t\t\"type\": pulumi.String(\"statusCode\"),\n\t\t\t\t},\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"lessThan\"),\n\t\t\t\t\t\"target\": pulumi.String(\"1000\"),\n\t\t\t\t\t\"type\": pulumi.String(\"responseTime\"),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\nturns into:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst testApi = new datadog.SyntheticsTest(\"test_api\", {\n assertions: [\n {\n operator: \"is\",\n target: \"200\",\n type: \"statusCode\",\n },\n {\n operator: \"lessThan\",\n target: \"1000\",\n type: \"responsTime\",\n },\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest_api = datadog.SyntheticsTest(\"testApi\", assertions=[\n {\n \"operator\": \"is\",\n \"target\": \"200\",\n \"type\": \"statusCode\",\n },\n {\n \"operator\": \"lessThan\",\n \"target\": \"1000\",\n \"type\": \"responsTime\",\n },\n])\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testApi = new Datadog.SyntheticsTest(\"testApi\", new Datadog.SyntheticsTestArgs\n {\n Assertions = \n {\n \n {\n { \"operator\", \"is\" },\n { \"target\", \"200\" },\n { \"type\", \"statusCode\" },\n },\n \n {\n { \"operator\", \"lessThan\" },\n { \"target\", \"1000\" },\n { \"type\", \"responsTime\" },\n },\n },\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.NewSyntheticsTest(ctx, \"testApi\", \u0026datadog.SyntheticsTestArgs{\n\t\t\tAssertions: pulumi.StringMapArray{\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"is\"),\n\t\t\t\t\t\"target\": pulumi.String(\"200\"),\n\t\t\t\t\t\"type\": pulumi.String(\"statusCode\"),\n\t\t\t\t},\n\t\t\t\tpulumi.StringMap{\n\t\t\t\t\t\"operator\": pulumi.String(\"lessThan\"),\n\t\t\t\t\t\"target\": pulumi.String(\"1000\"),\n\t\t\t\t\t\"type\": pulumi.String(\"responsTime\"),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n\n\n## Import\n\nSynthetics tests can be imported using their public string ID, e.g.\n\n```sh\n $ pulumi import datadog:index/syntheticsTest:SyntheticsTest fizz abc-123-xyz\n```\n\n ", "properties": { "assertions": { "type": "array", @@ -34433,6 +34526,69 @@ ] } }, + "datadog:index/getPermissions:getPermissions": { + "description": "Use this data source to retrieve the list of Datadog permissions by name and their corresponding ID, for use in the role resource.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst permissions = pulumi.output(datadog.getPermissions({ async: true }));\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\npermissions = datadog.get_permissions()\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var permissions = Output.Create(Datadog.GetPermissions.InvokeAsync());\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.GetPermissions(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}", + "outputs": { + "description": "A collection of values returned by getPermissions.\n", + "properties": { + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "permissions": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "type": "object", + "required": [ + "permissions", + "id" + ] + } + }, + "datadog:index/getRole:getRole": { + "description": "Use this data source to retrieve information about an existing role for use in other resources.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as datadog from \"@pulumi/datadog\";\n\nconst test = pulumi.output(datadog.getRole({\n filter: \"Datadog Standard Role\",\n}, { async: true }));\n```\n```python\nimport pulumi\nimport pulumi_datadog as datadog\n\ntest = datadog.get_role(filter=\"Datadog Standard Role\")\n```\n```csharp\nusing Pulumi;\nusing Datadog = Pulumi.Datadog;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var test = Output.Create(Datadog.GetRole.InvokeAsync(new Datadog.GetRoleArgs\n {\n Filter = \"Datadog Standard Role\",\n }));\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := datadog.LookupRole(ctx, \u0026datadog.LookupRoleArgs{\n\t\t\tFilter: \"Datadog Standard Role\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}", + "inputs": { + "description": "A collection of arguments for invoking getRole.\n", + "properties": { + "filter": { + "type": "string" + } + }, + "type": "object", + "required": [ + "filter" + ] + }, + "outputs": { + "description": "A collection of values returned by getRole.\n", + "properties": { + "filter": { + "type": "string" + }, + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "name": { + "type": "string" + }, + "userCount": { + "type": "integer" + } + }, + "type": "object", + "required": [ + "filter", + "name", + "userCount", + "id" + ] + } + }, "datadog:index/getSyntheticsLocations:getSyntheticsLocations": { "description": "Use this data source to retrieve Datadog's Synthetics Locations (to be used in Synthetics tests).\n", "outputs": { diff --git a/provider/go.mod b/provider/go.mod index ae91498b0..a11bfbec6 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -6,7 +6,6 @@ require ( github.com/hashicorp/terraform-plugin-sdk v1.15.0 github.com/pulumi/pulumi-terraform-bridge/v2 v2.13.2 github.com/pulumi/pulumi/sdk/v2 v2.13.3-0.20201109230029-a6f8b9b205cd - github.com/satori/go.uuid v1.2.0 // indirect github.com/terraform-providers/terraform-provider-datadog v1.9.1-0.20200722132015-43f01ca20637 ) @@ -14,5 +13,5 @@ replace ( github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.4.3+incompatible github.com/hashicorp/terraform-plugin-test => github.com/hashicorp/terraform-plugin-test v1.3.0 github.com/hashicorp/vault => github.com/hashicorp/vault v1.2.0 - github.com/terraform-providers/terraform-provider-datadog => github.com/pulumi/terraform-provider-datadog v1.9.1-0.20201109111850-85ec1a567283 + github.com/terraform-providers/terraform-provider-datadog => github.com/pulumi/terraform-provider-datadog v1.9.1-0.20201126141533-0f7d7456e4de ) diff --git a/provider/go.sum b/provider/go.sum index 6e95c1931..9bcf0858a 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -538,22 +538,15 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pulumi/pulumi-terraform-bridge/v2 v2.11.1-0.20201020163502-64cff1e50894 h1:yUnJDty8PgO26E8T0xX5CwslQ5CZTVqdTzfv0PnSN20= -github.com/pulumi/pulumi-terraform-bridge/v2 v2.11.1-0.20201020163502-64cff1e50894/go.mod h1:HeGEtErxeRTElloiI8SJvnb2X/AgGvOxgTGI0irEIus= github.com/pulumi/pulumi-terraform-bridge/v2 v2.13.2 h1:8sEHpBhHUl+lVuruvvMXL8NJFrpPSEVxB6Nexuy1irs= github.com/pulumi/pulumi-terraform-bridge/v2 v2.13.2/go.mod h1:NVzB8KA29SMXW8Nwp6OHI4yevnQkLiY0VMucAI2R7jU= -github.com/pulumi/pulumi/pkg/v2 v2.12.1-0.20201019222817-89c956d18942 h1:IB34mt9friGXJGaRbZNwerIK9Oz0LfBruhbVEkJKDPg= -github.com/pulumi/pulumi/pkg/v2 v2.12.1-0.20201019222817-89c956d18942/go.mod h1:a5zxh9WrYwWR/cDOhPMNFOUpJuwtyeFS+ZYJebehQ+c= github.com/pulumi/pulumi/pkg/v2 v2.13.3-0.20201109230029-a6f8b9b205cd h1:ID3x2Bv/yEDQCU67THkmdhgoINcYYb0zYXo01FeJUhU= github.com/pulumi/pulumi/pkg/v2 v2.13.3-0.20201109230029-a6f8b9b205cd/go.mod h1:xLEDqsipr92IXfe8EJrl8bANoEUtwmBJGBE8X8PKmP0= github.com/pulumi/pulumi/sdk/v2 v2.2.1/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4= -github.com/pulumi/pulumi/sdk/v2 v2.11.3-0.20201009201355-249140242ebb/go.mod h1:WQ4WaHMA7mduVHAJi87iIqbWvqsuBUYccBiKK+FrayI= -github.com/pulumi/pulumi/sdk/v2 v2.12.0 h1:d2BQnOvRWCbxDG5DO0bz5FkhFbymABmOxlsx0h2Yhm8= -github.com/pulumi/pulumi/sdk/v2 v2.12.0/go.mod h1:WQ4WaHMA7mduVHAJi87iIqbWvqsuBUYccBiKK+FrayI= github.com/pulumi/pulumi/sdk/v2 v2.13.3-0.20201109230029-a6f8b9b205cd h1:acvoTtWZHySIlANIlR5LSfRyjYSUadeJcdUZhyx9y4o= github.com/pulumi/pulumi/sdk/v2 v2.13.3-0.20201109230029-a6f8b9b205cd/go.mod h1:Z9ifPo/Q0+hUpAyguVx2gp5Sx+CBumnWvYQDhrM8l3E= -github.com/pulumi/terraform-provider-datadog v1.9.1-0.20201109111850-85ec1a567283 h1:yaWfiw+bPl+Q0AIqM3zE96WV3JT9DNVwYlvXxRrgyio= -github.com/pulumi/terraform-provider-datadog v1.9.1-0.20201109111850-85ec1a567283/go.mod h1:DlLbOgn+4XMv2laOeftgPGrE2b//ymFICiWcbYoWQeg= +github.com/pulumi/terraform-provider-datadog v1.9.1-0.20201126141533-0f7d7456e4de h1:JboIB0Ye8Emh7/YFqKWi2Aa7/Fqsv4ZUpDcJkKYOn+M= +github.com/pulumi/terraform-provider-datadog v1.9.1-0.20201126141533-0f7d7456e4de/go.mod h1:DlLbOgn+4XMv2laOeftgPGrE2b//ymFICiWcbYoWQeg= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -562,8 +555,6 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 h1:G04eS0JkAIVZfaJLjla9dNxkJCPiKIGZlw9AfOhzOD0= github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= diff --git a/provider/resources.go b/provider/resources.go index 611dcb76e..dd621a1ad 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -79,92 +79,45 @@ func Provider() tfbridge.ProviderInfo { }, }, Resources: map[string]*tfbridge.ResourceInfo{ - "datadog_dashboard": { - Tok: makeResource(datadogMod, "Dashboard"), - }, - "datadog_downtime": { - Tok: makeResource(datadogMod, "Downtime"), - }, - "datadog_metric_metadata": { - Tok: makeResource(datadogMod, "MetricMetadata"), - }, - "datadog_monitor": { - Tok: makeResource(datadogMod, "Monitor"), - }, - "datadog_timeboard": { - Tok: makeResource(datadogMod, "TimeBoard"), - }, - "datadog_screenboard": { - Tok: makeResource(datadogMod, "ScreenBoard"), - }, - "datadog_user": { - Tok: makeResource(datadogMod, "User"), - }, + "datadog_dashboard": {Tok: makeResource(datadogMod, "Dashboard")}, + "datadog_downtime": {Tok: makeResource(datadogMod, "Downtime")}, + "datadog_metric_metadata": {Tok: makeResource(datadogMod, "MetricMetadata")}, + "datadog_monitor": {Tok: makeResource(datadogMod, "Monitor")}, + "datadog_timeboard": {Tok: makeResource(datadogMod, "TimeBoard")}, + "datadog_screenboard": {Tok: makeResource(datadogMod, "ScreenBoard")}, + "datadog_user": {Tok: makeResource(datadogMod, "User")}, "datadog_synthetics_test": { Tok: makeResource(datadogMod, "SyntheticsTest"), Docs: &tfbridge.DocInfo{ Source: "synthetics.html.markdown", }, }, - "datadog_synthetics_global_variable": { - Tok: makeResource(datadogMod, "SyntheticsGlobalVariable"), - }, - "datadog_dashboard_list": { - Tok: makeResource(datadogMod, "DashboardList"), - }, - "datadog_service_level_objective": { - Tok: makeResource(datadogMod, "ServiceLevelObjective"), - }, - "datadog_logs_custom_pipeline": { - Tok: makeResource(datadogMod, "LogsCustomPipeline"), - }, - "datadog_logs_index": { - Tok: makeResource(datadogMod, "LogsIndex"), - }, - "datadog_logs_archive": { - Tok: makeResource(datadogMod, "LogsArchive"), - }, - "datadog_logs_index_order": { - Tok: makeResource(datadogMod, "LogsIndexOrder"), - }, - "datadog_logs_integration_pipeline": { - Tok: makeResource(datadogMod, "LogsIntegrationPipeline"), - }, - "datadog_logs_pipeline_order": { - Tok: makeResource(datadogMod, "LogsPipelineOrder"), - }, - "datadog_logs_archive_order": { - Tok: makeResource(datadogMod, "LogsArchiveOrder"), - }, + "datadog_synthetics_global_variable": {Tok: makeResource(datadogMod, "SyntheticsGlobalVariable")}, + "datadog_dashboard_list": {Tok: makeResource(datadogMod, "DashboardList")}, + "datadog_service_level_objective": {Tok: makeResource(datadogMod, "ServiceLevelObjective")}, + "datadog_logs_custom_pipeline": {Tok: makeResource(datadogMod, "LogsCustomPipeline")}, + "datadog_logs_index": {Tok: makeResource(datadogMod, "LogsIndex")}, + "datadog_logs_archive": {Tok: makeResource(datadogMod, "LogsArchive")}, + "datadog_logs_index_order": {Tok: makeResource(datadogMod, "LogsIndexOrder")}, + "datadog_logs_integration_pipeline": {Tok: makeResource(datadogMod, "LogsIntegrationPipeline")}, + "datadog_logs_pipeline_order": {Tok: makeResource(datadogMod, "LogsPipelineOrder")}, + "datadog_logs_archive_order": {Tok: makeResource(datadogMod, "LogsArchiveOrder")}, + "datadog_role": {Tok: makeResource(datadogMod, "Role")}, // GCP Integrations - "datadog_integration_gcp": { - Tok: makeResource(gcpMod, "Integration"), - }, + "datadog_integration_gcp": {Tok: makeResource(gcpMod, "Integration")}, // Azure Integrations - "datadog_integration_azure": { - Tok: makeResource(azureMod, "Integration"), - }, + "datadog_integration_azure": {Tok: makeResource(azureMod, "Integration")}, // AWS Integrations - "datadog_integration_aws": { - Tok: makeResource(awsMod, "Integration"), - }, - "datadog_integration_aws_lambda_arn": { - Tok: makeResource(awsMod, "IntegrationLambdaArn"), - }, - "datadog_integration_aws_log_collection": { - Tok: makeResource(awsMod, "IntegrationLogCollection"), - }, + "datadog_integration_aws": {Tok: makeResource(awsMod, "Integration")}, + "datadog_integration_aws_lambda_arn": {Tok: makeResource(awsMod, "IntegrationLambdaArn")}, + "datadog_integration_aws_log_collection": {Tok: makeResource(awsMod, "IntegrationLogCollection")}, // PagerDuty Integrations - "datadog_integration_pagerduty": { - Tok: makeResource(pdMod, "Integration"), - }, - "datadog_integration_pagerduty_service_object": { - Tok: makeResource(pdMod, "ServiceObject"), - }, + "datadog_integration_pagerduty": {Tok: makeResource(pdMod, "Integration")}, + "datadog_integration_pagerduty_service_object": {Tok: makeResource(pdMod, "ServiceObject")}, }, DataSources: map[string]*tfbridge.DataSourceInfo{ "datadog_ip_ranges": { @@ -176,6 +129,8 @@ func Provider() tfbridge.ProviderInfo { "datadog_dashboard_list": {Tok: makeDataSource(datadogMod, "getDashboardList")}, "datadog_dashboard": {Tok: makeDataSource(datadogMod, "getDashboard")}, "datadog_synthetics_locations": {Tok: makeDataSource(datadogMod, "getSyntheticsLocations")}, + "datadog_permissions": {Tok: makeDataSource(datadogMod, "getPermissions")}, + "datadog_role": {Tok: makeDataSource(datadogMod, "getRole")}, }, JavaScript: &tfbridge.JavaScriptInfo{ Dependencies: map[string]string{ diff --git a/sdk/dotnet/GetPermissions.cs b/sdk/dotnet/GetPermissions.cs new file mode 100644 index 000000000..9e6c98b8f --- /dev/null +++ b/sdk/dotnet/GetPermissions.cs @@ -0,0 +1,61 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Datadog +{ + public static class GetPermissions + { + /// + /// Use this data source to retrieve the list of Datadog permissions by name and their corresponding ID, for use in the role resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using Pulumi; + /// using Datadog = Pulumi.Datadog; + /// + /// class MyStack : Stack + /// { + /// public MyStack() + /// { + /// var permissions = Output.Create(Datadog.GetPermissions.InvokeAsync()); + /// } + /// + /// } + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(InvokeOptions? options = null) + => Pulumi.Deployment.Instance.InvokeAsync("datadog:index/getPermissions:getPermissions", InvokeArgs.Empty, options.WithVersion()); + } + + + [OutputType] + public sealed class GetPermissionsResult + { + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + public readonly ImmutableDictionary Permissions; + + [OutputConstructor] + private GetPermissionsResult( + string id, + + ImmutableDictionary permissions) + { + Id = id; + Permissions = permissions; + } + } +} diff --git a/sdk/dotnet/GetRole.cs b/sdk/dotnet/GetRole.cs new file mode 100644 index 000000000..c61bc90a6 --- /dev/null +++ b/sdk/dotnet/GetRole.cs @@ -0,0 +1,83 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Datadog +{ + public static class GetRole + { + /// + /// Use this data source to retrieve information about an existing role for use in other resources. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using Pulumi; + /// using Datadog = Pulumi.Datadog; + /// + /// class MyStack : Stack + /// { + /// public MyStack() + /// { + /// var test = Output.Create(Datadog.GetRole.InvokeAsync(new Datadog.GetRoleArgs + /// { + /// Filter = "Datadog Standard Role", + /// })); + /// } + /// + /// } + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(GetRoleArgs args, InvokeOptions? options = null) + => Pulumi.Deployment.Instance.InvokeAsync("datadog:index/getRole:getRole", args ?? new GetRoleArgs(), options.WithVersion()); + } + + + public sealed class GetRoleArgs : Pulumi.InvokeArgs + { + [Input("filter", required: true)] + public string Filter { get; set; } = null!; + + public GetRoleArgs() + { + } + } + + + [OutputType] + public sealed class GetRoleResult + { + public readonly string Filter; + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + public readonly string Name; + public readonly int UserCount; + + [OutputConstructor] + private GetRoleResult( + string filter, + + string id, + + string name, + + int userCount) + { + Filter = filter; + Id = id; + Name = name; + UserCount = userCount; + } + } +} diff --git a/sdk/dotnet/Inputs/RolePermissionArgs.cs b/sdk/dotnet/Inputs/RolePermissionArgs.cs new file mode 100644 index 000000000..258065220 --- /dev/null +++ b/sdk/dotnet/Inputs/RolePermissionArgs.cs @@ -0,0 +1,25 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Datadog.Inputs +{ + + public sealed class RolePermissionArgs : Pulumi.ResourceArgs + { + [Input("id", required: true)] + public Input Id { get; set; } = null!; + + [Input("name")] + public Input? Name { get; set; } + + public RolePermissionArgs() + { + } + } +} diff --git a/sdk/dotnet/Inputs/RolePermissionGetArgs.cs b/sdk/dotnet/Inputs/RolePermissionGetArgs.cs new file mode 100644 index 000000000..b9436c1d3 --- /dev/null +++ b/sdk/dotnet/Inputs/RolePermissionGetArgs.cs @@ -0,0 +1,25 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Datadog.Inputs +{ + + public sealed class RolePermissionGetArgs : Pulumi.ResourceArgs + { + [Input("id", required: true)] + public Input Id { get; set; } = null!; + + [Input("name")] + public Input? Name { get; set; } + + public RolePermissionGetArgs() + { + } + } +} diff --git a/sdk/dotnet/Outputs/RolePermission.cs b/sdk/dotnet/Outputs/RolePermission.cs new file mode 100644 index 000000000..7694f754d --- /dev/null +++ b/sdk/dotnet/Outputs/RolePermission.cs @@ -0,0 +1,29 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Datadog.Outputs +{ + + [OutputType] + public sealed class RolePermission + { + public readonly string Id; + public readonly string? Name; + + [OutputConstructor] + private RolePermission( + string id, + + string? name) + { + Id = id; + Name = name; + } + } +} diff --git a/sdk/dotnet/Role.cs b/sdk/dotnet/Role.cs new file mode 100644 index 000000000..a172fd85d --- /dev/null +++ b/sdk/dotnet/Role.cs @@ -0,0 +1,174 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Datadog +{ + /// + /// Provides a Datadog role resource. This can be used to create and manage Datadog roles. + /// + /// ## Example Usage + /// + /// ```csharp + /// using Pulumi; + /// using Datadog = Pulumi.Datadog; + /// + /// class MyStack : Stack + /// { + /// public MyStack() + /// { + /// var bar = Output.Create(Datadog.GetPermissions.InvokeAsync()); + /// // Create a new Datadog role + /// var foo = new Datadog.Role("foo", new Datadog.RoleArgs + /// { + /// Name = "foo", + /// Permissions = + /// { + /// new Datadog.Inputs.RolePermissionArgs + /// { + /// Id = bar.Apply(bar => bar.Permissions.MonitorsDowntime), + /// }, + /// new Datadog.Inputs.RolePermissionArgs + /// { + /// Id = bar.Apply(bar => bar.Permissions.MonitorsWrite), + /// }, + /// }, + /// }); + /// } + /// + /// } + /// ``` + /// + /// ## Import + /// + /// Roles can be imported using their ID, e.g. + /// + /// ```sh + /// $ pulumi import datadog:index/role:Role example_role 000000-0000-0000-0000-000000000000 + /// ``` + /// + public partial class Role : Pulumi.CustomResource + { + /// + /// Name of the role. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// Set of objects containing the permission ID and the name of the permissions granted to this role. + /// + [Output("permissions")] + public Output> Permissions { get; private set; } = null!; + + /// + /// Number of users that have this role. + /// + [Output("userCount")] + public Output UserCount { get; private set; } = null!; + + + /// + /// Create a Role resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Role(string name, RoleArgs args, CustomResourceOptions? options = null) + : base("datadog:index/role:Role", name, args ?? new RoleArgs(), MakeResourceOptions(options, "")) + { + } + + private Role(string name, Input id, RoleState? state = null, CustomResourceOptions? options = null) + : base("datadog:index/role:Role", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Role resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static Role Get(string name, Input id, RoleState? state = null, CustomResourceOptions? options = null) + { + return new Role(name, id, state, options); + } + } + + public sealed class RoleArgs : Pulumi.ResourceArgs + { + /// + /// Name of the role. + /// + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + [Input("permissions")] + private InputList? _permissions; + + /// + /// Set of objects containing the permission ID and the name of the permissions granted to this role. + /// + public InputList Permissions + { + get => _permissions ?? (_permissions = new InputList()); + set => _permissions = value; + } + + public RoleArgs() + { + } + } + + public sealed class RoleState : Pulumi.ResourceArgs + { + /// + /// Name of the role. + /// + [Input("name")] + public Input? Name { get; set; } + + [Input("permissions")] + private InputList? _permissions; + + /// + /// Set of objects containing the permission ID and the name of the permissions granted to this role. + /// + public InputList Permissions + { + get => _permissions ?? (_permissions = new InputList()); + set => _permissions = value; + } + + /// + /// Number of users that have this role. + /// + [Input("userCount")] + public Input? UserCount { get; set; } + + public RoleState() + { + } + } +} diff --git a/sdk/dotnet/SyntheticsTest.cs b/sdk/dotnet/SyntheticsTest.cs index dbc68f414..8d46cfa5a 100644 --- a/sdk/dotnet/SyntheticsTest.cs +++ b/sdk/dotnet/SyntheticsTest.cs @@ -196,7 +196,7 @@ namespace Pulumi.Datadog /// { /// public MyStack() /// { - /// var testTcp = new Datadog.SyntheticsTest("testTcp", new Datadog.SyntheticsTestArgs + /// var testDns = new Datadog.SyntheticsTest("testDns", new Datadog.SyntheticsTestArgs /// { /// Assertions = /// { diff --git a/sdk/go/datadog/getPermissions.go b/sdk/go/datadog/getPermissions.go new file mode 100644 index 000000000..e7e3dbf54 --- /dev/null +++ b/sdk/go/datadog/getPermissions.go @@ -0,0 +1,46 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package datadog + +import ( + "github.com/pulumi/pulumi/sdk/v2/go/pulumi" +) + +// Use this data source to retrieve the list of Datadog permissions by name and their corresponding ID, for use in the role resource. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// "github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog" +// "github.com/pulumi/pulumi/sdk/v2/go/pulumi" +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := datadog.GetPermissions(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// ``` +func GetPermissions(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetPermissionsResult, error) { + var rv GetPermissionsResult + err := ctx.Invoke("datadog:index/getPermissions:getPermissions", nil, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of values returned by getPermissions. +type GetPermissionsResult struct { + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + Permissions map[string]string `pulumi:"permissions"` +} diff --git a/sdk/go/datadog/getRole.go b/sdk/go/datadog/getRole.go new file mode 100644 index 000000000..199f01bfa --- /dev/null +++ b/sdk/go/datadog/getRole.go @@ -0,0 +1,55 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package datadog + +import ( + "github.com/pulumi/pulumi/sdk/v2/go/pulumi" +) + +// Use this data source to retrieve information about an existing role for use in other resources. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// "github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog" +// "github.com/pulumi/pulumi/sdk/v2/go/pulumi" +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := datadog.LookupRole(ctx, &datadog.LookupRoleArgs{ +// Filter: "Datadog Standard Role", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// ``` +func LookupRole(ctx *pulumi.Context, args *LookupRoleArgs, opts ...pulumi.InvokeOption) (*LookupRoleResult, error) { + var rv LookupRoleResult + err := ctx.Invoke("datadog:index/getRole:getRole", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getRole. +type LookupRoleArgs struct { + Filter string `pulumi:"filter"` +} + +// A collection of values returned by getRole. +type LookupRoleResult struct { + Filter string `pulumi:"filter"` + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + Name string `pulumi:"name"` + UserCount int `pulumi:"userCount"` +} diff --git a/sdk/go/datadog/pulumiTypes.go b/sdk/go/datadog/pulumiTypes.go index dbd495f54..73a0f0cdc 100644 --- a/sdk/go/datadog/pulumiTypes.go +++ b/sdk/go/datadog/pulumiTypes.go @@ -117169,6 +117169,106 @@ func (o MonitorThresholdsPtrOutput) WarningRecovery() pulumi.Float64PtrOutput { }).(pulumi.Float64PtrOutput) } +type RolePermission struct { + Id string `pulumi:"id"` + Name *string `pulumi:"name"` +} + +// RolePermissionInput is an input type that accepts RolePermissionArgs and RolePermissionOutput values. +// You can construct a concrete instance of `RolePermissionInput` via: +// +// RolePermissionArgs{...} +type RolePermissionInput interface { + pulumi.Input + + ToRolePermissionOutput() RolePermissionOutput + ToRolePermissionOutputWithContext(context.Context) RolePermissionOutput +} + +type RolePermissionArgs struct { + Id pulumi.StringInput `pulumi:"id"` + Name pulumi.StringPtrInput `pulumi:"name"` +} + +func (RolePermissionArgs) ElementType() reflect.Type { + return reflect.TypeOf((*RolePermission)(nil)).Elem() +} + +func (i RolePermissionArgs) ToRolePermissionOutput() RolePermissionOutput { + return i.ToRolePermissionOutputWithContext(context.Background()) +} + +func (i RolePermissionArgs) ToRolePermissionOutputWithContext(ctx context.Context) RolePermissionOutput { + return pulumi.ToOutputWithContext(ctx, i).(RolePermissionOutput) +} + +// RolePermissionArrayInput is an input type that accepts RolePermissionArray and RolePermissionArrayOutput values. +// You can construct a concrete instance of `RolePermissionArrayInput` via: +// +// RolePermissionArray{ RolePermissionArgs{...} } +type RolePermissionArrayInput interface { + pulumi.Input + + ToRolePermissionArrayOutput() RolePermissionArrayOutput + ToRolePermissionArrayOutputWithContext(context.Context) RolePermissionArrayOutput +} + +type RolePermissionArray []RolePermissionInput + +func (RolePermissionArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]RolePermission)(nil)).Elem() +} + +func (i RolePermissionArray) ToRolePermissionArrayOutput() RolePermissionArrayOutput { + return i.ToRolePermissionArrayOutputWithContext(context.Background()) +} + +func (i RolePermissionArray) ToRolePermissionArrayOutputWithContext(ctx context.Context) RolePermissionArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(RolePermissionArrayOutput) +} + +type RolePermissionOutput struct{ *pulumi.OutputState } + +func (RolePermissionOutput) ElementType() reflect.Type { + return reflect.TypeOf((*RolePermission)(nil)).Elem() +} + +func (o RolePermissionOutput) ToRolePermissionOutput() RolePermissionOutput { + return o +} + +func (o RolePermissionOutput) ToRolePermissionOutputWithContext(ctx context.Context) RolePermissionOutput { + return o +} + +func (o RolePermissionOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v RolePermission) string { return v.Id }).(pulumi.StringOutput) +} + +func (o RolePermissionOutput) Name() pulumi.StringPtrOutput { + return o.ApplyT(func(v RolePermission) *string { return v.Name }).(pulumi.StringPtrOutput) +} + +type RolePermissionArrayOutput struct{ *pulumi.OutputState } + +func (RolePermissionArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]RolePermission)(nil)).Elem() +} + +func (o RolePermissionArrayOutput) ToRolePermissionArrayOutput() RolePermissionArrayOutput { + return o +} + +func (o RolePermissionArrayOutput) ToRolePermissionArrayOutputWithContext(ctx context.Context) RolePermissionArrayOutput { + return o +} + +func (o RolePermissionArrayOutput) Index(i pulumi.IntInput) RolePermissionOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) RolePermission { + return vs[0].([]RolePermission)[vs[1].(int)] + }).(RolePermissionOutput) +} + type ScreenBoardTemplateVariable struct { Default *string `pulumi:"default"` Name string `pulumi:"name"` @@ -126435,6 +126535,8 @@ func init() { pulumi.RegisterOutputType(MonitorThresholdWindowsPtrOutput{}) pulumi.RegisterOutputType(MonitorThresholdsOutput{}) pulumi.RegisterOutputType(MonitorThresholdsPtrOutput{}) + pulumi.RegisterOutputType(RolePermissionOutput{}) + pulumi.RegisterOutputType(RolePermissionArrayOutput{}) pulumi.RegisterOutputType(ScreenBoardTemplateVariableOutput{}) pulumi.RegisterOutputType(ScreenBoardTemplateVariableArrayOutput{}) pulumi.RegisterOutputType(ScreenBoardWidgetOutput{}) diff --git a/sdk/go/datadog/role.go b/sdk/go/datadog/role.go new file mode 100644 index 000000000..9e775069a --- /dev/null +++ b/sdk/go/datadog/role.go @@ -0,0 +1,177 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package datadog + +import ( + "context" + "reflect" + + "github.com/pkg/errors" + "github.com/pulumi/pulumi/sdk/v2/go/pulumi" +) + +// Provides a Datadog role resource. This can be used to create and manage Datadog roles. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// "github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog" +// "github.com/pulumi/pulumi/sdk/v2/go/pulumi" +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// bar, err := datadog.GetPermissions(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = datadog.NewRole(ctx, "foo", &datadog.RoleArgs{ +// Name: pulumi.String("foo"), +// Permissions: datadog.RolePermissionArray{ +// &datadog.RolePermissionArgs{ +// Id: pulumi.String(bar.Permissions.MonitorsDowntime), +// }, +// &datadog.RolePermissionArgs{ +// Id: pulumi.String(bar.Permissions.MonitorsWrite), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// ``` +// +// ## Import +// +// Roles can be imported using their ID, e.g. +// +// ```sh +// $ pulumi import datadog:index/role:Role example_role 000000-0000-0000-0000-000000000000 +// ``` +type Role struct { + pulumi.CustomResourceState + + // Name of the role. + Name pulumi.StringOutput `pulumi:"name"` + // Set of objects containing the permission ID and the name of the permissions granted to this role. + Permissions RolePermissionArrayOutput `pulumi:"permissions"` + // Number of users that have this role. + UserCount pulumi.IntOutput `pulumi:"userCount"` +} + +// NewRole registers a new resource with the given unique name, arguments, and options. +func NewRole(ctx *pulumi.Context, + name string, args *RoleArgs, opts ...pulumi.ResourceOption) (*Role, error) { + if args == nil || args.Name == nil { + return nil, errors.New("missing required argument 'Name'") + } + if args == nil { + args = &RoleArgs{} + } + var resource Role + err := ctx.RegisterResource("datadog:index/role:Role", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetRole gets an existing Role resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetRole(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *RoleState, opts ...pulumi.ResourceOption) (*Role, error) { + var resource Role + err := ctx.ReadResource("datadog:index/role:Role", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Role resources. +type roleState struct { + // Name of the role. + Name *string `pulumi:"name"` + // Set of objects containing the permission ID and the name of the permissions granted to this role. + Permissions []RolePermission `pulumi:"permissions"` + // Number of users that have this role. + UserCount *int `pulumi:"userCount"` +} + +type RoleState struct { + // Name of the role. + Name pulumi.StringPtrInput + // Set of objects containing the permission ID and the name of the permissions granted to this role. + Permissions RolePermissionArrayInput + // Number of users that have this role. + UserCount pulumi.IntPtrInput +} + +func (RoleState) ElementType() reflect.Type { + return reflect.TypeOf((*roleState)(nil)).Elem() +} + +type roleArgs struct { + // Name of the role. + Name string `pulumi:"name"` + // Set of objects containing the permission ID and the name of the permissions granted to this role. + Permissions []RolePermission `pulumi:"permissions"` +} + +// The set of arguments for constructing a Role resource. +type RoleArgs struct { + // Name of the role. + Name pulumi.StringInput + // Set of objects containing the permission ID and the name of the permissions granted to this role. + Permissions RolePermissionArrayInput +} + +func (RoleArgs) ElementType() reflect.Type { + return reflect.TypeOf((*roleArgs)(nil)).Elem() +} + +type RoleInput interface { + pulumi.Input + + ToRoleOutput() RoleOutput + ToRoleOutputWithContext(ctx context.Context) RoleOutput +} + +func (Role) ElementType() reflect.Type { + return reflect.TypeOf((*Role)(nil)).Elem() +} + +func (i Role) ToRoleOutput() RoleOutput { + return i.ToRoleOutputWithContext(context.Background()) +} + +func (i Role) ToRoleOutputWithContext(ctx context.Context) RoleOutput { + return pulumi.ToOutputWithContext(ctx, i).(RoleOutput) +} + +type RoleOutput struct { + *pulumi.OutputState +} + +func (RoleOutput) ElementType() reflect.Type { + return reflect.TypeOf((*RoleOutput)(nil)).Elem() +} + +func (o RoleOutput) ToRoleOutput() RoleOutput { + return o +} + +func (o RoleOutput) ToRoleOutputWithContext(ctx context.Context) RoleOutput { + return o +} + +func init() { + pulumi.RegisterOutputType(RoleOutput{}) +} diff --git a/sdk/go/datadog/syntheticsTest.go b/sdk/go/datadog/syntheticsTest.go index 963af9029..4fd17b7da 100644 --- a/sdk/go/datadog/syntheticsTest.go +++ b/sdk/go/datadog/syntheticsTest.go @@ -190,7 +190,7 @@ import ( // // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := datadog.NewSyntheticsTest(ctx, "testTcp", &datadog.SyntheticsTestArgs{ +// _, err := datadog.NewSyntheticsTest(ctx, "testDns", &datadog.SyntheticsTestArgs{ // Assertions: pulumi.StringMapArray{ // pulumi.StringMap{ // "operator": pulumi.String("is"), diff --git a/sdk/nodejs/getPermissions.ts b/sdk/nodejs/getPermissions.ts new file mode 100644 index 000000000..72aa7a8e5 --- /dev/null +++ b/sdk/nodejs/getPermissions.ts @@ -0,0 +1,41 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import { input as inputs, output as outputs } from "./types"; +import * as utilities from "./utilities"; + +/** + * Use this data source to retrieve the list of Datadog permissions by name and their corresponding ID, for use in the role resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as datadog from "@pulumi/datadog"; + * + * const permissions = pulumi.output(datadog.getPermissions({ async: true })); + * ``` + */ +export function getPermissions(opts?: pulumi.InvokeOptions): Promise { + if (!opts) { + opts = {} + } + + if (!opts.version) { + opts.version = utilities.getVersion(); + } + return pulumi.runtime.invoke("datadog:index/getPermissions:getPermissions", { + }, opts); +} + +/** + * A collection of values returned by getPermissions. + */ +export interface GetPermissionsResult { + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + readonly permissions: {[key: string]: string}; +} diff --git a/sdk/nodejs/getRole.ts b/sdk/nodejs/getRole.ts new file mode 100644 index 000000000..fd2ac53de --- /dev/null +++ b/sdk/nodejs/getRole.ts @@ -0,0 +1,53 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import { input as inputs, output as outputs } from "./types"; +import * as utilities from "./utilities"; + +/** + * Use this data source to retrieve information about an existing role for use in other resources. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as datadog from "@pulumi/datadog"; + * + * const test = pulumi.output(datadog.getRole({ + * filter: "Datadog Standard Role", + * }, { async: true })); + * ``` + */ +export function getRole(args: GetRoleArgs, opts?: pulumi.InvokeOptions): Promise { + if (!opts) { + opts = {} + } + + if (!opts.version) { + opts.version = utilities.getVersion(); + } + return pulumi.runtime.invoke("datadog:index/getRole:getRole", { + "filter": args.filter, + }, opts); +} + +/** + * A collection of arguments for invoking getRole. + */ +export interface GetRoleArgs { + readonly filter: string; +} + +/** + * A collection of values returned by getRole. + */ +export interface GetRoleResult { + readonly filter: string; + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + readonly name: string; + readonly userCount: number; +} diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 5925d5dcb..efca3c006 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -9,6 +9,8 @@ export * from "./getDashboard"; export * from "./getDashboardList"; export * from "./getIpRanges"; export * from "./getMonitor"; +export * from "./getPermissions"; +export * from "./getRole"; export * from "./getSyntheticsLocations"; export * from "./logsArchive"; export * from "./logsArchiveOrder"; @@ -20,6 +22,7 @@ export * from "./logsPipelineOrder"; export * from "./metricMetadata"; export * from "./monitor"; export * from "./provider"; +export * from "./role"; export * from "./screenBoard"; export * from "./serviceLevelObjective"; export * from "./syntheticsGlobalVariable"; diff --git a/sdk/nodejs/role.ts b/sdk/nodejs/role.ts new file mode 100644 index 000000000..582e81f51 --- /dev/null +++ b/sdk/nodejs/role.ts @@ -0,0 +1,146 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import { input as inputs, output as outputs } from "./types"; +import * as utilities from "./utilities"; + +/** + * Provides a Datadog role resource. This can be used to create and manage Datadog roles. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as datadog from "@pulumi/datadog"; + * + * const bar = datadog.getPermissions({}); + * // Create a new Datadog role + * const foo = new datadog.Role("foo", { + * name: "foo", + * permissions: [ + * { + * id: bar.then(bar => bar.permissions.monitorsDowntime), + * }, + * { + * id: bar.then(bar => bar.permissions.monitorsWrite), + * }, + * ], + * }); + * ``` + * + * ## Import + * + * Roles can be imported using their ID, e.g. + * + * ```sh + * $ pulumi import datadog:index/role:Role example_role 000000-0000-0000-0000-000000000000 + * ``` + */ +export class Role extends pulumi.CustomResource { + /** + * Get an existing Role resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: RoleState, opts?: pulumi.CustomResourceOptions): Role { + return new Role(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'datadog:index/role:Role'; + + /** + * Returns true if the given object is an instance of Role. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is Role { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === Role.__pulumiType; + } + + /** + * Name of the role. + */ + public readonly name!: pulumi.Output; + /** + * Set of objects containing the permission ID and the name of the permissions granted to this role. + */ + public readonly permissions!: pulumi.Output; + /** + * Number of users that have this role. + */ + public /*out*/ readonly userCount!: pulumi.Output; + + /** + * Create a Role resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: RoleArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: RoleArgs | RoleState, opts?: pulumi.CustomResourceOptions) { + let inputs: pulumi.Inputs = {}; + if (opts && opts.id) { + const state = argsOrState as RoleState | undefined; + inputs["name"] = state ? state.name : undefined; + inputs["permissions"] = state ? state.permissions : undefined; + inputs["userCount"] = state ? state.userCount : undefined; + } else { + const args = argsOrState as RoleArgs | undefined; + if (!args || args.name === undefined) { + throw new Error("Missing required property 'name'"); + } + inputs["name"] = args ? args.name : undefined; + inputs["permissions"] = args ? args.permissions : undefined; + inputs["userCount"] = undefined /*out*/; + } + if (!opts) { + opts = {} + } + + if (!opts.version) { + opts.version = utilities.getVersion(); + } + super(Role.__pulumiType, name, inputs, opts); + } +} + +/** + * Input properties used for looking up and filtering Role resources. + */ +export interface RoleState { + /** + * Name of the role. + */ + readonly name?: pulumi.Input; + /** + * Set of objects containing the permission ID and the name of the permissions granted to this role. + */ + readonly permissions?: pulumi.Input[]>; + /** + * Number of users that have this role. + */ + readonly userCount?: pulumi.Input; +} + +/** + * The set of arguments for constructing a Role resource. + */ +export interface RoleArgs { + /** + * Name of the role. + */ + readonly name: pulumi.Input; + /** + * Set of objects containing the permission ID and the name of the permissions granted to this role. + */ + readonly permissions?: pulumi.Input[]>; +} diff --git a/sdk/nodejs/syntheticsTest.ts b/sdk/nodejs/syntheticsTest.ts index a229b5389..06453478a 100644 --- a/sdk/nodejs/syntheticsTest.ts +++ b/sdk/nodejs/syntheticsTest.ts @@ -131,7 +131,7 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as datadog from "@pulumi/datadog"; * - * const testTcp = new datadog.SyntheticsTest("test_tcp", { + * const testDns = new datadog.SyntheticsTest("test_dns", { * assertions: [{ * operator: "is", * property: "A", diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 57307e152..f8a20b90f 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -30,6 +30,8 @@ "getDashboardList.ts", "getIpRanges.ts", "getMonitor.ts", + "getPermissions.ts", + "getRole.ts", "getSyntheticsLocations.ts", "index.ts", "logsArchive.ts", @@ -45,6 +47,7 @@ "pagerduty/integration.ts", "pagerduty/serviceObject.ts", "provider.ts", + "role.ts", "screenBoard.ts", "serviceLevelObjective.ts", "syntheticsGlobalVariable.ts", diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 80d3aea9c..340c9ea0f 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -5128,6 +5128,11 @@ export interface MonitorThresholds { warningRecovery?: pulumi.Input; } +export interface RolePermission { + id: pulumi.Input; + name?: pulumi.Input; +} + export interface ScreenBoardTemplateVariable { default?: pulumi.Input; name: pulumi.Input; diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 0be161d08..0cbd41392 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -5142,6 +5142,11 @@ export interface MonitorThresholds { warningRecovery?: number; } +export interface RolePermission { + id: string; + name: string; +} + export interface ScreenBoardTemplateVariable { default?: string; name: string; diff --git a/sdk/python/pulumi_datadog/__init__.py b/sdk/python/pulumi_datadog/__init__.py index 9ddbb4fab..7a78e784f 100644 --- a/sdk/python/pulumi_datadog/__init__.py +++ b/sdk/python/pulumi_datadog/__init__.py @@ -10,6 +10,8 @@ from .get_dashboard_list import * from .get_ip_ranges import * from .get_monitor import * +from .get_permissions import * +from .get_role import * from .get_synthetics_locations import * from .logs_archive import * from .logs_archive_order import * @@ -21,6 +23,7 @@ from .metric_metadata import * from .monitor import * from .provider import * +from .role import * from .screen_board import * from .service_level_objective import * from .synthetics_global_variable import * diff --git a/sdk/python/pulumi_datadog/_inputs.py b/sdk/python/pulumi_datadog/_inputs.py index 7794b84c7..70970db39 100644 --- a/sdk/python/pulumi_datadog/_inputs.py +++ b/sdk/python/pulumi_datadog/_inputs.py @@ -786,6 +786,7 @@ 'LogsIndexFilterArgs', 'MonitorThresholdWindowsArgs', 'MonitorThresholdsArgs', + 'RolePermissionArgs', 'ScreenBoardTemplateVariableArgs', 'ScreenBoardWidgetArgs', 'ScreenBoardWidgetRuleArgs', @@ -37196,6 +37197,34 @@ def warning_recovery(self, value: Optional[pulumi.Input[float]]): pulumi.set(self, "warning_recovery", value) +@pulumi.input_type +class RolePermissionArgs: + def __init__(__self__, *, + id: pulumi.Input[str], + name: Optional[pulumi.Input[str]] = None): + pulumi.set(__self__, "id", id) + if name is not None: + pulumi.set(__self__, "name", name) + + @property + @pulumi.getter + def id(self) -> pulumi.Input[str]: + return pulumi.get(self, "id") + + @id.setter + def id(self, value: pulumi.Input[str]): + pulumi.set(self, "id", value) + + @property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "name", value) + + @pulumi.input_type class ScreenBoardTemplateVariableArgs: def __init__(__self__, *, diff --git a/sdk/python/pulumi_datadog/_tables.py b/sdk/python/pulumi_datadog/_tables.py index 0e0e56e9b..1e9e44f8a 100644 --- a/sdk/python/pulumi_datadog/_tables.py +++ b/sdk/python/pulumi_datadog/_tables.py @@ -82,6 +82,7 @@ "tick_every": "tickEvery", "timeout_h": "timeoutH", "trigger_window": "triggerWindow", + "user_count": "userCount", "warning_recovery": "warningRecovery", } @@ -165,5 +166,6 @@ "tickEvery": "tick_every", "timeoutH": "timeout_h", "triggerWindow": "trigger_window", + "userCount": "user_count", "warningRecovery": "warning_recovery", } diff --git a/sdk/python/pulumi_datadog/get_permissions.py b/sdk/python/pulumi_datadog/get_permissions.py new file mode 100644 index 000000000..19669ae14 --- /dev/null +++ b/sdk/python/pulumi_datadog/get_permissions.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union +from . import _utilities, _tables + +__all__ = [ + 'GetPermissionsResult', + 'AwaitableGetPermissionsResult', + 'get_permissions', +] + +@pulumi.output_type +class GetPermissionsResult: + """ + A collection of values returned by getPermissions. + """ + def __init__(__self__, id=None, permissions=None): + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if permissions and not isinstance(permissions, dict): + raise TypeError("Expected argument 'permissions' to be a dict") + pulumi.set(__self__, "permissions", permissions) + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def permissions(self) -> Mapping[str, str]: + return pulumi.get(self, "permissions") + + +class AwaitableGetPermissionsResult(GetPermissionsResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetPermissionsResult( + id=self.id, + permissions=self.permissions) + + +def get_permissions(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPermissionsResult: + """ + Use this data source to retrieve the list of Datadog permissions by name and their corresponding ID, for use in the role resource. + + ## Example Usage + + ```python + import pulumi + import pulumi_datadog as datadog + + permissions = datadog.get_permissions() + ``` + """ + __args__ = dict() + if opts is None: + opts = pulumi.InvokeOptions() + if opts.version is None: + opts.version = _utilities.get_version() + __ret__ = pulumi.runtime.invoke('datadog:index/getPermissions:getPermissions', __args__, opts=opts, typ=GetPermissionsResult).value + + return AwaitableGetPermissionsResult( + id=__ret__.id, + permissions=__ret__.permissions) diff --git a/sdk/python/pulumi_datadog/get_role.py b/sdk/python/pulumi_datadog/get_role.py new file mode 100644 index 000000000..66aa75d70 --- /dev/null +++ b/sdk/python/pulumi_datadog/get_role.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union +from . import _utilities, _tables + +__all__ = [ + 'GetRoleResult', + 'AwaitableGetRoleResult', + 'get_role', +] + +@pulumi.output_type +class GetRoleResult: + """ + A collection of values returned by getRole. + """ + def __init__(__self__, filter=None, id=None, name=None, user_count=None): + if filter and not isinstance(filter, str): + raise TypeError("Expected argument 'filter' to be a str") + pulumi.set(__self__, "filter", filter) + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if name and not isinstance(name, str): + raise TypeError("Expected argument 'name' to be a str") + pulumi.set(__self__, "name", name) + if user_count and not isinstance(user_count, int): + raise TypeError("Expected argument 'user_count' to be a int") + pulumi.set(__self__, "user_count", user_count) + + @property + @pulumi.getter + def filter(self) -> str: + return pulumi.get(self, "filter") + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def name(self) -> str: + return pulumi.get(self, "name") + + @property + @pulumi.getter(name="userCount") + def user_count(self) -> int: + return pulumi.get(self, "user_count") + + +class AwaitableGetRoleResult(GetRoleResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetRoleResult( + filter=self.filter, + id=self.id, + name=self.name, + user_count=self.user_count) + + +def get_role(filter: Optional[str] = None, + opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRoleResult: + """ + Use this data source to retrieve information about an existing role for use in other resources. + + ## Example Usage + + ```python + import pulumi + import pulumi_datadog as datadog + + test = datadog.get_role(filter="Datadog Standard Role") + ``` + """ + __args__ = dict() + __args__['filter'] = filter + if opts is None: + opts = pulumi.InvokeOptions() + if opts.version is None: + opts.version = _utilities.get_version() + __ret__ = pulumi.runtime.invoke('datadog:index/getRole:getRole', __args__, opts=opts, typ=GetRoleResult).value + + return AwaitableGetRoleResult( + filter=__ret__.filter, + id=__ret__.id, + name=__ret__.name, + user_count=__ret__.user_count) diff --git a/sdk/python/pulumi_datadog/outputs.py b/sdk/python/pulumi_datadog/outputs.py index a481f5255..a3c826f2a 100644 --- a/sdk/python/pulumi_datadog/outputs.py +++ b/sdk/python/pulumi_datadog/outputs.py @@ -787,6 +787,7 @@ 'LogsIndexFilter', 'MonitorThresholdWindows', 'MonitorThresholds', + 'RolePermission', 'ScreenBoardTemplateVariable', 'ScreenBoardWidget', 'ScreenBoardWidgetRule', @@ -28436,6 +28437,29 @@ def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop +@pulumi.output_type +class RolePermission(dict): + def __init__(__self__, *, + id: str, + name: Optional[str] = None): + pulumi.set(__self__, "id", id) + if name is not None: + pulumi.set(__self__, "name", name) + + @property + @pulumi.getter + def id(self) -> str: + return pulumi.get(self, "id") + + @property + @pulumi.getter + def name(self) -> Optional[str]: + return pulumi.get(self, "name") + + def _translate_property(self, prop): + return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop + + @pulumi.output_type class ScreenBoardTemplateVariable(dict): def __init__(__self__, *, diff --git a/sdk/python/pulumi_datadog/role.py b/sdk/python/pulumi_datadog/role.py new file mode 100644 index 000000000..8f427379f --- /dev/null +++ b/sdk/python/pulumi_datadog/role.py @@ -0,0 +1,145 @@ +# coding=utf-8 +# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union +from . import _utilities, _tables +from . import outputs +from ._inputs import * + +__all__ = ['Role'] + + +class Role(pulumi.CustomResource): + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + name: Optional[pulumi.Input[str]] = None, + permissions: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RolePermissionArgs']]]]] = None, + __props__=None, + __name__=None, + __opts__=None): + """ + Provides a Datadog role resource. This can be used to create and manage Datadog roles. + + ## Example Usage + + ```python + import pulumi + import pulumi_datadog as datadog + + bar = datadog.get_permissions() + # Create a new Datadog role + foo = datadog.Role("foo", + name="foo", + permissions=[ + datadog.RolePermissionArgs( + id=bar.permissions["monitorsDowntime"], + ), + datadog.RolePermissionArgs( + id=bar.permissions["monitorsWrite"], + ), + ]) + ``` + + ## Import + + Roles can be imported using their ID, e.g. + + ```sh + $ pulumi import datadog:index/role:Role example_role 000000-0000-0000-0000-000000000000 + ``` + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] name: Name of the role. + :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RolePermissionArgs']]]] permissions: Set of objects containing the permission ID and the name of the permissions granted to this role. + """ + if __name__ is not None: + warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning) + resource_name = __name__ + if __opts__ is not None: + warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning) + opts = __opts__ + if opts is None: + opts = pulumi.ResourceOptions() + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.version is None: + opts.version = _utilities.get_version() + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = dict() + + if name is None: + raise TypeError("Missing required property 'name'") + __props__['name'] = name + __props__['permissions'] = permissions + __props__['user_count'] = None + super(Role, __self__).__init__( + 'datadog:index/role:Role', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + name: Optional[pulumi.Input[str]] = None, + permissions: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RolePermissionArgs']]]]] = None, + user_count: Optional[pulumi.Input[int]] = None) -> 'Role': + """ + Get an existing Role resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] name: Name of the role. + :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RolePermissionArgs']]]] permissions: Set of objects containing the permission ID and the name of the permissions granted to this role. + :param pulumi.Input[int] user_count: Number of users that have this role. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = dict() + + __props__["name"] = name + __props__["permissions"] = permissions + __props__["user_count"] = user_count + return Role(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def name(self) -> pulumi.Output[str]: + """ + Name of the role. + """ + return pulumi.get(self, "name") + + @property + @pulumi.getter + def permissions(self) -> pulumi.Output[Optional[Sequence['outputs.RolePermission']]]: + """ + Set of objects containing the permission ID and the name of the permissions granted to this role. + """ + return pulumi.get(self, "permissions") + + @property + @pulumi.getter(name="userCount") + def user_count(self) -> pulumi.Output[int]: + """ + Number of users that have this role. + """ + return pulumi.get(self, "user_count") + + def translate_output_property(self, prop): + return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop + + def translate_input_property(self, prop): + return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop + diff --git a/sdk/python/pulumi_datadog/synthetics_test.py b/sdk/python/pulumi_datadog/synthetics_test.py index 914473596..caeb278a9 100644 --- a/sdk/python/pulumi_datadog/synthetics_test.py +++ b/sdk/python/pulumi_datadog/synthetics_test.py @@ -161,7 +161,7 @@ def __init__(__self__, import pulumi import pulumi_datadog as datadog - test_tcp = datadog.SyntheticsTest("testTcp", + test_dns = datadog.SyntheticsTest("testDns", assertions=[{ "operator": "is", "property": "A",