Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions docs/data-sources/volume_automation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_volume_automation Data Source - stackit"
subcategory: ""
description: |-
Volume automation datasource schema. Must have a region specified in the provider configuration.
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
---

# stackit_volume_automation (Data Source)

Volume automation datasource schema. Must have a `region` specified in the provider configuration.

~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.

## Example Usage

```terraform
data "stackit_volume_automation" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
automation_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `automation_id` (String) ID of the volume automation.
- `project_id` (String) STACKIT Project ID to which the volume automation is associated.

### Optional

- `region` (String) The resource region. If not defined, the provider region is used.

### Read-Only

- `description` (String) The volume automation description.
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`automation_id`".
- `input` (String) Configuration input for the volume automation. See [API Docs](https://docs.api.stackit.cloud/documentation/automation-service/version/v1#tag/Volume-Automations/operation/CreateVolumeAutomation) for possible configuration options.
- `name` (String) The volume automation name.
- `template_id` (String) ID of the automation template this volume automation is based on.
- `triggers` (Attributes) Triggers that determine when the automation runs. (see [below for nested schema](#nestedatt--triggers))

<a id="nestedatt--triggers"></a>
### Nested Schema for `triggers`

Read-Only:

- `schedule` (Attributes) Runs the automation on a recurring schedule. (see [below for nested schema](#nestedatt--triggers--schedule))

<a id="nestedatt--triggers--schedule"></a>
### Nested Schema for `triggers.schedule`

Read-Only:

- `rrule` (String) An `rrule` (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates.
92 changes: 92 additions & 0 deletions docs/resources/volume_automation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_volume_automation Resource - stackit"
subcategory: ""
description: |-
Volume automation resource schema. Must have a region specified in the provider configuration.
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
---

# stackit_volume_automation (Resource)

Volume automation resource schema. Must have a `region` specified in the provider configuration.

~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.

## Example Usage

```terraform
resource "stackit_volume_automation" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
template_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-volume-automation"
description = "Creates daily volume snapshots and keeps the last 7."
input = jsonencode({
kind = "VolumeRecoveryPointManagement"
inheritVolumeLabels = false
recoveryPointLabels = {
"exampleLabelKey1" = "exampleLabelValue1"
"exampleLabelKey2" = "exampleLabelValue2"
}
snapshotRetentionPolicy = {
kind = "count"
value = 2
}
volumeLabelSelector = "myLabelkey1=myLabelValue,myLabelKey2=myOtherLabelValue"
})
triggers = {
schedule = {
rrule = "DTSTART;TZID=Europe/Sofia:20200803T023000 RRULE:FREQ=DAILY;INTERVAL=1"
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project_id` (String) STACKIT Project ID to which the volume automation is associated.
- `template_id` (String) ID of the automation template this volume automation is based on.

### Optional

- `description` (String) The volume automation description.
- `input` (String) Configuration input for the volume automation. See [API Docs](https://docs.api.stackit.cloud/documentation/automation-service/version/v1#tag/Volume-Automations/operation/CreateVolumeAutomation) for possible configuration options.
- `name` (String) The volume automation name.
- `region` (String) The resource region. If not defined, the provider region is used.
- `triggers` (Attributes) Triggers that determine when the automation runs. (see [below for nested schema](#nestedatt--triggers))

### Read-Only

- `automation_id` (String) ID of the volume automation.
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`automation_id`".

<a id="nestedatt--triggers"></a>
### Nested Schema for `triggers`

Optional:

- `schedule` (Attributes) Runs the automation on a recurring schedule. (see [below for nested schema](#nestedatt--triggers--schedule))

<a id="nestedatt--triggers--schedule"></a>
### Nested Schema for `triggers.schedule`

Required:

- `rrule` (String) An `rrule` (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates.

## Import

Import is supported using the following syntax:

In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example:

```terraform
# Only use the import statement, if you want to import an existing volume automation resource
import {
to = stackit_volume_automation.import-example
id = "${var.project_id},${var.region},${var.automation_id}"
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "stackit_volume_automation" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
automation_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Only use the import statement, if you want to import an existing volume automation resource
import {
to = stackit_volume_automation.import-example
id = "${var.project_id},${var.region},${var.automation_id}"
}
24 changes: 24 additions & 0 deletions examples/resources/stackit_volume_automation/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resource "stackit_volume_automation" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
template_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-volume-automation"
description = "Creates daily volume snapshots and keeps the last 7."
input = jsonencode({
kind = "VolumeRecoveryPointManagement"
inheritVolumeLabels = false
recoveryPointLabels = {
"exampleLabelKey1" = "exampleLabelValue1"
"exampleLabelKey2" = "exampleLabelValue2"
}
snapshotRetentionPolicy = {
kind = "count"
value = 2
}
volumeLabelSelector = "myLabelkey1=myLabelValue,myLabelKey2=myOtherLabelValue"
})
triggers = {
schedule = {
rrule = "DTSTART;TZID=Europe/Sofia:20200803T023000 RRULE:FREQ=DAILY;INTERVAL=1"
}
}
}
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/hashicorp/terraform-plugin-framework v1.19.0
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0
github.com/hashicorp/terraform-plugin-framework-timeouts v0.7.0
github.com/hashicorp/terraform-plugin-framework-validators v0.19.0
github.com/hashicorp/terraform-plugin-go v0.31.0
Expand All @@ -15,7 +16,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/core v0.27.0
github.com/stackitcloud/stackit-sdk-go/services/alb v0.17.2
github.com/stackitcloud/stackit-sdk-go/services/albwaf v0.13.4
github.com/stackitcloud/stackit-sdk-go/services/automation v0.1.1
github.com/stackitcloud/stackit-sdk-go/services/automation v0.2.0
github.com/stackitcloud/stackit-sdk-go/services/cdn v1.21.0
github.com/stackitcloud/stackit-sdk-go/services/certificates v1.9.2
github.com/stackitcloud/stackit-sdk-go/services/dns v0.23.1
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ github.com/hashicorp/terraform-json v0.28.0 h1:dOkJT55rWfU6T1/VklHde51ym4LfNP+9x
github.com/hashicorp/terraform-json v0.28.0/go.mod h1:PJIRf+Yzu5iLb52c/xYp1tUOL4jzMzfIAB5gvWWKIWE=
github.com/hashicorp/terraform-plugin-framework v1.19.0 h1:q0bwyhxAOR3vfdgbk9iplv3MlTv/dhBHTXjQOtQDoBA=
github.com/hashicorp/terraform-plugin-framework v1.19.0/go.mod h1:YRXOBu0jvs7xp4AThBbX4mAzYaMJ1JgtFH//oGKxwLc=
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0 h1:SJXL5FfJJm17554Kpt9jFXngdM6fXbnUnZ6iT2IeiYA=
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0/go.mod h1:p0phD0IYhsu9bR4+6OetVvvH59I6LwjXGnTVEr8ox6E=
github.com/hashicorp/terraform-plugin-framework-timeouts v0.7.0 h1:jblRy1PkLfPm5hb5XeMa3tezusnMRziUGqtT5epSYoI=
github.com/hashicorp/terraform-plugin-framework-timeouts v0.7.0/go.mod h1:5jm2XK8uqrdiSRfD5O47OoxyGMCnwTcl8eoiDgSa+tc=
github.com/hashicorp/terraform-plugin-framework-validators v0.19.0 h1:Zz3iGgzxe/1XBkooZCewS0nJAaCFPFPHdNJd8FgE4Ow=
Expand Down Expand Up @@ -161,8 +163,8 @@ github.com/stackitcloud/stackit-sdk-go/services/albwaf v0.13.4 h1:KNEcAPj66Asb00
github.com/stackitcloud/stackit-sdk-go/services/albwaf v0.13.4/go.mod h1:riXgEDfIjNdFjYk81zNnWt0npkv1+/P1iFRfFIt28Jo=
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.15.4 h1:YRfEQJxMn9B/yCf5ZGTsBzPLv69LM/jvvLuC8vb0Uf4=
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.15.4/go.mod h1:AVLUwOPKsoz6HvKzClu0a5OTjMOYS696gRjHUQvQH70=
github.com/stackitcloud/stackit-sdk-go/services/automation v0.1.1 h1:naKG2lRw9ALCNaaJabhgtuCwSBVyOOlIX3NPkIFX1i0=
github.com/stackitcloud/stackit-sdk-go/services/automation v0.1.1/go.mod h1:1vv2SZorcHJKxEPV15CnTDhavV+NcYSNjAX7cZGX31k=
github.com/stackitcloud/stackit-sdk-go/services/automation v0.2.0 h1:X3tnz8Aij3fRk0vx7Ekvt5ONnP+ACMqwrBuKftHJJdY=
github.com/stackitcloud/stackit-sdk-go/services/automation v0.2.0/go.mod h1:1vv2SZorcHJKxEPV15CnTDhavV+NcYSNjAX7cZGX31k=
github.com/stackitcloud/stackit-sdk-go/services/cdn v1.21.0 h1:lCs1eq/OOTdwGrrkxkJ8qCnS6yLM4XZhznpML3nd1NI=
github.com/stackitcloud/stackit-sdk-go/services/cdn v1.21.0/go.mod h1:NBgvZH5ekJ2hFCNI480C9MdJsa4989YGC1YgX5ELA48=
github.com/stackitcloud/stackit-sdk-go/services/certificates v1.9.2 h1:QEKzHzVwZ80mNdoEWEZxgynACnlPfXwIlVz9b7xceR4=
Expand Down
Loading
Loading