feat: auto generated files and new structure #4
4 changed files with 25 additions and 9 deletions
9
Makefile
9
Makefile
|
|
@ -1,5 +1,6 @@
|
||||||
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
|
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
|
||||||
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
|
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
|
||||||
|
VERSION ?= ${VER}
|
||||||
|
|
||||||
# SETUP AND TOOL INITIALIZATION TASKS
|
# SETUP AND TOOL INITIALIZATION TASKS
|
||||||
project-help:
|
project-help:
|
||||||
|
|
@ -57,3 +58,11 @@ test-acceptance-tf:
|
||||||
TF_ACC_REGION=$(TF_ACC_REGION) \
|
TF_ACC_REGION=$(TF_ACC_REGION) \
|
||||||
go test ./... -count=1 -timeout=30m && \
|
go test ./... -count=1 -timeout=30m && \
|
||||||
cd $(ROOT_DIR)
|
cd $(ROOT_DIR)
|
||||||
|
|
||||||
|
publish: build
|
||||||
|
ifeq ($(strip $(VERSION)),)
|
||||||
|
@echo "please call like this: VER=0.1.0 make publish"
|
||||||
|
else
|
||||||
|
@echo "version: $(VERSION)"
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,22 +51,23 @@ resource "stackitprivatepreview_postgresflexalpha_user" "ptlsdbuser" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "stackitprivatepreview_postgresflexalpha_database" "example" {
|
resource "stackitprivatepreview_postgresflexalpha_database" "example" {
|
||||||
|
count = 25
|
||||||
depends_on = [stackitprivatepreview_postgresflexalpha_user.ptlsdbadminuser]
|
depends_on = [stackitprivatepreview_postgresflexalpha_user.ptlsdbadminuser]
|
||||||
project_id = var.project_id
|
project_id = var.project_id
|
||||||
instance_id = stackitprivatepreview_postgresflexalpha_instance.msh-sna-pe-example.instance_id
|
instance_id = stackitprivatepreview_postgresflexalpha_instance.msh-sna-pe-example.instance_id
|
||||||
name = var.db_name
|
name = "${var.db_name}${count.index}"
|
||||||
owner = var.db_admin_username
|
owner = var.db_admin_username
|
||||||
}
|
}
|
||||||
|
|
||||||
data "stackitprivatepreview_postgresflexalpha_instance" "datapsql" {
|
# data "stackitprivatepreview_postgresflexalpha_instance" "datapsql" {
|
||||||
project_id = var.project_id
|
# project_id = var.project_id
|
||||||
instance_id = var.instance_id
|
# instance_id = var.instance_id
|
||||||
region = "eu01"
|
# region = "eu01"
|
||||||
}
|
# }
|
||||||
|
|
||||||
output "psql_instance_id" {
|
# output "psql_instance_id" {
|
||||||
value = data.stackitprivatepreview_postgresflexalpha_instance.datapsql.instance_id
|
# value = data.stackitprivatepreview_postgresflexalpha_instance.datapsql.instance_id
|
||||||
}
|
# }
|
||||||
|
|
||||||
output "psql_user_password" {
|
output "psql_user_password" {
|
||||||
value = stackitprivatepreview_postgresflexalpha_user.ptlsdbuser.password
|
value = stackitprivatepreview_postgresflexalpha_user.ptlsdbuser.password
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ package postgresflex_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
@ -20,6 +21,11 @@ import (
|
||||||
postgresflex "github.com/mhenselin/terraform-provider-stackitprivatepreview/pkg/postgresflexalpha"
|
postgresflex "github.com/mhenselin/terraform-provider-stackitprivatepreview/pkg/postgresflexalpha"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
//go:embed testdata/resource-complete.tf
|
||||||
|
resourceSecurityGroupMinConfig string
|
||||||
|
)
|
||||||
|
|
||||||
// Instance resource data
|
// Instance resource data
|
||||||
var instanceResource = map[string]string{
|
var instanceResource = map[string]string{
|
||||||
"project_id": testutil.ProjectId,
|
"project_id": testutil.ProjectId,
|
||||||
|
|
|
||||||
0
stackit/internal/services/postgresflexalpha/testdata/resource-complete.tf
vendored
Normal file
0
stackit/internal/services/postgresflexalpha/testdata/resource-complete.tf
vendored
Normal file
Loading…
Add table
Add a link
Reference in a new issue