Skip to content

Commit

Permalink
ref 635294: server update schedules
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Nackov <[email protected]>
  • Loading branch information
aeter committed Dec 3, 2024
1 parent 58e99b4 commit 0d6422b
Show file tree
Hide file tree
Showing 20 changed files with 1,622 additions and 2 deletions.
12 changes: 11 additions & 1 deletion docs/data-sources/resourcemanager_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ data "stackit_resourcemanager_project" "example" {
```

<!-- schema generated by tfplugindocs -->

## Schema

### Optional
Expand All @@ -33,5 +32,16 @@ data "stackit_resourcemanager_project" "example" {

- `id` (String) Terraform's internal data source. ID. It is structured as "`container_id`".
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}
- `members` (Attributes List, Deprecated) The members assigned to the project. At least one subject needs to be a user, and not a client or service account. This value is only considered during creation. Changing it afterwards will have no effect.

!> The "members" field has been deprecated in favor of the "owner_email" field. Please use the "owner_email" field to assign the owner role to a user. (see [below for nested schema](#nestedatt--members))
- `name` (String) Project name.
- `parent_container_id` (String) Parent resource identifier. Both container ID (user-friendly) and UUID are supported

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

Read-Only:

- `role` (String) The role of the member in the project. Legacy roles (`project.admin`, `project.auditor`, `project.member`, `project.owner`) are not supported.
- `subject` (String) Unique identifier of the user, service account or client. This is usually the email address for users or service accounts, and the name in case of clients.
41 changes: 41 additions & 0 deletions docs/data-sources/server_update_schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_server_update_schedule Data Source - stackit"
subcategory: ""
description: |-
Server update schedule datasource 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_server_update_schedule (Data Source)

Server update schedule datasource 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
data "stackit_server_update_schedule" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
update_schedule_id = xxxxx
}
```

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

### Required

- `project_id` (String) STACKIT Project ID to which the server is associated.
- `server_id` (String) Server ID for the update schedule.
- `update_schedule_id` (Number) Update schedule ID.

### Read-Only

- `enabled` (Boolean) Is the update schedule enabled or disabled.
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`server_id`,`update_schedule_id`".
- `maintenance_window` (Number) Maintenance window [1..24].
- `name` (String) The schedule name.
- `rrule` (String) Update schedule described in `rrule` (recurrence rule) format.
47 changes: 47 additions & 0 deletions docs/data-sources/server_update_schedules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_server_update_schedules Data Source - stackit"
subcategory: ""
description: |-
Server update schedules datasource 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_server_update_schedules (Data Source)

Server update schedules datasource 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
data "stackit_server_update_schedules" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

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

### Required

- `project_id` (String) STACKIT Project ID (UUID) to which the server is associated.
- `server_id` (String) Server ID (UUID) to which the update schedule is associated.

### Read-Only

- `id` (String) Terraform's internal data source identifier. It is structured as "`project_id`,`server_id`".
- `items` (Attributes List) (see [below for nested schema](#nestedatt--items))

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

Read-Only:

- `enabled` (Boolean) Is the update schedule enabled or disabled.
- `maintenance_window` (Number) Maintenance window [1..24].
- `name` (String) The update schedule name.
- `rrule` (String) Update schedule described in `rrule` (recurrence rule) format.
- `update_schedule_id` (Number)
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
- `resourcemanager_custom_endpoint` (String) Custom endpoint for the Resource Manager service
- `secretsmanager_custom_endpoint` (String) Custom endpoint for the Secrets Manager service
- `server_backup_custom_endpoint` (String) Custom endpoint for the Server Backup service
- `server_update_custom_endpoint` (String) Custom endpoint for the Server Update service
- `service_account_email` (String) Service account email. It can also be set using the environment variable STACKIT_SERVICE_ACCOUNT_EMAIL. It is required if you want to use the resource manager project resource.
- `service_account_key` (String) Service account key used for authentication. If set, the key flow will be used to authenticate all operations.
- `service_account_key_path` (String) Path for the service account key used for authentication. If set, the key flow will be used to authenticate all operations.
Expand Down
11 changes: 11 additions & 0 deletions docs/resources/resourcemanager_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@ resource "stackit_resourcemanager_project" "example" {
### Optional

- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}
- `members` (Attributes List, Deprecated) The members assigned to the project. At least one subject needs to be a user, and not a client or service account. This value is only considered during creation. Changing it afterwards will have no effect.

!> The "members" field has been deprecated in favor of the "owner_email" field. Please use the "owner_email" field to assign the owner role to a user. (see [below for nested schema](#nestedatt--members))

### Read-Only

- `container_id` (String) Project container ID. Globally unique, user-friendly identifier.
- `id` (String) Terraform's internal resource ID. It is structured as "`container_id`".
- `project_id` (String) Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project.

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

Required:

- `role` (String) The role of the member in the project. Possible values include, but are not limited to: `owner`, `editor`, `reader`. Legacy roles (`project.admin`, `project.auditor`, `project.member`, `project.owner`) are not supported.
- `subject` (String) Unique identifier of the user, service account or client. This is usually the email address for users or service accounts, and the name in case of clients.
44 changes: 44 additions & 0 deletions docs/resources/server_update_schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_server_update_schedule Resource - stackit"
subcategory: ""
description: |-
Server update schedule 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_server_update_schedule (Resource)

Server update schedule 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_server_update_schedule" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example_update_schedule_name"
rrule = "DTSTART;TZID=Europe/Sofia:20200803T023000 RRULE:FREQ=DAILY;INTERVAL=1"
enabled = true
maintenance_window = 1
}
```

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

### Required

- `enabled` (Boolean) Is the update schedule enabled or disabled.
- `maintenance_window` (Number) Maintenance window [1..24].
- `name` (String) The schedule name.
- `project_id` (String) STACKIT Project ID to which the server is associated.
- `rrule` (String) Update schedule described in `rrule` (recurrence rule) format.
- `server_id` (String) Server ID for the update schedule.

### Read-Only

- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`server_id`,`update_schedule_id`".
- `update_schedule_id` (Number) Update schedule ID.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "stackit_server_update_schedule" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
update_schedule_id = xxxxx
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "stackit_server_update_schedules" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
8 changes: 8 additions & 0 deletions examples/resources/stackit_server_update_schedule/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "stackit_server_update_schedule" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example_update_schedule_name"
rrule = "DTSTART;TZID=Europe/Sofia:20200803T023000 RRULE:FREQ=DAILY;INTERVAL=1"
enabled = true
maintenance_window = 1
}
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ require (
golang.org/x/mod v0.22.0
)

require github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
require (
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v0.2.2 // indirect
)

require (
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.10.0 h1:HrnEgR
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.10.0/go.mod h1:268uoY2gKCa5xcDL169TGVjLUNTcZ2En77YdfYOcR1w=
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v0.3.0 h1:Tlps8vBQmQ1mx2YFbzOzMIyWtXGJy7X3N9Qk3qk88Cc=
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v0.3.0/go.mod h1:+807U5ZLXns+CEbyIg483wNEwV10vaN6GjMnSZhw/64=
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v0.1.0 h1:jTGCE71TX/Hafp6FqM/wIiHcTWreAktnmqEi4g97SGk=
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v0.1.0/go.mod h1:etidTptNDvvCPA1FGC7T9DXHxXA4bYW3qIUzWG8wVcc=
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v0.2.1 h1:fzYC2JifJUJ37mAKjGOEbNFjgK+DQRwjkoJ7NDXaQvQ=
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v0.2.1/go.mod h1:etidTptNDvvCPA1FGC7T9DXHxXA4bYW3qIUzWG8wVcc=
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v0.2.2 h1:HXZ/hjO3shFPLrrmSb1G9eXDCSYrMeYveklm6rEUd0Y=
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v0.2.2/go.mod h1:etidTptNDvvCPA1FGC7T9DXHxXA4bYW3qIUzWG8wVcc=
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.3.0 h1:6IZBX9fyza9Eln3FHGHquvLNXQslk+dtkQp41G9+7+Y=
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.3.0/go.mod h1:zyg0hpiNdZLRbelkJb2KDf9OHQKLqqcTpePQ1qHL5dE=
github.com/stackitcloud/stackit-sdk-go/services/ske v0.20.0 h1:ssEywzCS8IdRtzyxweLUKBG5GFbgwjNWJh++wGqigJM=
Expand Down
1 change: 1 addition & 0 deletions stackit/internal/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type ProviderData struct {
SecretsManagerCustomEndpoint string
SQLServerFlexCustomEndpoint string
ServerBackupCustomEndpoint string
ServerUpdateCustomEndpoint string
SKECustomEndpoint string
ServiceEnablementCustomEndpoint string
EnableBetaResources bool
Expand Down
Loading

0 comments on commit 0d6422b

Please sign in to comment.