Skip to content

Commit e1bf8a3

Browse files
committed
Undo weird changes
1 parent 64b3985 commit e1bf8a3

File tree

7 files changed

+682
-0
lines changed

7 files changed

+682
-0
lines changed

datadog/fwprovider/framework_provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ var Resources = []func() resource.Resource{
9393
NewSecurityMonitoringRuleJSONResource,
9494
NewComplianceCustomFrameworkResource,
9595
NewCostBudgetResource,
96+
NewTagPipelineRulesetResource,
97+
NewTagPipelineRulesetsResource,
9698
NewCSMThreatsAgentRuleResource,
9799
NewCSMThreatsPolicyResource,
98100
NewAppKeyRegistrationResource,
@@ -101,6 +103,8 @@ var Resources = []func() resource.Resource{
101103
NewIncidentNotificationRuleResource,
102104
NewAwsCurConfigResource,
103105
NewGcpUcConfigResource,
106+
NewDatadogCustomAllocationRuleResource,
107+
NewCustomAllocationRulesResource,
104108
NewAzureUcConfigResource,
105109
NewDeploymentGateResource,
106110
NewDeploymentRuleResource,
@@ -141,13 +145,15 @@ var Datasources = []func() datasource.DataSource{
141145
NewWorkflowAutomationDataSource,
142146
NewDatadogAppBuilderAppDataSource,
143147
NewCostBudgetDataSource,
148+
NewTagPipelineRulesetDataSource,
144149
NewCSMThreatsAgentRulesDataSource,
145150
NewCSMThreatsPoliciesDataSource,
146151
NewIncidentTypeDataSource,
147152
NewIncidentNotificationTemplateDataSource,
148153
NewIncidentNotificationRuleDataSource,
149154
NewDatadogAwsCurConfigDataSource,
150155
NewDatadogGcpUcConfigDataSource,
156+
NewDatadogCustomAllocationRuleDataSource,
151157
NewDatadogAzureUcConfigDataSource,
152158
NewDatadogDeploymentGateDataSource,
153159
NewDatadogDeploymentRuleDataSource,
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "datadog_custom_allocation_rule Data Source - terraform-provider-datadog"
4+
subcategory: ""
5+
description: |-
6+
Use this data source to retrieve information about an existing custom allocation rule.
7+
---
8+
9+
# datadog_custom_allocation_rule (Data Source)
10+
11+
Use this data source to retrieve information about an existing custom allocation rule.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Optional
19+
20+
- `rule_id` (Number) The ID of the custom allocation rule to retrieve.
21+
- `strategy` (Block, Optional) (see [below for nested schema](#nestedblock--strategy))
22+
23+
### Read-Only
24+
25+
- `costs_to_allocate` (Block List) (see [below for nested schema](#nestedblock--costs_to_allocate))
26+
- `created` (String) The timestamp (in ISO 8601 format) when the rule was created.
27+
- `enabled` (Boolean) Whether the custom allocation rule is enabled.
28+
- `id` (String) The ID of this resource.
29+
- `last_modified_user_uuid` (String) The UUID of the user who last modified the rule.
30+
- `order_id` (Number) The order of the rule in the list of custom allocation rules.
31+
- `providernames` (List of String) List of cloud providers the rule applies to (e.g., `aws`, `azure`, `gcp`).
32+
- `rejected` (Boolean) Whether the rule was rejected by Datadog due to runtime errors. This field can be updated well after the rule was created. If rejected this rule is treated as disabled until modified where the rejection status is reset.
33+
- `rule_name` (String) The unique name of the custom allocation rule.
34+
- `type` (String) The type of the custom allocation rule. This is always `shared` currently.
35+
- `updated` (String) The timestamp (in ISO 8601 format) when the rule was last updated.
36+
- `version` (String) The version number of the rule.
37+
38+
<a id="nestedblock--strategy"></a>
39+
### Nested Schema for `strategy`
40+
41+
Optional:
42+
43+
- `based_on_timeseries` (Block, Optional) (see [below for nested schema](#nestedblock--strategy--based_on_timeseries))
44+
45+
Read-Only:
46+
47+
- `allocated_by` (Block List) (see [below for nested schema](#nestedblock--strategy--allocated_by))
48+
- `allocated_by_filters` (Block List) (see [below for nested schema](#nestedblock--strategy--allocated_by_filters))
49+
- `allocated_by_tag_keys` (List of String) List of tag keys used to allocate costs.
50+
- `based_on_costs` (Block List) (see [below for nested schema](#nestedblock--strategy--based_on_costs))
51+
- `evaluate_grouped_by_filters` (Block List) (see [below for nested schema](#nestedblock--strategy--evaluate_grouped_by_filters))
52+
- `evaluate_grouped_by_tag_keys` (List of String) List of tag keys used to group costs before allocation.
53+
- `granularity` (String) The granularity level for cost allocation (`daily` or `monthly`).
54+
- `method` (String) The allocation method. Valid values are `even`, `proportional`, `proportional_timeseries`, or `percent`.
55+
56+
<a id="nestedblock--strategy--based_on_timeseries"></a>
57+
### Nested Schema for `strategy.based_on_timeseries`
58+
59+
60+
<a id="nestedblock--strategy--allocated_by"></a>
61+
### Nested Schema for `strategy.allocated_by`
62+
63+
Read-Only:
64+
65+
- `allocated_tags` (Block List) (see [below for nested schema](#nestedblock--strategy--allocated_by--allocated_tags))
66+
- `percentage` (Number) The percentage of costs allocated to this target as a decimal (e.g., 0.33 for 33%).
67+
68+
<a id="nestedblock--strategy--allocated_by--allocated_tags"></a>
69+
### Nested Schema for `strategy.allocated_by.allocated_tags`
70+
71+
Read-Only:
72+
73+
- `key` (String) The tag key for cost allocation.
74+
- `value` (String) The tag value used in the filter (for single-value conditions).
75+
76+
77+
78+
<a id="nestedblock--strategy--allocated_by_filters"></a>
79+
### Nested Schema for `strategy.allocated_by_filters`
80+
81+
Read-Only:
82+
83+
- `condition` (String) The condition used to match tags. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
84+
- `tag` (String) The tag key used in the filter.
85+
- `value` (String) The tag value used in the filter (for single-value conditions).
86+
- `values` (List of String) The list of tag values used in the filter (for multi-value conditions like `in` or `not_in`).
87+
88+
89+
<a id="nestedblock--strategy--based_on_costs"></a>
90+
### Nested Schema for `strategy.based_on_costs`
91+
92+
Read-Only:
93+
94+
- `condition` (String) The condition used to match tags. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
95+
- `tag` (String) The tag key used in the filter.
96+
- `value` (String) The tag value used in the filter (for single-value conditions).
97+
- `values` (List of String) The list of tag values used in the filter (for multi-value conditions like `in` or `not_in`).
98+
99+
100+
<a id="nestedblock--strategy--evaluate_grouped_by_filters"></a>
101+
### Nested Schema for `strategy.evaluate_grouped_by_filters`
102+
103+
Read-Only:
104+
105+
- `condition` (String) The condition used to match tags. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
106+
- `tag` (String) The tag key used in the filter.
107+
- `value` (String) The tag value used in the filter (for single-value conditions).
108+
- `values` (List of String) The list of tag values used in the filter (for multi-value conditions like `in` or `not_in`).
109+
110+
111+
112+
<a id="nestedblock--costs_to_allocate"></a>
113+
### Nested Schema for `costs_to_allocate`
114+
115+
Read-Only:
116+
117+
- `condition` (String) The condition used to match tags. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
118+
- `tag` (String) The tag key used in the filter.
119+
- `value` (String) The tag value used in the filter (for single-value conditions).
120+
- `values` (List of String) The list of tag values used in the filter (for multi-value conditions like `in` or `not_in`).
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "datadog_tag_pipeline_ruleset Data Source - terraform-provider-datadog"
4+
subcategory: ""
5+
description: |-
6+
Use this data source to retrieve information about an existing Datadog tag pipeline ruleset.
7+
---
8+
9+
# datadog_tag_pipeline_ruleset (Data Source)
10+
11+
Use this data source to retrieve information about an existing Datadog tag pipeline ruleset.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `id` (String) The ID of the ruleset.
21+
22+
### Read-Only
23+
24+
- `enabled` (Boolean) Whether the ruleset is enabled.
25+
- `name` (String) The name of the ruleset.
26+
- `position` (Number) The position of the ruleset in the pipeline.
27+
- `rules` (Block List) The rules in the ruleset. (see [below for nested schema](#nestedblock--rules))
28+
- `version` (Number) The version of the ruleset.
29+
30+
<a id="nestedblock--rules"></a>
31+
### Nested Schema for `rules`
32+
33+
Read-Only:
34+
35+
- `enabled` (Boolean) Whether the rule is enabled.
36+
- `mapping` (Block, Read-only) The mapping configuration for the rule. (see [below for nested schema](#nestedblock--rules--mapping))
37+
- `metadata` (Map of String) Rule metadata key-value pairs.
38+
- `name` (String) The name of the rule.
39+
- `query` (Block, Read-only) The query configuration for the rule. (see [below for nested schema](#nestedblock--rules--query))
40+
- `reference_table` (Block, Read-only) The reference table configuration for the rule. (see [below for nested schema](#nestedblock--rules--reference_table))
41+
42+
<a id="nestedblock--rules--mapping"></a>
43+
### Nested Schema for `rules.mapping`
44+
45+
Read-Only:
46+
47+
- `destination_key` (String) The destination key for the mapping.
48+
- `if_not_exists` (Boolean) Whether to apply the mapping only if the destination key doesn't exist.
49+
- `source_keys` (List of String) The source keys for the mapping.
50+
51+
52+
<a id="nestedblock--rules--query"></a>
53+
### Nested Schema for `rules.query`
54+
55+
Read-Only:
56+
57+
- `addition` (Block, Read-only) The addition configuration for the query. (see [below for nested schema](#nestedblock--rules--query--addition))
58+
- `case_insensitivity` (Boolean) Whether the query matching is case insensitive.
59+
- `if_not_exists` (Boolean) Whether to apply the query only if the key doesn't exist.
60+
- `query` (String) The query string.
61+
62+
<a id="nestedblock--rules--query--addition"></a>
63+
### Nested Schema for `rules.query.addition`
64+
65+
Read-Only:
66+
67+
- `key` (String) The key to add.
68+
- `value` (String) The value to add.
69+
70+
71+
72+
<a id="nestedblock--rules--reference_table"></a>
73+
### Nested Schema for `rules.reference_table`
74+
75+
Read-Only:
76+
77+
- `case_insensitivity` (Boolean) Whether the reference table lookup is case insensitive.
78+
- `field_pairs` (Block List) The field pairs for the reference table. (see [below for nested schema](#nestedblock--rules--reference_table--field_pairs))
79+
- `if_not_exists` (Boolean) Whether to apply the reference table only if the key doesn't exist.
80+
- `source_keys` (List of String) The source keys for the reference table lookup.
81+
- `table_name` (String) The name of the reference table.
82+
83+
<a id="nestedblock--rules--reference_table--field_pairs"></a>
84+
### Nested Schema for `rules.reference_table.field_pairs`
85+
86+
Read-Only:
87+
88+
- `input_column` (String) The input column name.
89+
- `output_key` (String) The output key name.
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "datadog_custom_allocation_rule Resource - terraform-provider-datadog"
4+
subcategory: ""
5+
description: |-
6+
Provides a Datadog Custom Allocation Rule resource. Custom allocation rules allow you to allocate cloud costs based on tags and filters.
7+
---
8+
9+
# datadog_custom_allocation_rule (Resource)
10+
11+
Provides a Datadog Custom Allocation Rule resource. Custom allocation rules allow you to allocate cloud costs based on tags and filters.
12+
13+
## Example Usage
14+
15+
```terraform
16+
# Create new datadog_custom_allocation_rule resource
17+
18+
resource "datadog_custom_allocation_rule" "my_allocation_rule" {
19+
costs_to_allocate {
20+
condition = "is"
21+
tag = "aws_product"
22+
value = "ec2"
23+
}
24+
enabled = true
25+
providernames = ["aws"]
26+
rule_name = "my-allocation-rule"
27+
strategy {
28+
allocated_by_tag_keys = ["team"]
29+
based_on_costs {
30+
condition = "is"
31+
tag = "env"
32+
value = "prod"
33+
}
34+
granularity = "daily"
35+
method = "even"
36+
}
37+
}
38+
```
39+
40+
<!-- schema generated by tfplugindocs -->
41+
## Schema
42+
43+
### Required
44+
45+
- `enabled` (Boolean) Whether the custom allocation rule is enabled.
46+
- `providernames` (List of String) List of cloud providers the rule applies to. Valid values include `aws`, `azure`, and `gcp`.
47+
- `rule_name` (String) The name of the custom allocation rule. This field is immutable - changing it will force replacement of the resource.
48+
49+
### Optional
50+
51+
- `costs_to_allocate` (Block List) (see [below for nested schema](#nestedblock--costs_to_allocate))
52+
- `strategy` (Block, Optional) (see [below for nested schema](#nestedblock--strategy))
53+
54+
### Read-Only
55+
56+
- `created` (String) The timestamp (in ISO 8601 format) when the rule was created.
57+
- `id` (String) The ID of this resource.
58+
- `last_modified_user_uuid` (String) The UUID of the user who last modified the rule.
59+
- `order_id` (Number) The order of the rule in the list of custom allocation rules. This field is read-only. Use the `datadog_custom_allocation_rules` resource to manage rule order.
60+
- `rejected` (Boolean) Whether the rule was rejected by the API during creation due to validation errors. This field is read-only.
61+
- `updated` (String) The timestamp (in ISO 8601 format) when the rule was last updated.
62+
- `version` (Number) The version number of the rule. This increments each time the rule is updated.
63+
64+
<a id="nestedblock--costs_to_allocate"></a>
65+
### Nested Schema for `costs_to_allocate`
66+
67+
Optional:
68+
69+
- `condition` (String) The condition to match. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
70+
- `tag` (String) The tag key to filter on (e.g., `aws_product`, `team`, `environment`).
71+
- `value` (String) The single tag value to match. Use this field for conditions like `=`, `!=`, `is`, `is not`, `like`. Do not use with `in` or `not in` conditions.
72+
- `values` (List of String) A list of tag values to match. Use this field for `in` or `not in` conditions only. Do not use with single-value conditions.
73+
74+
75+
<a id="nestedblock--strategy"></a>
76+
### Nested Schema for `strategy`
77+
78+
Optional:
79+
80+
- `allocated_by` (Block List) (see [below for nested schema](#nestedblock--strategy--allocated_by))
81+
- `allocated_by_filters` (Block List) (see [below for nested schema](#nestedblock--strategy--allocated_by_filters))
82+
- `allocated_by_tag_keys` (List of String) List of tag keys used to allocate costs (e.g., `["team", "project"]`). Costs will be distributed across unique values of these tags.
83+
- `based_on_costs` (Block List) (see [below for nested schema](#nestedblock--strategy--based_on_costs))
84+
- `based_on_timeseries` (Block, Optional) (see [below for nested schema](#nestedblock--strategy--based_on_timeseries))
85+
- `evaluate_grouped_by_filters` (Block List) (see [below for nested schema](#nestedblock--strategy--evaluate_grouped_by_filters))
86+
- `evaluate_grouped_by_tag_keys` (List of String) List of tag keys used to group costs before allocation. Costs are grouped by these tag values before applying the allocation strategy.
87+
- `granularity` (String) The granularity level for cost allocation. Valid values are `daily` or `monthly`.
88+
- `method` (String) The allocation method. Valid values are `even`, `proportional`, `proportional_timeseries`, or `percent`.
89+
90+
<a id="nestedblock--strategy--allocated_by"></a>
91+
### Nested Schema for `strategy.allocated_by`
92+
93+
Optional:
94+
95+
- `allocated_tags` (Block List) (see [below for nested schema](#nestedblock--strategy--allocated_by--allocated_tags))
96+
- `percentage` (Number) The percentage of costs to allocate to this target as a decimal (e.g., 0.33 for 33%). Used when `method` is `percent`.
97+
98+
<a id="nestedblock--strategy--allocated_by--allocated_tags"></a>
99+
### Nested Schema for `strategy.allocated_by.allocated_tags`
100+
101+
Optional:
102+
103+
- `key` (String) The tag key to allocate costs to (e.g., `team`, `environment`).
104+
- `value` (String) The tag value to allocate costs to (e.g., `backend`, `production`).
105+
106+
107+
108+
<a id="nestedblock--strategy--allocated_by_filters"></a>
109+
### Nested Schema for `strategy.allocated_by_filters`
110+
111+
Optional:
112+
113+
- `condition` (String) The condition to match. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
114+
- `tag` (String) The tag key to filter on for allocation targets.
115+
- `value` (String) The single tag value to match for allocation. Use with conditions like `=`, `!=`, `is`, `is not`, `like`.
116+
- `values` (List of String) A list of tag values to match for allocation. Use with `in` or `not in` conditions.
117+
118+
119+
<a id="nestedblock--strategy--based_on_costs"></a>
120+
### Nested Schema for `strategy.based_on_costs`
121+
122+
Optional:
123+
124+
- `condition` (String) The condition to match. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
125+
- `tag` (String) The tag key to use as the basis for cost allocation calculations.
126+
- `value` (String) The single tag value to use for cost calculations. Use with conditions like `=`, `!=`, `is`, `is not`, `like`.
127+
- `values` (List of String) A list of tag values to use for cost calculations. Use with `in` or `not in` conditions.
128+
129+
130+
<a id="nestedblock--strategy--based_on_timeseries"></a>
131+
### Nested Schema for `strategy.based_on_timeseries`
132+
133+
134+
<a id="nestedblock--strategy--evaluate_grouped_by_filters"></a>
135+
### Nested Schema for `strategy.evaluate_grouped_by_filters`
136+
137+
Optional:
138+
139+
- `condition` (String) The condition to match. Valid values are `=`, `!=`, `is`, `is not`, `like`, `in`, `not in`.
140+
- `tag` (String) The tag key to filter on when grouping costs for evaluation.
141+
- `value` (String) The single tag value to match when grouping. Use with conditions like `=`, `!=`, `is`, `is not`, `like`.
142+
- `values` (List of String) A list of tag values to match when grouping. Use with `in` or `not in` conditions.
143+
144+
## Import
145+
146+
Import is supported using the following syntax:
147+
148+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
149+
150+
```shell
151+
terraform import datadog_custom_allocation_rule.new_list <rule_id>
152+
```

0 commit comments

Comments
 (0)