Skip to content

Commit

Permalink
Documentation with requiered and default values
Browse files Browse the repository at this point in the history
  • Loading branch information
dianibar committed Jan 3, 2024
1 parent 85059f6 commit a2b0750
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 73 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {
required_providers {
doit = {
source = "doitintl/doit"
version = "0.5.0"
version = "0.7.0"
}
}
}
Expand Down
38 changes: 21 additions & 17 deletions docs/resources/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Optional:
<a id="nestedatt--config--dimensions"></a>
### Nested Schema for `config.dimensions`

Optional:
Required:

- `id` (String)
- `type` (String)
Expand All @@ -135,24 +135,27 @@ Optional:

Required:

- `id` (String) What field we are filtering on
- `type` (String)
- `values` (List of String) What values to filter on or exclude

Optional:

- `id` (String) What field we are filtering on
- `inverse` (Boolean) If set, exclude the values
- `type` (String)


<a id="nestedatt--config--group"></a>
### Nested Schema for `config.group`

Optional:
Required:

- `id` (String)
- `limit` (Attributes) (see [below for nested schema](#nestedatt--config--group--limit))
- `type` (String)

Optional:

- `limit` (Attributes) (see [below for nested schema](#nestedatt--config--group--limit))

<a id="nestedatt--config--group--limit"></a>
### Nested Schema for `config.group.limit`

Expand All @@ -165,7 +168,7 @@ Optional:
<a id="nestedatt--config--group--limit--metric"></a>
### Nested Schema for `config.group.limit.value`

Optional:
Required:

- `type` (String)
- `value` (String)
Expand All @@ -176,7 +179,7 @@ Optional:
<a id="nestedatt--config--metric"></a>
### Nested Schema for `config.metric`

Optional:
Required:

- `type` (String)
- `value` (String) For basic metrics the value can be one of: ["cost", "usage", "savings"
Expand All @@ -188,17 +191,14 @@ If using custom metrics, the value must refer to an existing custom or calculate

Required:

- `values` (List of Number)

Optional:

- `metric` (Attributes) (see [below for nested schema](#nestedatt--config--metric_filter--metric))
- `operator` (String)
- `values` (List of Number)

<a id="nestedatt--config--metric_filter--metric"></a>
### Nested Schema for `config.metric_filter.metric`

Optional:
Required:

- `type` (String)
- `value` (String)
Expand All @@ -208,19 +208,19 @@ Optional:
<a id="nestedatt--config--splits"></a>
### Nested Schema for `config.splits`

Optional:
Required:

- `id` (String)
- `include_origin` (Boolean)
- `mode` (String)
- `origin` (Attributes) (see [below for nested schema](#nestedatt--config--splits--origin))
- `targets` (Attributes List) (see [below for nested schema](#nestedatt--config--splits--targets))
- `type` (String)
- `type` (String) Type of the split.The only supported value at the moment: "attribution_group"

<a id="nestedatt--config--splits--origin"></a>
### Nested Schema for `config.splits.origin`

Optional:
Required:

- `id` (String)
- `type` (String)
Expand All @@ -229,19 +229,23 @@ Optional:
<a id="nestedatt--config--splits--targets"></a>
### Nested Schema for `config.splits.targets`

Optional:
Required:

- `id` (String)
- `type` (String)
- `value` (Number) Percent of the target, represented in float format. E.g. 30% is 0.3. Must be set only if Split Mode is custom



<a id="nestedatt--config--time_range"></a>
### Nested Schema for `config.time_range`

Required:

- `mode` (String)

Optional:

- `amount` (Number)
- `include_current` (Boolean)
- `mode` (String)
- `unit` (String)
32 changes: 16 additions & 16 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
}

resource "doit_report" "my-report" {
name = "test-pod-1.cs.playgrounds.doit.com"
name = "test-pod-1.cs.playgrounds.doit.com"
description = "Playground usage for sg-pod-1.cs. Autogenerated by Arbiter. DO NOT MODIFY!"
config = {
metric = {
Expand Down Expand Up @@ -36,12 +36,12 @@ resource "doit_report" "my-report" {
amount = 7
include_current = true
unit = "day"
}
}
include_promotional_credits = false
filters = [
{
id = "attribution"
type = "attribution"
id = "attribution"
type = "attribution"
values = [
"1CE699ZdwN5CRBw0tInY"
]
Expand All @@ -52,24 +52,24 @@ resource "doit_report" "my-report" {
id = "BSQZmvX6hvuKGPDHX7R3"
type = "attribution_group"
limit = {
value = 3
sort = "a_to_z"
metric = {
type = "basic"
value = "cost"
}
value = 3
sort = "a_to_z"
metric = {
type = "basic"
value = "cost"
}
}
},
{
id = "cloud_provider"
type = "fixed"
limit = {
value = 10
sort = "a_to_z"
metric = {
type = "basic"
value = "cost"
}
value = 10
sort = "a_to_z"
metric = {
type = "basic"
value = "cost"
}
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
doit = {
source = "doitintl/doit"
version = "0.5.0"
version = "0.7.0"
}
}
}
Expand Down
Loading

0 comments on commit a2b0750

Please sign in to comment.