chore: add sample to main

This commit is contained in:
Marcel S. Henselin 2026-03-13 11:23:22 +01:00
parent a310d1454a
commit 431f6eff8c
19 changed files with 653 additions and 0 deletions

View file

@ -0,0 +1,4 @@
#
# output "postgres_flavor" {
# value = data.stackitprivatepreview_postgresflexalpha_flavor.pgsql_flavor.flavor_id
# }

View file

@ -0,0 +1,45 @@
data "stackitprivatepreview_postgresflexalpha_flavor" "pgsql_flavor" {
project_id = var.project_id
region = "eu01"
cpu = 2
ram = 4
node_type = "Single"
storage_class = "premium-perf2-stackit"
}
resource "stackitprivatepreview_postgresflexalpha_instance" "import_for_deletion" {
project_id = var.project_id
name = "mshpetest2"
backup_schedule = "0 0 * * *"
retention_days = 45
flavor_id = data.stackitprivatepreview_postgresflexalpha_flavor.pgsql_flavor.flavor_id
replicas = 1
storage = {
# class = "premium-perf2-stackit"
performance_class = "premium-perf2-stackit"
size = 10
}
encryption = {
# key_id = stackit_kms_key.key.key_id
# keyring_id = stackit_kms_keyring.keyring.keyring_id
kek_key_id = var.key_id
kek_key_ring_id = var.keyring_id
kek_key_version = var.key_version
service_account = var.sa_email
}
network = {
acl = ["0.0.0.0/0", "193.148.160.0/19", "170.85.2.177/32"]
access_scope = "PUBLIC"
}
version = 14
}
import {
to = stackitprivatepreview_postgresflexalpha_instance.import_for_deletion
identity = {
project_id = var.project_id
region = "eu01"
instance_id = "d52b5d4c-be3f-4c14-a107-330dab99fd2e"
}
}

View file

@ -0,0 +1,25 @@
terraform {
required_providers {
# stackit = {
# source = "registry.terraform.io/stackitcloud/stackit"
# version = "~> 0.70"
# }
stackitprivatepreview = {
source = "tfregistry.sysops.stackit.rocks/mhenselin/stackitprivatepreview"
version = "> 0.0"
}
}
}
# provider "stackit" {
# default_region = "eu01"
# enable_beta_resources = true
# service_account_key_path = "./service_account.json"
# }
provider "stackitprivatepreview" {
default_region = "eu01"
enable_beta_resources = true
service_account_key_path = "../service_account.json"
}

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>"
}