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
14 changes: 14 additions & 0 deletions docs/data-sources/sqlserverflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ data "stackit_sqlserverflex_instance" "example" {
- `acl` (List of String) The Access Control List (ACL) for the SQLServer Flex instance.
- `backup_schedule` (String) The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *").
- `edition` (String) Edition of the MSSQL server instance.
- `encryption` (Attributes) Parameter to define which key to use for storage encryption. (see [below for nested schema](#nestedatt--encryption))
- `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor))
- `flavor_id` (String) The flavor ID of the SQLServer Flex instance.
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`region`,`instance_id`".
Expand All @@ -57,6 +58,19 @@ Optional:
Read-Only:

- `acl` (List of String) List of IPV4 cidr.
- `instance_address` (String) Address of this instance.
- `router_address` (String) Address of the router.


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

Read-Only:

- `kek_key_id` (String) UUID of the key within the STACKIT-KMS to use for the encryption.
- `kek_key_version` (String) Version of the key within the STACKIT-KMS to use for the encryption.
- `kek_keyring_id` (String) UUID of the keyring where the key is located within the STACKTI-KMS.
- `service_account` (String) Service-Account linked to the Key within the STACKIT-KMS.


<a id="nestedatt--flavor"></a>
Expand Down
26 changes: 23 additions & 3 deletions docs/resources/sqlserverflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ SQLServer Flex instance resource schema. Must have a `region` specified in the p
resource "stackit_sqlserverflex_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
backup_schedule = "00 00 * * *"
flavor_id = "4.16-Single"
backup_schedule = "0 0 * * *"
network = {
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
}
storage = {
class = "premium-perf2-stackit"
size = 5
}
version = 2022
retention_days = 32
version = "2022"
}
```

Expand All @@ -39,6 +42,7 @@ resource "stackit_sqlserverflex_instance" "example" {

Comment thread
SerseusWasTaken marked this conversation as resolved.
- `acl` (List of String, Deprecated) The Access Control List (ACL) for the SQLServer Flex instance.
- `backup_schedule` (String) The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *") Will be required in the future. Set a value to prevent breaking changes.
- `encryption` (Attributes) Parameter to define which key to use for storage encryption. (see [below for nested schema](#nestedatt--encryption))
- `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor))
- `flavor_id` (String) The flavor ID of the SQLServer Flex instance.
- `network` (Attributes) The network configuration of the instance. Will be required in the future. Set a value to prevent breaking changes. (see [below for nested schema](#nestedatt--network))
Expand All @@ -55,6 +59,17 @@ resource "stackit_sqlserverflex_instance" "example" {
- `instance_id` (String) ID of the SQLServer Flex instance.
- `replicas` (Number)

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

Required:

- `kek_key_id` (String) UUID of the key within the STACKIT-KMS to use for the encryption.
- `kek_key_version` (String) Version of the key within the STACKIT-KMS to use for the encryption.
- `kek_keyring_id` (String) UUID of the keyring where the key is located within the STACKTI-KMS.
- `service_account` (String) Service-Account linked to the Key within the STACKIT-KMS.


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

Expand All @@ -77,6 +92,11 @@ Optional:
- `access_scope` (String) The network access scope of the instance. This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. Possible values are: `PUBLIC`, `SNA`.
- `acl` (List of String) List of IPV4 cidr.

Read-Only:

- `instance_address` (String) Address of this instance.
- `router_address` (String) Address of the router.


<a id="nestedatt--options"></a>
### Nested Schema for `options`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
resource "stackit_sqlserverflex_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
backup_schedule = "00 00 * * *"
flavor_id = "4.16-Single"
backup_schedule = "0 0 * * *"
network = {
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
}
storage = {
class = "premium-perf2-stackit"
size = 5
}
version = 2022
retention_days = 32
version = "2022"
}
37 changes: 37 additions & 0 deletions stackit/internal/services/sqlserverflex/instance/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,18 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
"name": "Instance name.",
"acl": "The Access Control List (ACL) for the SQLServer Flex instance.",
"backup_schedule": `The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *").`,
"encryption": "Parameter to define which key to use for storage encryption.",
"kek_key_id": "UUID of the key within the STACKIT-KMS to use for the encryption.",
"kek_keyring_id": "UUID of the keyring where the key is located within the STACKTI-KMS.",
"kek_key_version": "Version of the key within the STACKIT-KMS to use for the encryption.",
"service_account": "Service-Account linked to the Key within the STACKIT-KMS.",
"options": "Custom parameters for the SQLServer Flex instance.",
"flavor_id": "The flavor ID of the SQLServer Flex instance.",
"network": "The network configuration of the instance.",
"network.access_scope": "The network access scope of the instance. This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected.",
"network.acl": "List of IPV4 cidr.",
"instance_address": "Address of this instance.",
"router_address": "Address of the router.",
"retention_days": "The days (30 to 90) for how long the backup files should be stored before cleaned up.",
"edition": "Edition of the MSSQL server instance.",
"region": "The resource region. If not defined, the provider region is used.",
Expand Down Expand Up @@ -115,6 +122,28 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
Description: descriptions["backup_schedule"],
Computed: true,
},
"encryption": schema.SingleNestedAttribute{
Description: descriptions["encryption"],
Computed: true,
Attributes: map[string]schema.Attribute{
"kek_key_id": schema.StringAttribute{
Description: descriptions["kek_key_id"],
Computed: true,
},
"kek_keyring_id": schema.StringAttribute{
Description: descriptions["kek_keyring_id"],
Computed: true,
},
"kek_key_version": schema.StringAttribute{
Description: descriptions["kek_key_version"],
Computed: true,
},
"service_account": schema.StringAttribute{
Description: descriptions["service_account"],
Computed: true,
},
},
},
"flavor": schema.SingleNestedAttribute{
Computed: true,
Attributes: map[string]schema.Attribute{
Expand Down Expand Up @@ -149,6 +178,14 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
ElementType: types.StringType,
Computed: true,
},
"instance_address": schema.StringAttribute{
Description: descriptions["instance_address"],
Computed: true,
},
"router_address": schema.StringAttribute{
Description: descriptions["router_address"],
Computed: true,
},
},
},
"replicas": schema.Int32Attribute{
Expand Down
Loading
Loading