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
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ $ TF_ACC=1 \

For some services the acceptance tests take more time. By setting the timeout via the flag `-timeout=` to a higher time, you ensure that the tests will not be stopped.

## Migration

For guidance on how to migrate to using this provider, please see our [Migration Guide](./MIGRATION.md).

## Reporting Issues

If you encounter any issues or have suggestions for improvements, please open an issue in the [repository](https://github.com/stackitcloud/terraform-provider-stackit/issues).
Expand Down
45 changes: 45 additions & 0 deletions docs/data-sources/valkey_credential.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_valkey_credential Data Source - stackit"
subcategory: ""
description: |-
Valkey credential data source schema. Must have a region specified in the provider configuration.
---

# stackit_valkey_credential (Data Source)

Valkey credential data source schema. Must have a `region` specified in the provider configuration.

## Example Usage

```terraform
data "stackit_valkey_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

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

### Required

- `credential_id` (String) The credential's ID.
- `instance_id` (String) ID of the Valkey instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.

### Optional

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

### Read-Only

- `host` (String)
- `hosts` (List of String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`region`,`instance_id`,`credential_id`".
- `load_balanced_host` (String)
- `password` (String, Sensitive)
- `port` (Number)
- `uri` (String, Sensitive) Connection URI.
- `username` (String)
73 changes: 73 additions & 0 deletions docs/data-sources/valkey_instance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_valkey_instance Data Source - stackit"
subcategory: ""
description: |-
Valkey instance data source schema. Must have a region specified in the provider configuration.
---

# stackit_valkey_instance (Data Source)

Valkey instance data source schema. Must have a `region` specified in the provider configuration.

## Example Usage

```terraform
data "stackit_valkey_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

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

### Required

- `instance_id` (String) ID of the Valkey instance.
- `project_id` (String) STACKIT Project ID to which the instance is associated.

### Optional

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

### Read-Only

- `cf_guid` (String)
- `cf_organization_guid` (String)
- `cf_space_guid` (String)
- `dashboard_url` (String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`region`,`instance_id`".
- `image_url` (String)
- `name` (String) Instance name.
- `parameters` (Attributes) (see [below for nested schema](#nestedatt--parameters))
- `plan_id` (String) The selected plan ID.
- `plan_name` (String) The selected plan name.
- `version` (String) The service version.

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

Read-Only:

- `down_after_milliseconds` (Number) The number of milliseconds after which the instance is considered down.
- `enable_monitoring` (Boolean) Enable monitoring.
- `failover_timeout` (Number) The failover timeout in milliseconds.
- `graphite` (String) Graphite server URL (host and port). If set, monitoring with Graphite will be enabled.
- `lazyfree_lazy_eviction` (String) The lazy eviction enablement (yes or no).
- `lazyfree_lazy_expire` (String) The lazy expire enablement (yes or no).
- `lua_time_limit` (Number) The Lua time limit.
- `max_disk_threshold` (Number) The maximum disk threshold in MB. If the disk usage exceeds this threshold, the instance will be stopped.
- `maxclients` (Number) The maximum number of clients.
- `maxmemory_policy` (String) The policy to handle the maximum memory (volatile-lru, noeviction, etc).
- `maxmemory_samples` (Number) The maximum memory samples.
- `metrics_frequency` (Number) The frequency in seconds at which metrics are emitted.
- `metrics_prefix` (String) The prefix for the metrics. Could be useful when using Graphite monitoring to prefix the metrics with a certain value, like an API key.
- `min_replicas_max_lag` (Number) The minimum replicas maximum lag.
- `min_replicas_to_write` (Number) The amount of connected replicas that are required for the primary to accept write operations. It can be set to 0 to disable it.
- `monitoring_instance_id` (String) The ID of the STACKIT monitoring instance.
- `notify_keyspace_events` (String) The notify keyspace events.
- `repl_backlog_size` (String) The replication backlog size for the cluster.
- `sgw_acl` (String) Comma separated list of IP networks in CIDR notation which are allowed to access this instance.
- `snapshot` (String) The snapshot configuration.
- `syslog` (List of String) List of syslog servers to send logs to.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,5 @@ See this [example](https://professional-service.git.onstackit.cloud/professional
- `telemetryrouter_custom_endpoint` (String) Custom endpoint for the Telemetry Router service
- `token_custom_endpoint` (String) Custom endpoint for the token API, which is used to request access tokens when using the key flow
- `use_oidc` (Boolean) Enables OIDC for Authentication. This can also be sourced from the `STACKIT_USE_OIDC` Environment Variable. Defaults to `false`.
- `valkey_custom_endpoint` (String) Custom endpoint for the Key Value Store service
- `vpn_custom_endpoint` (String) Custom endpoint for the VPN service
72 changes: 72 additions & 0 deletions docs/resources/valkey_credential.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_valkey_credential Resource - stackit"
subcategory: ""
description: |-
Valkey credential resource schema. Must have a region specified in the provider configuration.
---

# stackit_valkey_credential (Resource)

Valkey credential resource schema. Must have a `region` specified in the provider configuration.

## Example Usage

```terraform
resource "stackit_valkey_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

resource "time_rotating" "rotate" {
rotation_days = 80
}

resource "stackit_valkey_credential" "example_rotate" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

rotate_when_changed = {
rotation = time_rotating.rotate.id
}
}
```

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

### Required

- `instance_id` (String) ID of the Valkey instance.
- `project_id` (String) STACKIT Project ID to which the instance is associated.

### Optional

- `region` (String) The resource region. If not defined, the provider region is used.
- `rotate_when_changed` (Map of String) A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.

### Read-Only

- `credential_id` (String) The credential's ID.
- `host` (String)
- `hosts` (List of String)
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`instance_id`,`credential_id`".
- `load_balanced_host` (String)
- `password` (String, Sensitive)
- `port` (Number)
- `uri` (String, Sensitive) Connection URI.
- `username` (String)

## 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 valkey credential
import {
to = stackit_valkey_credential.import-example
id = "${var.project_id},${var.region},${var.valkey_instance_id},${var.valkey_credential_id}"
}
```
95 changes: 95 additions & 0 deletions docs/resources/valkey_instance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_valkey_instance Resource - stackit"
subcategory: ""
description: |-
Valkey instance resource schema. Must have a region specified in the provider configuration.
---

# stackit_valkey_instance (Resource)

Valkey instance resource schema. Must have a `region` specified in the provider configuration.

## Example Usage

```terraform
resource "stackit_valkey_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
version = "x"
plan_name = "stackit-keyvalue-1.2.10-replica"
parameters = {
sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22"
enable_monitoring = false
down_after_milliseconds = 30000
syslog = ["logs4.your-syslog-endpoint.com:54321"]
}
}
```

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

### Required

- `name` (String) Instance name.
- `plan_name` (String) The selected plan name.
- `project_id` (String) STACKIT project ID to which the instance is associated.
- `version` (String) The service version.

### Optional

- `parameters` (Attributes) Configuration parameters. Please note that removing a previously configured field from your Terraform configuration won't replace its value in the API. To update a previously configured field, explicitly set a new value for it. (see [below for nested schema](#nestedatt--parameters))
- `region` (String) The resource region. If not defined, the provider region is used.

### Read-Only

- `cf_guid` (String)
- `cf_organization_guid` (String)
- `cf_space_guid` (String)
- `dashboard_url` (String)
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`".
- `image_url` (String)
- `instance_id` (String) ID of the Valkey instance.
- `plan_id` (String) The selected plan ID.

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

Optional:

- `down_after_milliseconds` (Number) The number of milliseconds after which the instance is considered down.
- `enable_monitoring` (Boolean) Enable monitoring.
- `failover_timeout` (Number) The failover timeout in milliseconds.
- `graphite` (String) Graphite server URL (host and port). If set, monitoring with Graphite will be enabled.
- `lazyfree_lazy_eviction` (String) The lazy eviction enablement (yes or no).
- `lazyfree_lazy_expire` (String) The lazy expire enablement (yes or no).
- `lua_time_limit` (Number) The Lua time limit.
- `max_disk_threshold` (Number) The maximum disk threshold in MB. If the disk usage exceeds this threshold, the instance will be stopped.
- `maxclients` (Number) The maximum number of clients.
- `maxmemory_policy` (String) The policy to handle the maximum memory (volatile-lru, noeviction, etc).
- `maxmemory_samples` (Number) The maximum memory samples.
- `metrics_frequency` (Number) The frequency in seconds at which metrics are emitted.
- `metrics_prefix` (String) The prefix for the metrics. Could be useful when using Graphite monitoring to prefix the metrics with a certain value, like an API key.
- `min_replicas_max_lag` (Number) The minimum replicas maximum lag.
- `min_replicas_to_write` (Number) The amount of connected replicas that are required for the primary to accept write operations. It can be set to 0 to disable it.
- `monitoring_instance_id` (String) The ID of the STACKIT monitoring instance.
- `notify_keyspace_events` (String) The notify keyspace events.
- `repl_backlog_size` (String) The replication backlog size for the cluster.
- `sgw_acl` (String) Comma separated list of IP networks in CIDR notation which are allowed to access this instance.
- `snapshot` (String) The snapshot configuration.
- `syslog` (List of String) List of syslog servers to send logs to.

## 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 valkey instance
import {
to = stackit_valkey_instance.import-example
id = "${var.project_id},${var.region},${var.valkey_instance_id}"
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "stackit_valkey_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "stackit_valkey_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_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 valkey credential
import {
to = stackit_valkey_credential.import-example
id = "${var.project_id},${var.region},${var.valkey_instance_id},${var.valkey_credential_id}"
}
17 changes: 17 additions & 0 deletions examples/resources/stackit_valkey_credential/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "stackit_valkey_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

resource "time_rotating" "rotate" {
rotation_days = 80
}

resource "stackit_valkey_credential" "example_rotate" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

rotate_when_changed = {
rotation = time_rotating.rotate.id
}
}
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 valkey instance
import {
to = stackit_valkey_instance.import-example
id = "${var.project_id},${var.region},${var.valkey_instance_id}"
}
12 changes: 12 additions & 0 deletions examples/resources/stackit_valkey_instance/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "stackit_valkey_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
version = "x"
plan_name = "stackit-keyvalue-1.2.10-replica"
parameters = {
sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22"
enable_monitoring = false
down_after_milliseconds = 30000
syslog = ["logs4.your-syslog-endpoint.com:54321"]
}
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.18.0
github.com/stackitcloud/stackit-sdk-go/services/telemetrylink v0.5.1
github.com/stackitcloud/stackit-sdk-go/services/telemetryrouter v0.5.1
github.com/stackitcloud/stackit-sdk-go/services/valkey v0.1.1
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.15.0
github.com/teambition/rrule-go v1.8.2
go.uber.org/mock v0.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ github.com/stackitcloud/stackit-sdk-go/services/telemetrylink v0.5.1 h1:iIF9cRmW
github.com/stackitcloud/stackit-sdk-go/services/telemetrylink v0.5.1/go.mod h1:hgw8janWmDfP2bnuZensxqcAePr49BX5ug8Rq85o+h8=
github.com/stackitcloud/stackit-sdk-go/services/telemetryrouter v0.5.1 h1:WzpbI9wK3/xSplKOWpHg2FA8MYDwqO0jYGlDANe2cgY=
github.com/stackitcloud/stackit-sdk-go/services/telemetryrouter v0.5.1/go.mod h1:WUmgKtwpe90Yq3YbgNxc2clTTULVxCu0ha6lMTjUnII=
github.com/stackitcloud/stackit-sdk-go/services/valkey v0.1.1 h1:8UraYJJE+gOcfmizHbJZZ+Tef+GC8nzBvhTCWrcACBQ=
github.com/stackitcloud/stackit-sdk-go/services/valkey v0.1.1/go.mod h1:etzt/a723p327dqha1V72cCoBWjUBS2DtHy3ZTac0SA=
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.15.0 h1:JpMJjWBa6fwNNcAHoq00v+8+DwMD0/fe4WPjvbHdY2o=
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.15.0/go.mod h1:toIjQk1dhxdUFVyCWJJja0w/0nFpDid8MWX0ukQfvfo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
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 @@ -75,6 +75,7 @@ type ProviderData struct {
ServiceAccountCustomEndpoint string
TelemetryLinkCustomEndpoint string
TelemetryRouterCustomEndpoint string
ValkeyCustomEndpoint string
VpnCustomEndpoint string
EnableBetaResources bool
Experiments []string
Expand Down
Loading
Loading