Skip to content

Commit 3bf6bfe

Browse files
authored
Update database examples (#1477)
* chore(postgresflex): Added informations for storage class to postgresflex example Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> * chore(mongodbflex): Added informations for storage class to mongodbflex example Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> * chore(sqlserverflex): Added informations for storage class to sqlserverflex example Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> --------- Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 3ec8287 commit 3bf6bfe

9 files changed

Lines changed: 28 additions & 13 deletions

File tree

docs/resources/mongodbflex_instance.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resource "stackit_mongodbflex_instance" "example" {
2323
}
2424
replicas = 1
2525
storage = {
26-
class = "class"
26+
class = "premium-perf2-mongodb"
2727
size = 10
2828
}
2929
version = "7.0"
@@ -101,5 +101,8 @@ Optional:
101101

102102
Required:
103103

104-
- `class` (String)
104+
- `class` (String) The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):
105+
```bash
106+
stackit mongodbflex options --storages --flavor-id FLAVOR_ID
107+
```
105108
- `size` (Number)

docs/resources/postgresflex_instance.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "stackit_postgresflex_instance" "example" {
2424
}
2525
replicas = 3
2626
storage = {
27-
class = "class"
27+
class = "premium-perf2-stackit"
2828
size = 5
2929
}
3030
version = 14
@@ -79,5 +79,8 @@ Read-Only:
7979

8080
Required:
8181

82-
- `class` (String)
82+
- `class` (String) The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):
83+
```bash
84+
stackit postgresflex options --storages --flavor-id FLAVOR_ID
85+
```
8386
- `size` (Number)

docs/resources/sqlserverflex_instance.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resource "stackit_sqlserverflex_instance" "example" {
2323
ram = 16
2424
}
2525
storage = {
26-
class = "class"
26+
class = "premium-perf2-stackit"
2727
size = 5
2828
}
2929
version = 2022
@@ -91,5 +91,8 @@ Read-Only:
9191

9292
Optional:
9393

94-
- `class` (String)
94+
- `class` (String) The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):
95+
```bash
96+
stackit beta sqlserverflex options --storages --flavor-id FLAVOR_ID
97+
```
9598
- `size` (Number)

examples/resources/stackit_mongodbflex_instance/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "stackit_mongodbflex_instance" "example" {
88
}
99
replicas = 1
1010
storage = {
11-
class = "class"
11+
class = "premium-perf2-mongodb"
1212
size = 10
1313
}
1414
version = "7.0"

examples/resources/stackit_postgresflex_instance/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resource "stackit_postgresflex_instance" "example" {
99
}
1010
replicas = 3
1111
storage = {
12-
class = "class"
12+
class = "premium-perf2-stackit"
1313
size = 5
1414
}
1515
version = 14

examples/resources/stackit_sqlserverflex_instance/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "stackit_sqlserverflex_instance" "example" {
88
ram = 16
99
}
1010
storage = {
11-
class = "class"
11+
class = "premium-perf2-stackit"
1212
size = 5
1313
}
1414
version = 2022

stackit/internal/services/mongodbflex/instance/resource.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r
190190
"monthly_snapshot_retention_months": "The number of months that monthly backups will be retained.",
191191
"point_in_time_window_hours": "The number of hours back in time the point-in-time recovery feature will be able to recover.",
192192
"region": "The resource region. If not defined, the provider region is used.",
193+
"storage_class": "The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit mongodbflex options --storages --flavor-id FLAVOR_ID\n```",
193194
}
194195

195196
resp.Schema = schema.Schema{
@@ -275,7 +276,8 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r
275276
Required: true,
276277
Attributes: map[string]schema.Attribute{
277278
"class": schema.StringAttribute{
278-
Required: true,
279+
Description: descriptions["storage_class"],
280+
Required: true,
279281
PlanModifiers: []planmodifier.String{
280282
stringplanmodifier.RequiresReplace(),
281283
},

stackit/internal/services/postgresflex/instance/resource.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest,
158158
"region": "The resource region. If not defined, the provider region is used.",
159159
"backup_schedule": "The schedule for on what time and how often the database backup will be created. Must be a valid cron expression using numeric minute and hour values, e.g: '0 2 * * *'.",
160160
"replicas": "How many replicas the instance should have. Valid values are 1 for single mode or 3 for replication.",
161+
"storage_class": "The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit postgresflex options --storages --flavor-id FLAVOR_ID\n```",
161162
}
162163

163164
resp.Schema = schema.Schema{
@@ -247,7 +248,8 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest,
247248
Required: true,
248249
Attributes: map[string]schema.Attribute{
249250
"class": schema.StringAttribute{
250-
Required: true,
251+
Description: descriptions["storage_class"],
252+
Required: true,
251253
PlanModifiers: []planmodifier.String{
252254
stringplanmodifier.RequiresReplace(),
253255
},

stackit/internal/services/sqlserverflex/instance/resource.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r
177177
"backup_schedule": `The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *")`,
178178
"options": "Custom parameters for the SQLServer Flex instance.",
179179
"region": "The resource region. If not defined, the provider region is used.",
180+
"storage_class": "The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit beta sqlserverflex options --storages --flavor-id FLAVOR_ID\n```",
180181
}
181182

182183
resp.Schema = schema.Schema{
@@ -278,8 +279,9 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r
278279
},
279280
Attributes: map[string]schema.Attribute{
280281
"class": schema.StringAttribute{
281-
Optional: true,
282-
Computed: true,
282+
Description: descriptions["storage_class"],
283+
Optional: true,
284+
Computed: true,
283285
PlanModifiers: []planmodifier.String{
284286
stringplanmodifier.RequiresReplace(),
285287
stringplanmodifier.UseStateForUnknown(),

0 commit comments

Comments
 (0)