Update variables

This commit is contained in:
Daniel_Groß 2025-11-05 15:10:34 +01:00
parent 74b3711a34
commit 5b6f4258ea
Signed by: daniel.gross
SSH key fingerprint: SHA256:tyyj1WVL1JmKHP6+jZjOtTzMj9U13qRk7jUcGI/zkRQ
9 changed files with 29 additions and 9 deletions

1
.gitignore vendored
View file

@ -3,4 +3,5 @@ terraform.tfstate.backup
.terraform* .terraform*
.terraform/ .terraform/
*.qcow2 *.qcow2
*.tfvars

View file

@ -3,7 +3,7 @@ terraform {
required_providers { required_providers {
stackit = { stackit = {
source = "stackitcloud/stackit" source = "stackitcloud/stackit"
version = ">=0.50.0" version = ">=0.69.0"
} }
} }
} }
@ -20,4 +20,8 @@ provider "stackit" {
module "project" { module "project" {
source = "./project" source = "./project"
default_region = var.default_region
service_account_key_path = var.service_account_key_path
name_prefix = var.name_prefix
organization_id = var.organization_id
} }

View file

@ -1,6 +1,6 @@
resource "stackit_objectstorage_bucket" "example" { resource "stackit_objectstorage_bucket" "example" {
project_id = module.project.project_info["project3"].project_id project_id = module.project.project_info["project3"].project_id
name = "project-core-testbucket444" name = "${var.name_prefix}-project-core-testbucket-06-11-25"
} }
resource "stackit_objectstorage_credentials_group" "example" { resource "stackit_objectstorage_credentials_group" "example" {

View file

@ -1,6 +1,6 @@
// keypair adding to the server // keypair adding to the server
resource "stackit_key_pair" "keypair" { resource "stackit_key_pair" "keypair" {
name = "pubkeyforauth" name = "pubkeyforauth"
public_key = chomp(file("/root/.ssh/id_ed25519.pub")) public_key = chomp(file("${var.public_key_file}"))
} }

View file

@ -1,4 +1,10 @@
# -- variables # -- variables
variable "name_prefix" {
type = string
default = "test-landing-zone"
}
variable "organization_id" { variable "organization_id" {
default = "" default = ""
} }
@ -33,3 +39,7 @@ variable "flavor" {
default = "m1.2" default = "m1.2"
} }
variable "public_key_file" {
type = string
}

View file

@ -3,7 +3,7 @@ terraform {
required_providers { required_providers {
stackit = { stackit = {
source = "stackitcloud/stackit" source = "stackitcloud/stackit"
version = ">=0.50.0" version = ">=0.69.0"
} }
} }
} }

View file

@ -5,7 +5,7 @@
resource "stackit_network_area" "sna" { resource "stackit_network_area" "sna" {
organization_id = var.organization_id organization_id = var.organization_id
name = "project_sna" name = "${var.name_prefix}_project_sna"
network_ranges = [ network_ranges = [
{ {
prefix = "10.220.0.0/16" prefix = "10.220.0.0/16"

View file

@ -7,19 +7,19 @@ variable "projects" {
})) }))
default = { default = {
project1 = { project1 = {
name = "landingzone" name = "grossda_landingzone"
owner_email = "michael.sodan@stackit.cloud" owner_email = "michael.sodan@stackit.cloud"
} }
project2 = { project2 = {
name = "core" name = "grossda_core"
owner_email = "michael.sodan@stackit.cloud" owner_email = "michael.sodan@stackit.cloud"
} }
project3 = { project3 = {
name = "backup" name = "grossda_backup"
owner_email = "michael.sodan@stackit.cloud" owner_email = "michael.sodan@stackit.cloud"
} }
project4 = { project4 = {
name = "ske" name = "grossda_ske"
owner_email = "markus.brunsch@stackit.cloud" owner_email = "markus.brunsch@stackit.cloud"
} }
} }

View file

@ -1,4 +1,9 @@
# -- variables # -- variables
variable "name_prefix" {
type = string
default = "test-landing-zone"
}
variable "organization_id" { variable "organization_id" {
default = "" default = ""
} }