Alpha (#4)
Some checks failed
CI Workflow / CI (push) Has been cancelled
CI Workflow / Check GoReleaser config (push) Has been cancelled
CI Workflow / Code coverage report (push) Has been cancelled

* chore: initial push to be able to work together

* chore: add missing wait folder

* chore: add missing folders

* chore: cleanup alpha branch

* feat: mssql alpha instance (#2)

* fix: remove unused attribute types and functions from backup models

* fix: update API client references to use sqlserverflexalpha package

* fix: update package references to use sqlserverflexalpha and modify user data source model

* fix: add sqlserverflexalpha user data source to provider

* fix: add sqlserverflexalpha user resource and update related functionality

* chore: add stackit_sqlserverflexalpha_user resource and instance_id variable

* fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database

---------

Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>

* feat: add sqlserver instance

* chore: fixing tests

* chore: update docs

---------

Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
This commit is contained in:
Marcel S. Henselin 2025-12-19 11:37:53 +01:00 committed by GitHub
parent 45073a716b
commit 2733834fc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
351 changed files with 62744 additions and 3 deletions

7
sample/.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
*.json
*.bak
*.tfstate
*.tfstate.backup
terraform
variables.tf
*.tfrc

43
sample/main.tf Normal file
View file

@ -0,0 +1,43 @@
# Copyright (c) STACKIT
resource "stackitalpha_kms_keyring" "keyring" {
project_id = var.project_id
display_name = "keyring01"
description = "This is a test keyring for private endpoints"
}
resource "stackitalpha_kms_key" "key" {
project_id = var.project_id
keyring_id = stackitalpha_kms_keyring.keyring.keyring_id
display_name = "key01"
protection = "software"
algorithm = "aes_256_gcm"
purpose = "symmetric_encrypt_decrypt"
access_scope = "SNA"
}
resource "stackitalpha_postgresflexalpha_instance" "ptlsdbsrv" {
project_id = var.project_id
name = "example-instance"
acl = ["0.0.0.0/0"]
backup_schedule = "0 0 * * *"
flavor = {
cpu = 2
ram = 4
}
replicas = 3
storage = {
class = "premium-perf12-stackit"
size = 5
}
version = 14
encryption = {
key_id = stackitalpha_kms_key.key.id
key_ring_id = stackitalpha_kms_keyring.keyring.keyring_id
key_version = "1"
service_account = var.sa_email
}
network = {
access_scope = "SNA"
}
}

16
sample/providers.tf Normal file
View file

@ -0,0 +1,16 @@
# Copyright (c) STACKIT
terraform {
required_providers {
stackitalpha = {
source = "registry.terraform.io/stackitcloud/stackitalpha"
version = "~> 0.1"
}
}
}
provider "stackitalpha" {
default_region = "eu01"
enable_beta_resources = true
service_account_key_path = "./service_account.json"
}

View file

@ -0,0 +1,10 @@
provider_installation {
dev_overrides {
"registry.terraform.io/stackitcloud/stackitalpha" = "<CURRENT PROJECT PATH>/bin/"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}

9
sample/tf.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Copyright (c) STACKIT
# copy or rename sample.tfrc.example and adjust it
TERRAFORM_CONFIG=$(pwd)/sample.tfrc
export TERRAFORM_CONFIG
terraform "$1"

9
sample/tofu.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Copyright (c) STACKIT
# copy or rename sample.tfrc.example and adjust it
TERRAFORM_CONFIG=$(pwd)/sample.tfrc
export TERRAFORM_CONFIG
tofu "$1"

8
sample/user.tf Normal file
View file

@ -0,0 +1,8 @@
# Copyright (c) STACKIT
resource "stackit_sqlserverflexalpha_user" "ptlsdbuser" {
project_id = stackitalpha_postgresflexalpha_instance.ptlsdbsrv.project_id
instance_id = stackitalpha_postgresflexalpha_instance.ptlsdbsrv.id
username = var.db_username
roles = ["createdb", "login", "createrole"]
}

View file

@ -0,0 +1,11 @@
variable "project_id" {
default = "<PROJECT ID UUID>"
}
variable "sa_email" {
default = "<SERVICE ACCOUNT EMAIL>"
}
variable "db_username" {
default = "<DB USERNAME>"
}