Compare commits
5 commits
v0.0.22-al
...
alpha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
635a9abf20 | ||
|
|
07458c5677 | ||
|
|
eb13630d2f | ||
| 4a2819787d | |||
|
|
36eccc52c3 |
79 changed files with 3280 additions and 2515 deletions
33
.github/workflows/ci.yaml
vendored
33
.github/workflows/ci.yaml
vendored
|
|
@ -22,6 +22,39 @@ env:
|
||||||
CODE_COVERAGE_ARTIFACT_NAME: "code-coverage"
|
CODE_COVERAGE_ARTIFACT_NAME: "code-coverage"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
runner_test:
|
||||||
|
name: "Test STACKIT runner"
|
||||||
|
runs-on: stackit-docker
|
||||||
|
steps:
|
||||||
|
- name: Install needed tools
|
||||||
|
run: |
|
||||||
|
apt-get -y -qq update
|
||||||
|
apt-get -y -qq install jq python3 python3-pip python-is-python3 s3cmd git make wget
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
|
||||||
|
- name: Install go tools
|
||||||
|
run: |
|
||||||
|
go install golang.org/x/tools/cmd/goimports@latest
|
||||||
|
go install github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework@latest
|
||||||
|
go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest
|
||||||
|
|
||||||
|
- name: Setup JAVA
|
||||||
|
uses: actions/setup-java@v5
|
||||||
|
with:
|
||||||
|
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||||
|
java-version: '21'
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Run build pkg directory
|
||||||
|
run: |
|
||||||
|
go run cmd/main.go build
|
||||||
|
|
||||||
publish_test:
|
publish_test:
|
||||||
name: "Test readiness for publishing provider"
|
name: "Test readiness for publishing provider"
|
||||||
needs: config
|
needs: config
|
||||||
|
|
|
||||||
29
.github/workflows/runnerstats.yaml
vendored
Normal file
29
.github/workflows/runnerstats.yaml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
name: Runner stats
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stats-own:
|
||||||
|
name: "Get own runner stats"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install needed tools
|
||||||
|
run: |
|
||||||
|
apt-get -y -qq update
|
||||||
|
apt-get -y -qq install inxi
|
||||||
|
|
||||||
|
- name: Show stats
|
||||||
|
run: inxi -c 0
|
||||||
|
|
||||||
|
stats-stackit:
|
||||||
|
name: "Get STACKIT runner stats"
|
||||||
|
runs-on: stackit-docker
|
||||||
|
steps:
|
||||||
|
- name: Install needed tools
|
||||||
|
run: |
|
||||||
|
apt-get -y -qq update
|
||||||
|
apt-get -y -qq install inxi
|
||||||
|
|
||||||
|
- name: Show stats
|
||||||
|
run: inxi -c 0
|
||||||
4
Makefile
4
Makefile
|
|
@ -12,7 +12,8 @@ project-tools:
|
||||||
# LINT
|
# LINT
|
||||||
lint-golangci-lint:
|
lint-golangci-lint:
|
||||||
@echo "Linting with golangci-lint"
|
@echo "Linting with golangci-lint"
|
||||||
@$(SCRIPTS_BASE)/lint-golangci-lint.sh
|
@go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run --fix --config golang-ci.yaml
|
||||||
|
|
||||||
|
|
||||||
lint-tf:
|
lint-tf:
|
||||||
@echo "Linting terraform files"
|
@echo "Linting terraform files"
|
||||||
|
|
@ -23,6 +24,7 @@ lint: lint-golangci-lint lint-tf
|
||||||
# DOCUMENTATION GENERATION
|
# DOCUMENTATION GENERATION
|
||||||
generate-docs:
|
generate-docs:
|
||||||
@echo "Generating documentation with tfplugindocs"
|
@echo "Generating documentation with tfplugindocs"
|
||||||
|
|
||||||
@$(SCRIPTS_BASE)/tfplugindocs.sh
|
@$(SCRIPTS_BASE)/tfplugindocs.sh
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ func (b *Builder) Build() error {
|
||||||
|
|
||||||
if !b.PackagesOnly {
|
if !b.PackagesOnly {
|
||||||
slog.Info(" ... Checking needed commands available")
|
slog.Info(" ... Checking needed commands available")
|
||||||
err := checkCommands([]string{"tfplugingen-framework", "tfplugingen-openapi"})
|
err := checkCommands([]string{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -111,7 +111,7 @@ func (b *Builder) Build() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
slog.Info("Creating OAS dir")
|
slog.Info("Creating OAS dir")
|
||||||
err = os.MkdirAll(path.Join(genDir, "oas"), 0755)
|
err = os.MkdirAll(path.Join(genDir, "oas"), 0o755) //nolint:gosec // this dir is not sensitive, so we can use 0755
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +158,17 @@ func (b *Builder) Build() error {
|
||||||
if err = cmd.Wait(); err != nil {
|
if err = cmd.Wait(); err != nil {
|
||||||
var exitErr *exec.ExitError
|
var exitErr *exec.ExitError
|
||||||
if errors.As(err, &exitErr) {
|
if errors.As(err, &exitErr) {
|
||||||
slog.Error("cmd.Wait", "code", exitErr.ExitCode(), "error", err, "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Error(
|
||||||
|
"cmd.Wait",
|
||||||
|
"code",
|
||||||
|
exitErr.ExitCode(),
|
||||||
|
"error",
|
||||||
|
err,
|
||||||
|
"stdout",
|
||||||
|
stdOut.String(),
|
||||||
|
"stderr",
|
||||||
|
stdErr.String(),
|
||||||
|
)
|
||||||
return fmt.Errorf("%s", stdErr.String())
|
return fmt.Errorf("%s", stdErr.String())
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -192,7 +202,11 @@ func (b *Builder) Build() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
slog.Info("Rearranging package directories")
|
slog.Info("Rearranging package directories")
|
||||||
err = os.MkdirAll(path.Join(*root, "pkg_gen"), 0755) // noqa:gosec
|
//nolint:gosec // this dir is not sensitive, so we can use 0755
|
||||||
|
err = os.MkdirAll(
|
||||||
|
path.Join(*root, "pkg_gen"),
|
||||||
|
0o755,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -202,7 +216,9 @@ func (b *Builder) Build() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
if item.IsDir() {
|
if !item.IsDir() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
slog.Info(" -> package", "name", item.Name())
|
slog.Info(" -> package", "name", item.Name())
|
||||||
tgtDir := path.Join(*root, "pkg_gen", item.Name())
|
tgtDir := path.Join(*root, "pkg_gen", item.Name())
|
||||||
if fileExists(tgtDir) {
|
if fileExists(tgtDir) {
|
||||||
|
|
@ -216,7 +232,6 @@ func (b *Builder) Build() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if !b.PackagesOnly {
|
if !b.PackagesOnly {
|
||||||
slog.Info("Generating service boilerplate")
|
slog.Info("Generating service boilerplate")
|
||||||
|
|
@ -275,8 +290,8 @@ type templateData struct {
|
||||||
Fields []string
|
Fields []string
|
||||||
}
|
}
|
||||||
|
|
||||||
func fileExists(path string) bool {
|
func fileExists(pathValue string) bool {
|
||||||
_, err := os.Stat(path)
|
_, err := os.Stat(pathValue)
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
@ -312,10 +327,22 @@ func createBoilerplate(rootFolder, folder string) error {
|
||||||
|
|
||||||
resourceName := res.Name()
|
resourceName := res.Name()
|
||||||
|
|
||||||
dsFile := path.Join(folder, svc.Name(), res.Name(), "datasources_gen", fmt.Sprintf("%s_data_source_gen.go", res.Name()))
|
dsFile := path.Join(
|
||||||
|
folder,
|
||||||
|
svc.Name(),
|
||||||
|
res.Name(),
|
||||||
|
"datasources_gen",
|
||||||
|
fmt.Sprintf("%s_data_source_gen.go", res.Name()),
|
||||||
|
)
|
||||||
handleDS = fileExists(dsFile)
|
handleDS = fileExists(dsFile)
|
||||||
|
|
||||||
resFile := path.Join(folder, svc.Name(), res.Name(), "resources_gen", fmt.Sprintf("%s_resource_gen.go", res.Name()))
|
resFile := path.Join(
|
||||||
|
folder,
|
||||||
|
svc.Name(),
|
||||||
|
res.Name(),
|
||||||
|
"resources_gen",
|
||||||
|
fmt.Sprintf("%s_resource_gen.go", res.Name()),
|
||||||
|
)
|
||||||
handleRes = fileExists(resFile)
|
handleRes = fileExists(resFile)
|
||||||
|
|
||||||
dsGoFile := path.Join(folder, svc.Name(), res.Name(), "datasource.go")
|
dsGoFile := path.Join(folder, svc.Name(), res.Name(), "datasource.go")
|
||||||
|
|
@ -407,7 +434,6 @@ func createBoilerplate(rootFolder, folder string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -416,7 +442,7 @@ func createBoilerplate(rootFolder, folder string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ucfirst(s string) string {
|
func ucfirst(s string) string {
|
||||||
if len(s) == 0 {
|
if s == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return strings.ToUpper(s[:1]) + s[1:]
|
return strings.ToUpper(s[:1]) + s[1:]
|
||||||
|
|
@ -451,8 +477,8 @@ func writeTemplateToFile(tplName, tplFile, outFile string, data *templateData) e
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateServiceFiles(rootDir, generatorDir string) error {
|
func generateServiceFiles(rootDir, generatorDir string) error {
|
||||||
// slog.Info("Generating specs folder")
|
//nolint:gosec // this file is not sensitive, so we can use 0755
|
||||||
err := os.MkdirAll(path.Join(rootDir, "generated", "specs"), 0755)
|
err := os.MkdirAll(path.Join(rootDir, "generated", "specs"), 0o755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -490,7 +516,6 @@ func generateServiceFiles(rootDir, generatorDir string) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// slog.Info("Checking spec", "name", spec.Name())
|
|
||||||
r := regexp.MustCompile(`^(.*)_config.yml$`)
|
r := regexp.MustCompile(`^(.*)_config.yml$`)
|
||||||
matches := r.FindAllStringSubmatch(specFile.Name(), -1)
|
matches := r.FindAllStringSubmatch(specFile.Name(), -1)
|
||||||
if matches != nil {
|
if matches != nil {
|
||||||
|
|
@ -506,27 +531,44 @@ func generateServiceFiles(rootDir, generatorDir string) error {
|
||||||
resource,
|
resource,
|
||||||
)
|
)
|
||||||
|
|
||||||
oasFile := path.Join(generatorDir, "oas", fmt.Sprintf("%s%s.json", service.Name(), svcVersion.Name()))
|
oasFile := path.Join(
|
||||||
|
generatorDir,
|
||||||
|
"oas",
|
||||||
|
fmt.Sprintf("%s%s.json", service.Name(), svcVersion.Name()),
|
||||||
|
)
|
||||||
if _, oasErr := os.Stat(oasFile); os.IsNotExist(oasErr) {
|
if _, oasErr := os.Stat(oasFile); os.IsNotExist(oasErr) {
|
||||||
slog.Warn(" could not find matching oas", "svc", service.Name(), "version", svcVersion.Name())
|
slog.Warn(
|
||||||
|
" could not find matching oas",
|
||||||
|
"svc",
|
||||||
|
service.Name(),
|
||||||
|
"version",
|
||||||
|
svcVersion.Name(),
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
scName := fmt.Sprintf("%s%s", service.Name(), svcVersion.Name())
|
scName := fmt.Sprintf("%s%s", service.Name(), svcVersion.Name())
|
||||||
scName = strings.ReplaceAll(scName, "-", "")
|
scName = strings.ReplaceAll(scName, "-", "")
|
||||||
err = os.MkdirAll(path.Join(rootDir, "generated", "internal", "services", scName, resource), 0755)
|
//nolint:gosec // this file is not sensitive, so we can use 0755
|
||||||
|
err = os.MkdirAll(path.Join(rootDir, "generated", "internal", "services", scName, resource), 0o755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// slog.Info("Generating openapi spec json")
|
specJsonFile := path.Join(
|
||||||
specJsonFile := path.Join(rootDir, "generated", "specs", fmt.Sprintf("%s_%s_spec.json", scName, resource))
|
rootDir,
|
||||||
|
"generated",
|
||||||
|
"specs",
|
||||||
|
fmt.Sprintf("%s_%s_spec.json", scName, resource),
|
||||||
|
)
|
||||||
|
|
||||||
var stdOut, stdErr bytes.Buffer
|
var stdOut, stdErr bytes.Buffer
|
||||||
|
|
||||||
// noqa:gosec
|
// nolint:gosec // #nosec this command is not using any untrusted input, so we can ignore gosec warning
|
||||||
cmd := exec.Command(
|
cmd := exec.Command(
|
||||||
"tfplugingen-openapi",
|
"go",
|
||||||
|
"run",
|
||||||
|
"github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi",
|
||||||
"generate",
|
"generate",
|
||||||
"--config",
|
"--config",
|
||||||
path.Join(rootDir, "service_specs", service.Name(), svcVersion.Name(), fileName),
|
path.Join(rootDir, "service_specs", service.Name(), svcVersion.Name(), fileName),
|
||||||
|
|
@ -553,11 +595,29 @@ func generateServiceFiles(rootDir, generatorDir string) error {
|
||||||
if err = cmd.Wait(); err != nil {
|
if err = cmd.Wait(); err != nil {
|
||||||
var exitErr *exec.ExitError
|
var exitErr *exec.ExitError
|
||||||
if errors.As(err, &exitErr) {
|
if errors.As(err, &exitErr) {
|
||||||
slog.Error("tfplugingen-openapi generate", "code", exitErr.ExitCode(), "error", err, "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Error(
|
||||||
|
"tfplugingen-openapi generate",
|
||||||
|
"code",
|
||||||
|
exitErr.ExitCode(),
|
||||||
|
"error",
|
||||||
|
err,
|
||||||
|
"stdout",
|
||||||
|
stdOut.String(),
|
||||||
|
"stderr",
|
||||||
|
stdErr.String(),
|
||||||
|
)
|
||||||
return fmt.Errorf("%s", stdErr.String())
|
return fmt.Errorf("%s", stdErr.String())
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("tfplugingen-openapi generate", "err", err, "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Error(
|
||||||
|
"tfplugingen-openapi generate",
|
||||||
|
"err",
|
||||||
|
err,
|
||||||
|
"stdout",
|
||||||
|
stdOut.String(),
|
||||||
|
"stderr",
|
||||||
|
stdErr.String(),
|
||||||
|
)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -565,18 +625,26 @@ func generateServiceFiles(rootDir, generatorDir string) error {
|
||||||
slog.Warn(" command output", "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Warn(" command output", "stdout", stdOut.String(), "stderr", stdErr.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
// slog.Info("Creating terraform svc resource files folder")
|
tgtFolder := path.Join(
|
||||||
tgtFolder := path.Join(rootDir, "generated", "internal", "services", scName, resource, "resources_gen")
|
rootDir,
|
||||||
err = os.MkdirAll(tgtFolder, 0755)
|
"generated",
|
||||||
|
"internal",
|
||||||
|
"services",
|
||||||
|
scName,
|
||||||
|
resource,
|
||||||
|
"resources_gen",
|
||||||
|
)
|
||||||
|
//nolint:gosec // this file is not sensitive, so we can use 0755
|
||||||
|
err = os.MkdirAll(tgtFolder, 0o755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// slog.Info("Generating terraform svc resource files")
|
// nolint:gosec // #nosec this command is not using any untrusted input, so we can ignore gosec warning
|
||||||
|
|
||||||
// noqa:gosec
|
|
||||||
cmd2 := exec.Command(
|
cmd2 := exec.Command(
|
||||||
"tfplugingen-framework",
|
"go",
|
||||||
|
"run",
|
||||||
|
"github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework",
|
||||||
"generate",
|
"generate",
|
||||||
"resources",
|
"resources",
|
||||||
"--input",
|
"--input",
|
||||||
|
|
@ -597,27 +665,53 @@ func generateServiceFiles(rootDir, generatorDir string) error {
|
||||||
if err = cmd2.Wait(); err != nil {
|
if err = cmd2.Wait(); err != nil {
|
||||||
var exitErr *exec.ExitError
|
var exitErr *exec.ExitError
|
||||||
if errors.As(err, &exitErr) {
|
if errors.As(err, &exitErr) {
|
||||||
slog.Error("tfplugingen-framework generate resources", "code", exitErr.ExitCode(), "error", err, "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Error(
|
||||||
|
"tfplugingen-framework generate resources",
|
||||||
|
"code",
|
||||||
|
exitErr.ExitCode(),
|
||||||
|
"error",
|
||||||
|
err,
|
||||||
|
"stdout",
|
||||||
|
stdOut.String(),
|
||||||
|
"stderr",
|
||||||
|
stdErr.String(),
|
||||||
|
)
|
||||||
return fmt.Errorf("%s", stdErr.String())
|
return fmt.Errorf("%s", stdErr.String())
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("tfplugingen-framework generate resources", "err", err, "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Error(
|
||||||
|
"tfplugingen-framework generate resources",
|
||||||
|
"err",
|
||||||
|
err,
|
||||||
|
"stdout",
|
||||||
|
stdOut.String(),
|
||||||
|
"stderr",
|
||||||
|
stdErr.String(),
|
||||||
|
)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// slog.Info("Creating terraform svc datasource files folder")
|
tgtFolder = path.Join(
|
||||||
tgtFolder = path.Join(rootDir, "generated", "internal", "services", scName, resource, "datasources_gen")
|
rootDir,
|
||||||
err = os.MkdirAll(tgtFolder, 0755)
|
"generated",
|
||||||
|
"internal",
|
||||||
|
"services",
|
||||||
|
scName,
|
||||||
|
resource,
|
||||||
|
"datasources_gen",
|
||||||
|
)
|
||||||
|
//nolint:gosec // this directory is not sensitive, so we can use 0755
|
||||||
|
err = os.MkdirAll(tgtFolder, 0o755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// slog.Info("Generating terraform svc resource files")
|
// nolint:gosec // #nosec this command is not using any untrusted input, so we can ignore gosec warning
|
||||||
|
|
||||||
// noqa:gosec
|
|
||||||
cmd3 := exec.Command(
|
cmd3 := exec.Command(
|
||||||
"tfplugingen-framework",
|
"go",
|
||||||
|
"run",
|
||||||
|
"github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework",
|
||||||
"generate",
|
"generate",
|
||||||
"data-sources",
|
"data-sources",
|
||||||
"--input",
|
"--input",
|
||||||
|
|
@ -639,11 +733,29 @@ func generateServiceFiles(rootDir, generatorDir string) error {
|
||||||
if err = cmd3.Wait(); err != nil {
|
if err = cmd3.Wait(); err != nil {
|
||||||
var exitErr *exec.ExitError
|
var exitErr *exec.ExitError
|
||||||
if errors.As(err, &exitErr) {
|
if errors.As(err, &exitErr) {
|
||||||
slog.Error("tfplugingen-framework generate data-sources", "code", exitErr.ExitCode(), "error", err, "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Error(
|
||||||
|
"tfplugingen-framework generate data-sources",
|
||||||
|
"code",
|
||||||
|
exitErr.ExitCode(),
|
||||||
|
"error",
|
||||||
|
err,
|
||||||
|
"stdout",
|
||||||
|
stdOut.String(),
|
||||||
|
"stderr",
|
||||||
|
stdErr.String(),
|
||||||
|
)
|
||||||
return fmt.Errorf("%s", stdErr.String())
|
return fmt.Errorf("%s", stdErr.String())
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("tfplugingen-framework generate data-sources", "err", err, "stdout", stdOut.String(), "stderr", stdErr.String())
|
slog.Error(
|
||||||
|
"tfplugingen-framework generate data-sources",
|
||||||
|
"err",
|
||||||
|
err,
|
||||||
|
"stdout",
|
||||||
|
stdOut.String(),
|
||||||
|
"stderr",
|
||||||
|
stdErr.String(),
|
||||||
|
)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -674,10 +786,10 @@ func handleTfTagForDatasourceFile(filePath, service, resource string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer f.Close()
|
|
||||||
|
|
||||||
root, err := getRoot()
|
root, err := getRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
//nolint:gocritic // in this case, we want to log the error and exit, as we cannot proceed without the root directory
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -685,7 +797,6 @@ func handleTfTagForDatasourceFile(filePath, service, resource string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer tmp.Close()
|
|
||||||
|
|
||||||
sc := bufio.NewScanner(f)
|
sc := bufio.NewScanner(f)
|
||||||
for sc.Scan() {
|
for sc.Scan() {
|
||||||
|
|
@ -709,6 +820,7 @@ func handleTfTagForDatasourceFile(filePath, service, resource string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:gosec // path traversal is not a concern here
|
||||||
if err := os.Rename(tmp.Name(), filePath); err != nil {
|
if err := os.Rename(tmp.Name(), filePath); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
@ -773,13 +885,23 @@ func copyFile(src, dst string) (int64, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
defer source.Close()
|
defer func(source *os.File) {
|
||||||
|
err := source.Close()
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("copyFile", "err", err)
|
||||||
|
}
|
||||||
|
}(source)
|
||||||
|
|
||||||
destination, err := os.Create(dst)
|
destination, err := os.Create(dst)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
defer destination.Close()
|
defer func(destination *os.File) {
|
||||||
|
err := destination.Close()
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("copyFile", "err", err)
|
||||||
|
}
|
||||||
|
}(destination)
|
||||||
nBytes, err := io.Copy(destination, source)
|
nBytes, err := io.Copy(destination, source)
|
||||||
return nBytes, err
|
return nBytes, err
|
||||||
}
|
}
|
||||||
|
|
@ -790,12 +912,10 @@ func getOnlyLatest(m map[string]version) (map[string]version, error) {
|
||||||
item, ok := tmpMap[k]
|
item, ok := tmpMap[k]
|
||||||
if !ok {
|
if !ok {
|
||||||
tmpMap[k] = v
|
tmpMap[k] = v
|
||||||
} else {
|
} else if item.major == v.major && item.minor < v.minor {
|
||||||
if item.major == v.major && item.minor < v.minor {
|
|
||||||
tmpMap[k] = v
|
tmpMap[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return tmpMap, nil
|
return tmpMap, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -807,7 +927,9 @@ func getVersions(dir string) (map[string]version, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, entry := range children {
|
for _, entry := range children {
|
||||||
if entry.IsDir() {
|
if !entry.IsDir() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
versions, err := os.ReadDir(path.Join(dir, "services", entry.Name()))
|
versions, err := os.ReadDir(path.Join(dir, "services", entry.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -820,15 +942,16 @@ func getVersions(dir string) (map[string]version, error) {
|
||||||
res[k] = v
|
res[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func extractVersions(service string, versionDirs []os.DirEntry) (map[string]version, error) {
|
func extractVersions(service string, versionDirs []os.DirEntry) (map[string]version, error) {
|
||||||
res := make(map[string]version)
|
res := make(map[string]version)
|
||||||
for _, vDir := range versionDirs {
|
for _, vDir := range versionDirs {
|
||||||
if vDir.IsDir() {
|
if !vDir.IsDir() {
|
||||||
r := regexp.MustCompile(`v([0-9]+)([a-z]+)([0-9]*)`)
|
continue
|
||||||
|
}
|
||||||
|
r := regexp.MustCompile(`v(\d+)([a-z]+)(\d*)`)
|
||||||
matches := r.FindAllStringSubmatch(vDir.Name(), -1)
|
matches := r.FindAllStringSubmatch(vDir.Name(), -1)
|
||||||
if matches == nil {
|
if matches == nil {
|
||||||
continue
|
continue
|
||||||
|
|
@ -842,7 +965,6 @@ func extractVersions(service string, versionDirs []os.DirEntry) (map[string]vers
|
||||||
res[*svc] = *ver
|
res[*svc] = *ver
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -927,30 +1049,25 @@ func getTokens(fileName string) ([]string, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ast.Inspect(node, func(n ast.Node) bool {
|
ast.Inspect(
|
||||||
|
node, func(n ast.Node) bool {
|
||||||
// Suche nach Typ-Deklarationen (structs)
|
// Suche nach Typ-Deklarationen (structs)
|
||||||
ts, ok := n.(*ast.TypeSpec)
|
ts, ok := n.(*ast.TypeSpec)
|
||||||
if ok {
|
if ok {
|
||||||
if strings.Contains(ts.Name.Name, "Model") {
|
if strings.Contains(ts.Name.Name, "Model") {
|
||||||
// fmt.Printf("found model: %s\n", ts.Name.Name)
|
ast.Inspect(
|
||||||
ast.Inspect(ts, func(sn ast.Node) bool {
|
ts, func(sn ast.Node) bool {
|
||||||
tts, tok := sn.(*ast.Field)
|
tts, tok := sn.(*ast.Field)
|
||||||
if tok {
|
if tok {
|
||||||
// fmt.Printf(" found: %+v\n", tts.Names[0])
|
|
||||||
// spew.Dump(tts.Type)
|
|
||||||
|
|
||||||
result = append(result, tts.Names[0].String())
|
result = append(result, tts.Names[0].String())
|
||||||
|
|
||||||
// fld, fldOk := tts.Type.(*ast.Ident)
|
|
||||||
//if fldOk {
|
|
||||||
// fmt.Printf("type: %+v\n", fld)
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
},
|
||||||
|
)
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package build
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
@ -74,14 +75,24 @@ func Copy(srcFile, dstFile string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer out.Close()
|
defer func(out *os.File) {
|
||||||
|
err := out.Close()
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("failed to close file", slog.Any("err", err))
|
||||||
|
}
|
||||||
|
}(out)
|
||||||
|
|
||||||
in, err := os.Open(srcFile)
|
in, err := os.Open(srcFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer in.Close()
|
defer func(in *os.File) {
|
||||||
|
err := in.Close()
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("error closing destination file", slog.Any("err", err))
|
||||||
|
}
|
||||||
|
}(in)
|
||||||
|
|
||||||
_, err = io.Copy(out, in)
|
_, err = io.Copy(out, in)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ var buildCmd = &cobra.Command{
|
||||||
Use: "build",
|
Use: "build",
|
||||||
Short: "Build the necessary boilerplate",
|
Short: "Build the necessary boilerplate",
|
||||||
Long: `...`,
|
Long: `...`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(_ *cobra.Command, _ []string) error {
|
||||||
b := build.Builder{
|
b := build.Builder{
|
||||||
SkipClone: skipClone,
|
SkipClone: skipClone,
|
||||||
SkipCleanup: skipCleanup,
|
SkipCleanup: skipCleanup,
|
||||||
|
|
@ -30,7 +30,7 @@ func NewBuildCmd() *cobra.Command {
|
||||||
return buildCmd
|
return buildCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { // nolint: gochecknoinits
|
func init() { //nolint:gochecknoinits // This is the standard way to set up Cobra commands
|
||||||
buildCmd.Flags().BoolVarP(&skipCleanup, "skip-clean", "c", false, "Skip cleanup steps")
|
buildCmd.Flags().BoolVarP(&skipCleanup, "skip-clean", "c", false, "Skip cleanup steps")
|
||||||
buildCmd.Flags().BoolVarP(&skipClone, "skip-clone", "g", false, "Skip cloning from git")
|
buildCmd.Flags().BoolVarP(&skipClone, "skip-clone", "g", false, "Skip cloning from git")
|
||||||
buildCmd.Flags().BoolVarP(&packagesOnly, "packages-only", "p", false, "Only generate packages")
|
buildCmd.Flags().BoolVarP(&packagesOnly, "packages-only", "p", false, "Only generate packages")
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,15 @@ var examplesCmd = &cobra.Command{
|
||||||
Use: "examples",
|
Use: "examples",
|
||||||
Short: "create examples",
|
Short: "create examples",
|
||||||
Long: `...`,
|
Long: `...`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(_ *cobra.Command, _ []string) error {
|
||||||
|
// filePathStr := "stackit/internal/services/postgresflexalpha/database/datasources_gen/database_data_source_gen.go"
|
||||||
//filePathStr := "stackit/internal/services/postgresflexalpha/database/datasources_gen/database_data_source_gen.go"
|
|
||||||
//
|
//
|
||||||
//src, err := os.ReadFile(filePathStr)
|
// src, err := os.ReadFile(filePathStr)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//i := interp.New(
|
// i := interp.New(
|
||||||
// interp.Options{
|
// interp.Options{
|
||||||
// GoPath: "/home/henselinm/.asdf/installs/golang/1.25.6/packages",
|
// GoPath: "/home/henselinm/.asdf/installs/golang/1.25.6/packages",
|
||||||
// BuildTags: nil,
|
// BuildTags: nil,
|
||||||
|
|
@ -34,46 +33,46 @@ var examplesCmd = &cobra.Command{
|
||||||
// Unrestricted: false,
|
// Unrestricted: false,
|
||||||
// },
|
// },
|
||||||
//)
|
//)
|
||||||
//err = i.Use(i.Symbols("github.com/hashicorp/terraform-plugin-framework-validators"))
|
// err = i.Use(i.Symbols("github.com/hashicorp/terraform-plugin-framework-validators"))
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
//err = i.Use(stdlib.Symbols)
|
// err = i.Use(stdlib.Symbols)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
//_, err = i.Eval(string(src))
|
// _, err = i.Eval(string(src))
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//v, err := i.Eval("DatabaseDataSourceSchema")
|
// v, err := i.Eval("DatabaseDataSourceSchema")
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//bar := v.Interface().(func(string) string)
|
// bar := v.Interface().(func(string) string)
|
||||||
//
|
//
|
||||||
//r := bar("Kung")
|
// r := bar("Kung")
|
||||||
//println(r)
|
// println(r)
|
||||||
//
|
//
|
||||||
//evalPath, err := i.EvalPath(filePathStr)
|
// evalPath, err := i.EvalPath(filePathStr)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//fmt.Printf("%+v\n", evalPath)
|
// fmt.Printf("%+v\n", evalPath)
|
||||||
|
|
||||||
//_, err = i.Eval(`import "fmt"`)
|
// _, err = i.Eval(`import "fmt"`)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
//_, err = i.Eval(`func Hallo() { fmt.Println("Hi!") }`)
|
// _, err = i.Eval(`func Hallo() { fmt.Println("Hi!") }`)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//v = i.Symbols("Hallo")
|
// v = i.Symbols("Hallo")
|
||||||
|
|
||||||
// fmt.Println(v)
|
// fmt.Println(v)
|
||||||
return workServices()
|
return workServices()
|
||||||
|
|
@ -110,6 +109,6 @@ func NewExamplesCmd() *cobra.Command {
|
||||||
return examplesCmd
|
return examplesCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
//func init() { // nolint: gochecknoinits
|
// func init() { // nolint: gochecknoinits
|
||||||
// examplesCmd.Flags().BoolVarP(&example, "example", "e", false, "example")
|
// examplesCmd.Flags().BoolVarP(&example, "example", "e", false, "example")
|
||||||
//}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ var getFieldsCmd = &cobra.Command{
|
||||||
Use: "get-fields",
|
Use: "get-fields",
|
||||||
Short: "get fields from file",
|
Short: "get fields from file",
|
||||||
Long: `...`,
|
Long: `...`,
|
||||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
PreRunE: func(_ *cobra.Command, _ []string) error {
|
||||||
typeStr := "data_source"
|
typeStr := "data_source"
|
||||||
if resType != "resource" && resType != "datasource" {
|
if resType != "resource" && resType != "datasource" {
|
||||||
return fmt.Errorf("--type can only be resource or datasource")
|
return fmt.Errorf("--type can only be resource or datasource")
|
||||||
|
|
@ -76,13 +76,13 @@ var getFieldsCmd = &cobra.Command{
|
||||||
|
|
||||||
//// Enum check
|
//// Enum check
|
||||||
// switch format {
|
// switch format {
|
||||||
//case "json", "yaml":
|
// case "json", "yaml":
|
||||||
//default:
|
//default:
|
||||||
// return fmt.Errorf("invalid --format: %s (want json|yaml)", format)
|
// return fmt.Errorf("invalid --format: %s (want json|yaml)", format)
|
||||||
//}
|
//}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(_ *cobra.Command, _ []string) error {
|
||||||
return getFields(filePath)
|
return getFields(filePath)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -107,31 +107,26 @@ func getTokens(fileName string) ([]string, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ast.Inspect(node, func(n ast.Node) bool {
|
ast.Inspect(
|
||||||
|
node, func(n ast.Node) bool {
|
||||||
// Suche nach Typ-Deklarationen (structs)
|
// Suche nach Typ-Deklarationen (structs)
|
||||||
ts, ok := n.(*ast.TypeSpec)
|
ts, ok := n.(*ast.TypeSpec)
|
||||||
if ok {
|
if ok {
|
||||||
if strings.Contains(ts.Name.Name, "Model") {
|
if strings.Contains(ts.Name.Name, "Model") {
|
||||||
// fmt.Printf("found model: %s\n", ts.Name.Name)
|
ast.Inspect(
|
||||||
ast.Inspect(ts, func(sn ast.Node) bool {
|
ts, func(sn ast.Node) bool {
|
||||||
tts, tok := sn.(*ast.Field)
|
tts, tok := sn.(*ast.Field)
|
||||||
if tok {
|
if tok {
|
||||||
// fmt.Printf(" found: %+v\n", tts.Names[0])
|
|
||||||
// spew.Dump(tts.Type)
|
|
||||||
|
|
||||||
result = append(result, tts.Names[0].String())
|
result = append(result, tts.Names[0].String())
|
||||||
|
|
||||||
// fld, fldOk := tts.Type.(*ast.Ident)
|
|
||||||
//if fldOk {
|
|
||||||
// fmt.Printf("type: %+v\n", fld)
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
},
|
||||||
|
)
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,9 +134,15 @@ func NewGetFieldsCmd() *cobra.Command {
|
||||||
return getFieldsCmd
|
return getFieldsCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { // nolint: gochecknoinits
|
func init() { //nolint:gochecknoinits //this is the only way to add the command to the rootCmd
|
||||||
getFieldsCmd.Flags().StringVarP(&inFile, "infile", "i", "", "input filename incl path")
|
getFieldsCmd.Flags().StringVarP(&inFile, "infile", "i", "", "input filename incl path")
|
||||||
getFieldsCmd.Flags().StringVarP(&svcName, "service", "s", "", "service name")
|
getFieldsCmd.Flags().StringVarP(&svcName, "service", "s", "", "service name")
|
||||||
getFieldsCmd.Flags().StringVarP(&resName, "resource", "r", "", "resource name")
|
getFieldsCmd.Flags().StringVarP(&resName, "resource", "r", "", "resource name")
|
||||||
getFieldsCmd.Flags().StringVarP(&resType, "type", "t", "resource", "resource type (data-source or resource [default])")
|
getFieldsCmd.Flags().StringVarP(
|
||||||
|
&resType,
|
||||||
|
"type",
|
||||||
|
"t",
|
||||||
|
"resource",
|
||||||
|
"resource type (data-source or resource [default])",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,36 +35,27 @@ type GpgPublicKey struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Provider) CreateArchitectureFiles() error {
|
func (p *Provider) CreateArchitectureFiles() error {
|
||||||
// var namespace, provider, distPath, repoName, version, gpgFingerprint, gpgPubKeyFile, domain string
|
|
||||||
|
|
||||||
log.Println("* Creating architecture files in target directories")
|
log.Println("* Creating architecture files in target directories")
|
||||||
|
|
||||||
// filename = terraform-provider-[provider]_0.0.1_darwin_amd64.zip - provider_name + version + target + architecture + .zip
|
|
||||||
// prefix := fmt.Sprintf("v1/providers/%s/%s/%s/", namespace, provider, version)
|
|
||||||
prefix := path.Join("v1", "providers", p.Namespace, p.Provider, p.Version)
|
prefix := path.Join("v1", "providers", p.Namespace, p.Provider, p.Version)
|
||||||
|
|
||||||
// pathPrefix := fmt.Sprintf("release/%s", prefix)
|
|
||||||
pathPrefix := path.Join("release", prefix)
|
pathPrefix := path.Join("release", prefix)
|
||||||
|
|
||||||
// urlPrefix := fmt.Sprintf("https://%s/%s", domain, prefix)
|
|
||||||
urlPrefix, err := url.JoinPath("https://", p.Domain, prefix)
|
urlPrefix, err := url.JoinPath("https://", p.Domain, prefix)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error creating base url: %w", err)
|
return fmt.Errorf("error creating base url: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// download url = https://example.com/v1/providers/namespace/provider/0.0.1/download/terraform-provider_0.0.1_darwin_amd64.zip
|
|
||||||
downloadUrlPrefix, err := url.JoinPath(urlPrefix, "download")
|
downloadUrlPrefix, err := url.JoinPath(urlPrefix, "download")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error crearting download url: %w", err)
|
return fmt.Errorf("error crearting download url: %w", err)
|
||||||
}
|
}
|
||||||
downloadPathPrefix := path.Join(pathPrefix, "download")
|
downloadPathPrefix := path.Join(pathPrefix, "download")
|
||||||
|
|
||||||
// shasums url = https://example.com/v1/providers/namespace/provider/0.0.1/terraform-provider_0.0.1_SHA256SUMS
|
|
||||||
shasumsUrl, err := url.JoinPath(urlPrefix, fmt.Sprintf("%s_%s_SHA256SUMS", p.RepoName, p.Version))
|
shasumsUrl, err := url.JoinPath(urlPrefix, fmt.Sprintf("%s_%s_SHA256SUMS", p.RepoName, p.Version))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error creating shasums url: %w", err)
|
return fmt.Errorf("error creating shasums url: %w", err)
|
||||||
}
|
}
|
||||||
// shasums_signature_url = https://example.com/v1/providers/namespace/provider/0.0.1/terraform-provider_0.0.1_SHA256SUMS.sig
|
|
||||||
shasumsSigUrl := shasumsUrl + ".sig"
|
shasumsSigUrl := shasumsUrl + ".sig"
|
||||||
|
|
||||||
gpgAsciiPub, err := p.ReadGpgFile()
|
gpgAsciiPub, err := p.ReadGpgFile()
|
||||||
|
|
@ -116,33 +107,6 @@ func (p *Provider) CreateArchitectureFiles() error {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// var architectureTemplate = []byte(fmt.Sprintf(`
|
|
||||||
//{
|
|
||||||
// "protocols": [
|
|
||||||
// "4.0",
|
|
||||||
// "5.1",
|
|
||||||
// "6.0"
|
|
||||||
// ],
|
|
||||||
// "os": "%s",
|
|
||||||
// "arch": "%s",
|
|
||||||
// "filename": "%s",
|
|
||||||
// "download_url": "%s",
|
|
||||||
// "shasums_url": "%s",
|
|
||||||
// "shasums_signature_url": "%s",
|
|
||||||
// "shasum": "%s",
|
|
||||||
// "signing_keys": {
|
|
||||||
// "gpg_public_keys": [
|
|
||||||
// {
|
|
||||||
// "key_id": "%s",
|
|
||||||
// "ascii_armor": "%s",
|
|
||||||
// "trust_signature": "",
|
|
||||||
// "source": "",
|
|
||||||
// "source_url": ""
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
// `, target, arch, fileName, downloadUrl, shasumsUrl, shasumsSigUrl, shasum, gpgFingerprint, gpgAsciiPub))
|
|
||||||
|
|
||||||
log.Printf(" - Arch file: %s", archFileName)
|
log.Printf(" - Arch file: %s", archFileName)
|
||||||
|
|
||||||
|
|
@ -160,8 +124,12 @@ func WriteArchitectureFile(filePath string, arch Architecture) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error encoding data: %w", err)
|
return fmt.Errorf("error encoding data: %w", err)
|
||||||
}
|
}
|
||||||
|
//nolint:gosec // this file is not sensitive, so we can use os.ModePerm
|
||||||
err = os.WriteFile(filePath, jsonString, os.ModePerm)
|
err = os.WriteFile(
|
||||||
|
filePath,
|
||||||
|
jsonString,
|
||||||
|
os.ModePerm,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error writing data: %w", err)
|
return fmt.Errorf("error writing data: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,10 +161,12 @@ func (p *Provider) createVersionsFile() error {
|
||||||
target := fileNameSplit[2]
|
target := fileNameSplit[2]
|
||||||
arch := fileNameSplit[3]
|
arch := fileNameSplit[3]
|
||||||
|
|
||||||
version.Platforms = append(version.Platforms, Platform{
|
version.Platforms = append(
|
||||||
|
version.Platforms, Platform{
|
||||||
OS: target,
|
OS: target,
|
||||||
Arch: arch,
|
Arch: arch,
|
||||||
})
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
data := Data{}
|
data := Data{}
|
||||||
|
|
@ -206,16 +208,19 @@ func (p *Provider) CreateWellKnown() error {
|
||||||
log.Println("* Creating .well-known directory")
|
log.Println("* Creating .well-known directory")
|
||||||
pathString := path.Join(p.RootPath, "release", ".well-known")
|
pathString := path.Join(p.RootPath, "release", ".well-known")
|
||||||
|
|
||||||
|
//nolint:gosec // this file is not sensitive, so we can use ModePerm
|
||||||
err := os.MkdirAll(pathString, os.ModePerm)
|
err := os.MkdirAll(pathString, os.ModePerm)
|
||||||
if err != nil && !errors.Is(err, fs.ErrExist) {
|
if err != nil && !errors.Is(err, fs.ErrExist) {
|
||||||
return fmt.Errorf("error creating '%s' dir: %w", pathString, err)
|
return fmt.Errorf("error creating '%s' dir: %w", pathString, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println(" - Writing to .well-known/terraform.json file")
|
log.Println(" - Writing to .well-known/terraform.json file")
|
||||||
|
|
||||||
|
//nolint:gosec // this file is not sensitive, so we can use 0644
|
||||||
err = os.WriteFile(
|
err = os.WriteFile(
|
||||||
fmt.Sprintf("%s/terraform.json", pathString),
|
fmt.Sprintf("%s/terraform.json", pathString),
|
||||||
[]byte(`{"providers.v1": "/v1/providers/"}`),
|
[]byte(`{"providers.v1": "/v1/providers/"}`),
|
||||||
0644,
|
0o644,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -224,9 +229,10 @@ func (p *Provider) CreateWellKnown() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateDir(path string) error {
|
func CreateDir(pathValue string) error {
|
||||||
log.Printf("* Creating %s directory", path)
|
log.Printf("* Creating %s directory", pathValue)
|
||||||
err := os.MkdirAll(path, os.ModePerm)
|
//nolint:gosec // this file is not sensitive, so we can use ModePerm
|
||||||
|
err := os.MkdirAll(pathValue, os.ModePerm)
|
||||||
if errors.Is(err, fs.ErrExist) {
|
if errors.Is(err, fs.ErrExist) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -269,13 +275,23 @@ func CopyFile(src, dst string) (int64, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
defer source.Close()
|
defer func(source *os.File) {
|
||||||
|
err := source.Close()
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("error closing source file", slog.Any("err", err))
|
||||||
|
}
|
||||||
|
}(source)
|
||||||
|
|
||||||
destination, err := os.Create(dst)
|
destination, err := os.Create(dst)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
defer destination.Close()
|
defer func(destination *os.File) {
|
||||||
|
err := destination.Close()
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("error closing destination file", slog.Any("err", err))
|
||||||
|
}
|
||||||
|
}(destination)
|
||||||
nBytes, err := io.Copy(destination, source)
|
nBytes, err := io.Copy(destination, source)
|
||||||
return nBytes, err
|
return nBytes, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,12 @@ func (d *Data) WriteToFile(filePath string) error {
|
||||||
return fmt.Errorf("error encoding data: %w", err)
|
return fmt.Errorf("error encoding data: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.WriteFile(filePath, jsonString, os.ModePerm)
|
//nolint:gosec // this file is not sensitive, so we can use os.ModePerm
|
||||||
|
err = os.WriteFile(
|
||||||
|
filePath,
|
||||||
|
jsonString,
|
||||||
|
os.ModePerm,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error writing data: %w", err)
|
return fmt.Errorf("error writing data: %w", err)
|
||||||
}
|
}
|
||||||
|
|
@ -86,7 +91,13 @@ func (d *Data) LoadFromUrl(uri string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer os.Remove(file.Name()) // Clean up
|
defer func(name string) {
|
||||||
|
//nolint:gosec // The file path is generated by os.CreateTemp and is not user-controllable
|
||||||
|
err := os.Remove(name)
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("failed to remove temporary file", slog.Any("err", err))
|
||||||
|
}
|
||||||
|
}(file.Name()) // Clean up
|
||||||
|
|
||||||
err = DownloadFile(
|
err = DownloadFile(
|
||||||
u.String(),
|
u.String(),
|
||||||
|
|
@ -123,20 +134,30 @@ func (v *Version) AddProtocol(p string) error {
|
||||||
// DownloadFile will download a url and store it in local filepath.
|
// DownloadFile will download a url and store it in local filepath.
|
||||||
// It writes to the destination file as it downloads it, without
|
// It writes to the destination file as it downloads it, without
|
||||||
// loading the entire file into memory.
|
// loading the entire file into memory.
|
||||||
func DownloadFile(url string, filepath string) error {
|
func DownloadFile(urlValue, filepath string) error {
|
||||||
// Create the file
|
// Create the file
|
||||||
|
//nolint:gosec // path traversal is not a concern here, as the filepath is generated by us and not user input
|
||||||
out, err := os.Create(filepath)
|
out, err := os.Create(filepath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer out.Close()
|
defer func(out *os.File) {
|
||||||
|
err := out.Close()
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("failed to close file", slog.Any("err", err))
|
||||||
|
}
|
||||||
|
}(out)
|
||||||
|
|
||||||
// Get the data
|
// Get the data
|
||||||
resp, err := http.Get(url)
|
|
||||||
|
//nolint:gosec,bodyclose // this is a controlled URL, not user input
|
||||||
|
resp, err := http.Get(urlValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer func(Body io.ReadCloser) {
|
||||||
|
_ = Body.Close()
|
||||||
|
}(resp.Body)
|
||||||
|
|
||||||
// Write the body to file
|
// Write the body to file
|
||||||
_, err = io.Copy(out, resp.Body)
|
_, err = io.Copy(out, resp.Body)
|
||||||
|
|
|
||||||
|
|
@ -29,20 +29,32 @@ var publishCmd = &cobra.Command{
|
||||||
Use: "publish",
|
Use: "publish",
|
||||||
Short: "Publish terraform provider",
|
Short: "Publish terraform provider",
|
||||||
Long: `...`,
|
Long: `...`,
|
||||||
RunE: func(_ *cobra.Command, args []string) error {
|
RunE: func(_ *cobra.Command, _ []string) error {
|
||||||
return publish()
|
return publish()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { // nolint: gochecknoinits
|
func init() { //nolint:gochecknoinits //this is the standard way to set up cobra commands
|
||||||
publishCmd.Flags().StringVarP(&namespace, "namespace", "n", "", "Namespace for the Terraform registry.")
|
publishCmd.Flags().StringVarP(&namespace, "namespace", "n", "", "Namespace for the Terraform registry.")
|
||||||
publishCmd.Flags().StringVarP(&domain, "domain", "d", "", "Domain for the Terraform registry.")
|
publishCmd.Flags().StringVarP(&domain, "domain", "d", "", "Domain for the Terraform registry.")
|
||||||
publishCmd.Flags().StringVarP(&providerName, "providerName", "p", "", "ProviderName for the Terraform registry.")
|
publishCmd.Flags().StringVarP(&providerName, "providerName", "p", "", "ProviderName for the Terraform registry.")
|
||||||
publishCmd.Flags().StringVarP(&distPath, "distPath", "x", "dist", "Dist Path for the Terraform registry.")
|
publishCmd.Flags().StringVarP(&distPath, "distPath", "x", "dist", "Dist Path for the Terraform registry.")
|
||||||
publishCmd.Flags().StringVarP(&repoName, "repoName", "r", "", "RepoName for the Terraform registry.")
|
publishCmd.Flags().StringVarP(&repoName, "repoName", "r", "", "RepoName for the Terraform registry.")
|
||||||
publishCmd.Flags().StringVarP(&version, "version", "v", "", "Version for the Terraform registry.")
|
publishCmd.Flags().StringVarP(&version, "version", "v", "", "Version for the Terraform registry.")
|
||||||
publishCmd.Flags().StringVarP(&gpgFingerprint, "gpgFingerprint", "f", "", "GPG Fingerprint for the Terraform registry.")
|
publishCmd.Flags().StringVarP(
|
||||||
publishCmd.Flags().StringVarP(&gpgPubKeyFile, "gpgPubKeyFile", "k", "", "GPG PubKey file name for the Terraform registry.")
|
&gpgFingerprint,
|
||||||
|
"gpgFingerprint",
|
||||||
|
"f",
|
||||||
|
"",
|
||||||
|
"GPG Fingerprint for the Terraform registry.",
|
||||||
|
)
|
||||||
|
publishCmd.Flags().StringVarP(
|
||||||
|
&gpgPubKeyFile,
|
||||||
|
"gpgPubKeyFile",
|
||||||
|
"k",
|
||||||
|
"",
|
||||||
|
"GPG PubKey file name for the Terraform registry.",
|
||||||
|
)
|
||||||
|
|
||||||
err := publishCmd.MarkFlagRequired("namespace")
|
err := publishCmd.MarkFlagRequired("namespace")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -105,6 +117,7 @@ func publish() error {
|
||||||
|
|
||||||
// Create release dir - only the contents of this need to be uploaded to S3
|
// Create release dir - only the contents of this need to be uploaded to S3
|
||||||
log.Printf("* Creating release directory")
|
log.Printf("* Creating release directory")
|
||||||
|
//nolint:gosec // this directory is not sensitive, so we can use 0750
|
||||||
err = os.MkdirAll(path.Join(p.RootPath, "release"), os.ModePerm)
|
err = os.MkdirAll(path.Join(p.RootPath, "release"), os.ModePerm)
|
||||||
if err != nil && !errors.Is(err, fs.ErrExist) {
|
if err != nil && !errors.Is(err, fs.ErrExist) {
|
||||||
return fmt.Errorf("error creating '%s' dir: %w", path.Join(p.RootPath, "release"), err)
|
return fmt.Errorf("error creating '%s' dir: %w", path.Join(p.RootPath, "release"), err)
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_database Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_database (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_postgresflexalpha_database" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `database_id` (Number) The ID of the database.
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `id` (String) Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`,`database_id`\".",
|
|
||||||
- `name` (String) The name of the database.
|
|
||||||
- `owner` (String) The owner of the database.
|
|
||||||
- `tf_original_api_id` (Number) The id of the database.
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_flavor Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_flavor (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_postgresflexalpha_flavor" "flavor" {
|
|
||||||
project_id = var.project_id
|
|
||||||
region = var.region
|
|
||||||
cpu = 4
|
|
||||||
ram = 16
|
|
||||||
node_type = "Single"
|
|
||||||
storage_class = "premium-perf2-stackit"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `cpu` (Number) The cpu count of the instance.
|
|
||||||
- `node_type` (String) defines the nodeType it can be either single or replica
|
|
||||||
- `project_id` (String) The cpu count of the instance.
|
|
||||||
- `ram` (Number) The memory of the instance in Gibibyte.
|
|
||||||
- `region` (String) The flavor description.
|
|
||||||
- `storage_class` (String) The memory of the instance in Gibibyte.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `description` (String) The flavor description.
|
|
||||||
- `flavor_id` (String) The flavor id of the instance flavor.
|
|
||||||
- `id` (String) The terraform id of the instance flavor.
|
|
||||||
- `max_gb` (Number) maximum storage which can be ordered for the flavor in Gigabyte.
|
|
||||||
- `min_gb` (Number) minimum storage which is required to order in Gigabyte.
|
|
||||||
- `storage_classes` (Attributes List) (see [below for nested schema](#nestedatt--storage_classes))
|
|
||||||
|
|
||||||
<a id="nestedatt--storage_classes"></a>
|
|
||||||
### Nested Schema for `storage_classes`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `class` (String)
|
|
||||||
- `max_io_per_sec` (Number)
|
|
||||||
- `max_through_in_mb` (Number)
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_flavors Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_flavors (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `page` (Number) Number of the page of items list to be returned.
|
|
||||||
- `size` (Number) Number of items to be returned on each page.
|
|
||||||
- `sort` (String) Sorting of the flavors to be returned on each page.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `flavors` (Attributes List) List of flavors available for the project. (see [below for nested schema](#nestedatt--flavors))
|
|
||||||
- `pagination` (Attributes) (see [below for nested schema](#nestedatt--pagination))
|
|
||||||
|
|
||||||
<a id="nestedatt--flavors"></a>
|
|
||||||
### Nested Schema for `flavors`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `cpu` (Number) The cpu count of the instance.
|
|
||||||
- `description` (String) The flavor description.
|
|
||||||
- `max_gb` (Number) maximum storage which can be ordered for the flavor in Gigabyte.
|
|
||||||
- `memory` (Number) The memory of the instance in Gibibyte.
|
|
||||||
- `min_gb` (Number) minimum storage which is required to order in Gigabyte.
|
|
||||||
- `node_type` (String) defines the nodeType it can be either single or replica
|
|
||||||
- `storage_classes` (Attributes List) maximum storage which can be ordered for the flavor in Gigabyte. (see [below for nested schema](#nestedatt--flavors--storage_classes))
|
|
||||||
- `tf_original_api_id` (String) The id of the instance flavor.
|
|
||||||
|
|
||||||
<a id="nestedatt--flavors--storage_classes"></a>
|
|
||||||
### Nested Schema for `flavors.storage_classes`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `class` (String)
|
|
||||||
- `max_io_per_sec` (Number)
|
|
||||||
- `max_through_in_mb` (Number)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--pagination"></a>
|
|
||||||
### Nested Schema for `pagination`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `page` (Number)
|
|
||||||
- `size` (Number)
|
|
||||||
- `sort` (String)
|
|
||||||
- `total_pages` (Number)
|
|
||||||
- `total_rows` (Number)
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_instance Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_instance (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_postgresflexalpha_instance" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `acl` (List of String) List of IPV4 cidr.
|
|
||||||
- `backup_schedule` (String) The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
|
|
||||||
- `connection_info` (Attributes) The DNS name and port in the instance overview (see [below for nested schema](#nestedatt--connection_info))
|
|
||||||
- `encryption` (Attributes) The configuration for instance's volume and backup storage encryption.
|
|
||||||
|
|
||||||
⚠ **Note:** 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. (see [below for nested schema](#nestedatt--encryption))
|
|
||||||
- `flavor_id` (String) The id of the instance flavor.
|
|
||||||
- `is_deletable` (Boolean) Whether the instance can be deleted or not.
|
|
||||||
- `name` (String) The name of the instance.
|
|
||||||
- `network` (Attributes) The access configuration of the instance (see [below for nested schema](#nestedatt--network))
|
|
||||||
- `replicas` (Number) How many replicas the instance should have.
|
|
||||||
- `retention_days` (Number) How long backups are retained. The value can only be between 32 and 365 days.
|
|
||||||
- `status` (String) The current status of the instance.
|
|
||||||
- `storage` (Attributes) The object containing information about the storage size and class. (see [below for nested schema](#nestedatt--storage))
|
|
||||||
- `tf_original_api_id` (String) The ID of the instance.
|
|
||||||
- `version` (String) The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters.
|
|
||||||
|
|
||||||
<a id="nestedatt--connection_info"></a>
|
|
||||||
### Nested Schema for `connection_info`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `host` (String) The host of the instance.
|
|
||||||
- `port` (Number) The port of the instance.
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--encryption"></a>
|
|
||||||
### Nested Schema for `encryption`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `kek_key_id` (String) The encryption-key key identifier
|
|
||||||
- `kek_key_ring_id` (String) The encryption-key keyring identifier
|
|
||||||
- `kek_key_version` (String) The encryption-key version
|
|
||||||
- `service_account` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--network"></a>
|
|
||||||
### Nested Schema for `network`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `access_scope` (String) The access scope of the instance. It defines if the instance is public or airgapped.
|
|
||||||
- `acl` (List of String) List of IPV4 cidr.
|
|
||||||
- `instance_address` (String)
|
|
||||||
- `router_address` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--storage"></a>
|
|
||||||
### Nested Schema for `storage`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `performance_class` (String) The storage class for the storage.
|
|
||||||
- `size` (Number) The storage size in Gigabytes.
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_user Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_user (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_postgresflexalpha_user" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
- `user_id` (Number) The ID of the user.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `id` (String) Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`,`user_id`\".",
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `name` (String) The name of the user.
|
|
||||||
- `roles` (List of String) A list of user roles.
|
|
||||||
- `status` (String) The current status of the user.
|
|
||||||
- `tf_original_api_id` (Number) The ID of the user.
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexalpha_database Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexalpha_database (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `database_name` (String) The name of the database.
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `collation_name` (String) The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint.
|
|
||||||
- `compatibility_level` (Number) CompatibilityLevel of the Database.
|
|
||||||
- `id` (String) The terraform internal identifier.
|
|
||||||
- `name` (String) The name of the database.
|
|
||||||
- `owner` (String) The owner of the database.
|
|
||||||
- `tf_original_api_id` (Number) The id of the database.
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexalpha_flavor Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexalpha_flavor (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_sqlserverflexalpha_flavor" "flavor" {
|
|
||||||
project_id = var.project_id
|
|
||||||
region = var.region
|
|
||||||
cpu = 4
|
|
||||||
ram = 16
|
|
||||||
node_type = "Single"
|
|
||||||
storage_class = "premium-perf2-stackit"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `cpu` (Number) The cpu count of the instance.
|
|
||||||
- `node_type` (String) defines the nodeType it can be either single or HA
|
|
||||||
- `project_id` (String) The project ID of the flavor.
|
|
||||||
- `ram` (Number) The memory of the instance in Gibibyte.
|
|
||||||
- `region` (String) The region of the flavor.
|
|
||||||
- `storage_class` (String) The memory of the instance in Gibibyte.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `description` (String) The flavor description.
|
|
||||||
- `flavor_id` (String) The id of the instance flavor.
|
|
||||||
- `id` (String) The id of the instance flavor.
|
|
||||||
- `max_gb` (Number) maximum storage which can be ordered for the flavor in Gigabyte.
|
|
||||||
- `min_gb` (Number) minimum storage which is required to order in Gigabyte.
|
|
||||||
- `storage_classes` (Attributes List) maximum storage which can be ordered for the flavor in Gigabyte. (see [below for nested schema](#nestedatt--storage_classes))
|
|
||||||
|
|
||||||
<a id="nestedatt--storage_classes"></a>
|
|
||||||
### Nested Schema for `storage_classes`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `class` (String)
|
|
||||||
- `max_io_per_sec` (Number)
|
|
||||||
- `max_through_in_mb` (Number)
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexalpha_instance Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexalpha_instance (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_sqlserverflexalpha_instance" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `backup_schedule` (String) The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
|
|
||||||
- `edition` (String) Edition of the MSSQL server instance
|
|
||||||
- `encryption` (Attributes) this defines which key to use for storage encryption (see [below for nested schema](#nestedatt--encryption))
|
|
||||||
- `flavor_id` (String) The id of the instance flavor.
|
|
||||||
- `is_deletable` (Boolean) Whether the instance can be deleted or not.
|
|
||||||
- `name` (String) The name of the instance.
|
|
||||||
- `network` (Attributes) The access configuration of the instance (see [below for nested schema](#nestedatt--network))
|
|
||||||
- `replicas` (Number) How many replicas the instance should have.
|
|
||||||
- `retention_days` (Number) The days for how long the backup files should be stored before cleaned up. 30 to 365
|
|
||||||
- `status` (String)
|
|
||||||
- `storage` (Attributes) The object containing information about the storage size and class. (see [below for nested schema](#nestedatt--storage))
|
|
||||||
- `tf_original_api_id` (String) The ID of the instance.
|
|
||||||
- `version` (String) The sqlserver version used for the instance.
|
|
||||||
|
|
||||||
<a id="nestedatt--encryption"></a>
|
|
||||||
### Nested Schema for `encryption`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `kek_key_id` (String) The key identifier
|
|
||||||
- `kek_key_ring_id` (String) The keyring identifier
|
|
||||||
- `kek_key_version` (String) The key version
|
|
||||||
- `service_account` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--network"></a>
|
|
||||||
### Nested Schema for `network`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `access_scope` (String) The network access scope of the instance
|
|
||||||
|
|
||||||
⚠️ **Note:** 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.
|
|
||||||
- `acl` (List of String) List of IPV4 cidr.
|
|
||||||
- `instance_address` (String)
|
|
||||||
- `router_address` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--storage"></a>
|
|
||||||
### Nested Schema for `storage`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `class` (String) The storage class for the storage.
|
|
||||||
- `size` (Number) The storage size in Gigabytes.
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexalpha_user Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexalpha_user (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_sqlserverflexalpha_user" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `page` (Number) Number of the page of items list to be returned.
|
|
||||||
- `size` (Number) Number of items to be returned on each page.
|
|
||||||
- `sort` (String) Sorting of the users to be returned on each page.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `pagination` (Attributes) (see [below for nested schema](#nestedatt--pagination))
|
|
||||||
- `users` (Attributes List) List of all users inside an instance (see [below for nested schema](#nestedatt--users))
|
|
||||||
|
|
||||||
<a id="nestedatt--pagination"></a>
|
|
||||||
### Nested Schema for `pagination`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `page` (Number)
|
|
||||||
- `size` (Number)
|
|
||||||
- `sort` (String)
|
|
||||||
- `total_pages` (Number)
|
|
||||||
- `total_rows` (Number)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--users"></a>
|
|
||||||
### Nested Schema for `users`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `status` (String) The current status of the user.
|
|
||||||
- `tf_original_api_id` (Number) The ID of the user.
|
|
||||||
- `username` (String) The name of the user.
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexbeta_database Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexbeta_database (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_sqlserverflexbeta_database" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
database_name = "dbname"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `database_name` (String) The name of the database.
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `collation_name` (String) The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint.
|
|
||||||
- `compatibility_level` (Number) CompatibilityLevel of the Database.
|
|
||||||
- `id` (String) The terraform internal identifier.
|
|
||||||
- `name` (String) The name of the database.
|
|
||||||
- `owner` (String) The owner of the database.
|
|
||||||
- `tf_original_api_id` (Number) The id of the database.
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexbeta_flavor Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexbeta_flavor (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_sqlserverflexbeta_flavor" "flavor" {
|
|
||||||
project_id = var.project_id
|
|
||||||
region = var.region
|
|
||||||
cpu = 4
|
|
||||||
ram = 16
|
|
||||||
node_type = "Single"
|
|
||||||
storage_class = "premium-perf2-stackit"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `cpu` (Number) The cpu count of the instance.
|
|
||||||
- `node_type` (String) defines the nodeType it can be either single or HA
|
|
||||||
- `project_id` (String) The project ID of the flavor.
|
|
||||||
- `ram` (Number) The memory of the instance in Gibibyte.
|
|
||||||
- `region` (String) The region of the flavor.
|
|
||||||
- `storage_class` (String) The memory of the instance in Gibibyte.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `description` (String) The flavor description.
|
|
||||||
- `flavor_id` (String) The id of the instance flavor.
|
|
||||||
- `id` (String) The id of the instance flavor.
|
|
||||||
- `max_gb` (Number) maximum storage which can be ordered for the flavor in Gigabyte.
|
|
||||||
- `min_gb` (Number) minimum storage which is required to order in Gigabyte.
|
|
||||||
- `storage_classes` (Attributes List) maximum storage which can be ordered for the flavor in Gigabyte. (see [below for nested schema](#nestedatt--storage_classes))
|
|
||||||
|
|
||||||
<a id="nestedatt--storage_classes"></a>
|
|
||||||
### Nested Schema for `storage_classes`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `class` (String)
|
|
||||||
- `max_io_per_sec` (Number)
|
|
||||||
- `max_through_in_mb` (Number)
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexbeta_instance Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexbeta_instance (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
data "stackitprivatepreview_sqlserverflexbeta_instance" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `backup_schedule` (String) The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
|
|
||||||
- `edition` (String) Edition of the MSSQL server instance
|
|
||||||
- `encryption` (Attributes) this defines which key to use for storage encryption (see [below for nested schema](#nestedatt--encryption))
|
|
||||||
- `flavor_id` (String) The id of the instance flavor.
|
|
||||||
- `is_deletable` (Boolean) Whether the instance can be deleted or not.
|
|
||||||
- `name` (String) The name of the instance.
|
|
||||||
- `network` (Attributes) The access configuration of the instance (see [below for nested schema](#nestedatt--network))
|
|
||||||
- `replicas` (Number) How many replicas the instance should have.
|
|
||||||
- `retention_days` (Number) The days for how long the backup files should be stored before cleaned up. 30 to 365
|
|
||||||
- `status` (String)
|
|
||||||
- `storage` (Attributes) The object containing information about the storage size and class. (see [below for nested schema](#nestedatt--storage))
|
|
||||||
- `tf_original_api_id` (String) The ID of the instance.
|
|
||||||
- `version` (String) The sqlserver version used for the instance.
|
|
||||||
|
|
||||||
<a id="nestedatt--encryption"></a>
|
|
||||||
### Nested Schema for `encryption`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `kek_key_id` (String) The key identifier
|
|
||||||
- `kek_key_ring_id` (String) The keyring identifier
|
|
||||||
- `kek_key_version` (String) The key version
|
|
||||||
- `service_account` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--network"></a>
|
|
||||||
### Nested Schema for `network`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `access_scope` (String) The network access scope of the instance
|
|
||||||
|
|
||||||
⚠️ **Note:** 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.
|
|
||||||
- `acl` (List of String) List of IPV4 cidr.
|
|
||||||
- `instance_address` (String)
|
|
||||||
- `router_address` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--storage"></a>
|
|
||||||
### Nested Schema for `storage`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `class` (String) The storage class for the storage.
|
|
||||||
- `size` (Number) The storage size in Gigabytes.
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexbeta_user Data Source - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexbeta_user (Data Source)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `page` (Number) Number of the page of items list to be returned.
|
|
||||||
- `size` (Number) Number of items to be returned on each page.
|
|
||||||
- `sort` (String) Sorting of the users to be returned on each page.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `pagination` (Attributes) (see [below for nested schema](#nestedatt--pagination))
|
|
||||||
- `users` (Attributes List) List of all users inside an instance (see [below for nested schema](#nestedatt--users))
|
|
||||||
|
|
||||||
<a id="nestedatt--pagination"></a>
|
|
||||||
### Nested Schema for `pagination`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `page` (Number)
|
|
||||||
- `size` (Number)
|
|
||||||
- `sort` (String)
|
|
||||||
- `total_pages` (Number)
|
|
||||||
- `total_rows` (Number)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--users"></a>
|
|
||||||
### Nested Schema for `users`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `status` (String) The current status of the user.
|
|
||||||
- `tf_original_api_id` (Number) The ID of the user.
|
|
||||||
- `username` (String) The name of the user.
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview Provider"
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview Provider
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
provider "stackitprivatepreview" {
|
|
||||||
default_region = "eu01"
|
|
||||||
}
|
|
||||||
|
|
||||||
provider "stackitprivatepreview" {
|
|
||||||
default_region = "eu01"
|
|
||||||
service_account_key_path = "service_account.json"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Authentication
|
|
||||||
|
|
||||||
# Key flow
|
|
||||||
provider "stackitprivatepreview" {
|
|
||||||
default_region = "eu01"
|
|
||||||
service_account_key = var.service_account_key
|
|
||||||
private_key = var.private_key
|
|
||||||
}
|
|
||||||
|
|
||||||
# Key flow (using path)
|
|
||||||
provider "stackitprivatepreview" {
|
|
||||||
default_region = "eu01"
|
|
||||||
service_account_key_path = var.service_account_key_path
|
|
||||||
private_key_path = var.private_key_path
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `authorization_custom_endpoint` (String) Custom endpoint for the Membership service
|
|
||||||
- `cdn_custom_endpoint` (String) Custom endpoint for the CDN service
|
|
||||||
- `credentials_path` (String) Path of JSON from where the credentials are read. Takes precedence over the env var `STACKIT_CREDENTIALS_PATH`. Default value is `~/.stackit/credentials.json`.
|
|
||||||
- `default_region` (String) Region will be used as the default location for regional services. Not all services require a region, some are global
|
|
||||||
- `dns_custom_endpoint` (String) Custom endpoint for the DNS service
|
|
||||||
- `enable_beta_resources` (Boolean) Enable beta resources. Default is false.
|
|
||||||
- `experiments` (List of String) Enables experiments. These are unstable features without official support. More information can be found in the README. Available Experiments: iam, routing-tables, network
|
|
||||||
- `git_custom_endpoint` (String) Custom endpoint for the Git service
|
|
||||||
- `iaas_custom_endpoint` (String) Custom endpoint for the IaaS service
|
|
||||||
- `kms_custom_endpoint` (String) Custom endpoint for the KMS service
|
|
||||||
- `loadbalancer_custom_endpoint` (String) Custom endpoint for the Load Balancer service
|
|
||||||
- `logme_custom_endpoint` (String) Custom endpoint for the LogMe service
|
|
||||||
- `mariadb_custom_endpoint` (String) Custom endpoint for the MariaDB service
|
|
||||||
- `modelserving_custom_endpoint` (String) Custom endpoint for the AI Model Serving service
|
|
||||||
- `mongodbflex_custom_endpoint` (String) Custom endpoint for the MongoDB Flex service
|
|
||||||
- `objectstorage_custom_endpoint` (String) Custom endpoint for the Object Storage service
|
|
||||||
- `observability_custom_endpoint` (String) Custom endpoint for the Observability service
|
|
||||||
- `opensearch_custom_endpoint` (String) Custom endpoint for the OpenSearch service
|
|
||||||
- `postgresflex_custom_endpoint` (String) Custom endpoint for the PostgresFlex service
|
|
||||||
- `private_key` (String) Private RSA key used for authentication, relevant for the key flow. It takes precedence over the private key that is included in the service account key.
|
|
||||||
- `private_key_path` (String) Path for the private RSA key used for authentication, relevant for the key flow. It takes precedence over the private key that is included in the service account key.
|
|
||||||
- `rabbitmq_custom_endpoint` (String) Custom endpoint for the RabbitMQ service
|
|
||||||
- `redis_custom_endpoint` (String) Custom endpoint for the Redis service
|
|
||||||
- `region` (String, Deprecated) Region will be used as the default location for regional services. Not all services require a region, some are global
|
|
||||||
- `resourcemanager_custom_endpoint` (String) Custom endpoint for the Resource Manager service
|
|
||||||
- `scf_custom_endpoint` (String) Custom endpoint for the Cloud Foundry (SCF) service
|
|
||||||
- `secretsmanager_custom_endpoint` (String) Custom endpoint for the Secrets Manager service
|
|
||||||
- `server_backup_custom_endpoint` (String) Custom endpoint for the Server Backup service
|
|
||||||
- `server_update_custom_endpoint` (String) Custom endpoint for the Server Update service
|
|
||||||
- `service_account_custom_endpoint` (String) Custom endpoint for the Service Account service
|
|
||||||
- `service_account_email` (String, Deprecated) Service account email. It can also be set using the environment variable STACKIT_SERVICE_ACCOUNT_EMAIL. It is required if you want to use the resource manager project resource.
|
|
||||||
- `service_account_key` (String) Service account key used for authentication. If set, the key flow will be used to authenticate all operations.
|
|
||||||
- `service_account_key_path` (String) Path for the service account key used for authentication. If set, the key flow will be used to authenticate all operations.
|
|
||||||
- `service_account_token` (String, Deprecated) Token used for authentication. If set, the token flow will be used to authenticate all operations.
|
|
||||||
- `service_enablement_custom_endpoint` (String) Custom endpoint for the Service Enablement API
|
|
||||||
- `ske_custom_endpoint` (String) Custom endpoint for the Kubernetes Engine (SKE) service
|
|
||||||
- `sqlserverflex_custom_endpoint` (String) Custom endpoint for the SQL Server Flex service
|
|
||||||
- `token_custom_endpoint` (String) Custom endpoint for the token API, which is used to request access tokens when using the key flow
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_database Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_database (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
resource "stackitprivatepreview_postgresflexalpha_database" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
name = "mydb"
|
|
||||||
owner = "myusername"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Only use the import statement, if you want to import an existing postgresflex database
|
|
||||||
import {
|
|
||||||
to = stackitprivatepreview_postgresflexalpha_database.import-example
|
|
||||||
id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.postgres_database_id}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `name` (String) The name of the database.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `database_id` (Number) The ID of the database.
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `owner` (String) The owner of the database.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `id` (Number) The id of the database.
|
|
||||||
|
|
@ -1,131 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_instance Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_instance (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
resource "stackitprivatepreview_postgresflexalpha_instance" "msh-instance-only" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
name = "example-instance"
|
|
||||||
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
|
|
||||||
backup_schedule = "0 0 * * *"
|
|
||||||
retention_days = 30
|
|
||||||
flavor_id = "flavor.id"
|
|
||||||
replicas = 1
|
|
||||||
storage = {
|
|
||||||
performance_class = "premium-perf2-stackit"
|
|
||||||
size = 10
|
|
||||||
}
|
|
||||||
encryption = {
|
|
||||||
kek_key_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
kek_key_ring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
kek_key_version = 1
|
|
||||||
service_account = "service@account.email"
|
|
||||||
}
|
|
||||||
network = {
|
|
||||||
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
|
|
||||||
access_scope = "PUBLIC"
|
|
||||||
}
|
|
||||||
version = 17
|
|
||||||
}
|
|
||||||
|
|
||||||
# Only use the import statement, if you want to import an existing postgresflex instance
|
|
||||||
import {
|
|
||||||
to = stackitprivatepreview_postgresflexalpha_instance.import-example
|
|
||||||
id = "${var.project_id},${var.region},${var.postgres_instance_id}"
|
|
||||||
}
|
|
||||||
|
|
||||||
import {
|
|
||||||
to = stackitprivatepreview_postgresflexalpha_instance.import-example
|
|
||||||
identity = {
|
|
||||||
project_id = var.project_id
|
|
||||||
region = var.region
|
|
||||||
instance_id = var.postgres_instance_id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `backup_schedule` (String) The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
|
|
||||||
- `flavor_id` (String) The id of the instance flavor.
|
|
||||||
- `name` (String) The name of the instance.
|
|
||||||
- `network` (Attributes) The access configuration of the instance (see [below for nested schema](#nestedatt--network))
|
|
||||||
- `replicas` (Number) How many replicas the instance should have.
|
|
||||||
- `retention_days` (Number) How long backups are retained. The value can only be between 32 and 365 days.
|
|
||||||
- `storage` (Attributes) The object containing information about the storage size and class. (see [below for nested schema](#nestedatt--storage))
|
|
||||||
- `version` (String) The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `encryption` (Attributes) The configuration for instance's volume and backup storage encryption.
|
|
||||||
|
|
||||||
⚠ **Note:** 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. (see [below for nested schema](#nestedatt--encryption))
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `acl` (List of String) List of IPV4 cidr.
|
|
||||||
- `connection_info` (Attributes) The DNS name and port in the instance overview (see [below for nested schema](#nestedatt--connection_info))
|
|
||||||
- `id` (String) The ID of the instance.
|
|
||||||
- `is_deletable` (Boolean) Whether the instance can be deleted or not.
|
|
||||||
- `status` (String) The current status of the instance.
|
|
||||||
|
|
||||||
<a id="nestedatt--network"></a>
|
|
||||||
### Nested Schema for `network`
|
|
||||||
|
|
||||||
Required:
|
|
||||||
|
|
||||||
- `acl` (List of String) List of IPV4 cidr.
|
|
||||||
|
|
||||||
Optional:
|
|
||||||
|
|
||||||
- `access_scope` (String) The access scope of the instance. It defines if the instance is public or airgapped.
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `instance_address` (String)
|
|
||||||
- `router_address` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--storage"></a>
|
|
||||||
### Nested Schema for `storage`
|
|
||||||
|
|
||||||
Required:
|
|
||||||
|
|
||||||
- `performance_class` (String) The storage class for the storage.
|
|
||||||
- `size` (Number) The storage size in Gigabytes.
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--encryption"></a>
|
|
||||||
### Nested Schema for `encryption`
|
|
||||||
|
|
||||||
Required:
|
|
||||||
|
|
||||||
- `kek_key_id` (String) The encryption-key key identifier
|
|
||||||
- `kek_key_ring_id` (String) The encryption-key keyring identifier
|
|
||||||
- `kek_key_version` (String) The encryption-key version
|
|
||||||
- `service_account` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--connection_info"></a>
|
|
||||||
### Nested Schema for `connection_info`
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `host` (String) The host of the instance.
|
|
||||||
- `port` (Number) The port of the instance.
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_postgresflexalpha_user Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_postgresflexalpha_user (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
resource "stackitprivatepreview_postgresflexalpha_user" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
name = "username"
|
|
||||||
roles = ["role"]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Only use the import statement, if you want to import an existing postgresflex user
|
|
||||||
import {
|
|
||||||
to = stackitprivatepreview_postgresflexalpha_user.import-example
|
|
||||||
id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.user_id}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `name` (String) The name of the user.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
- `roles` (List of String) A list containing the user roles for the instance.
|
|
||||||
- `user_id` (Number) The ID of the user.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `id` (Number) The ID of the user.
|
|
||||||
- `password` (String) The password for the user.
|
|
||||||
- `status` (String) The current status of the user.
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexalpha_database Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexalpha_database (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `name` (String) The name of the database.
|
|
||||||
- `owner` (String) The owner of the database.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `collation` (String) The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint.
|
|
||||||
- `compatibility` (Number) CompatibilityLevel of the Database.
|
|
||||||
- `database_name` (String) The name of the database.
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `collation_name` (String) The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint.
|
|
||||||
- `compatibility_level` (Number) CompatibilityLevel of the Database.
|
|
||||||
- `id` (Number) The id of the database.
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexalpha_instance Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexalpha_instance (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
resource "stackitprivatepreview_sqlserverflexalpha_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 = {
|
|
||||||
cpu = 4
|
|
||||||
ram = 16
|
|
||||||
}
|
|
||||||
storage = {
|
|
||||||
class = "class"
|
|
||||||
size = 5
|
|
||||||
}
|
|
||||||
version = 2022
|
|
||||||
}
|
|
||||||
|
|
||||||
# Only use the import statement, if you want to import an existing sqlserverflex instance
|
|
||||||
import {
|
|
||||||
to = stackitprivatepreview_sqlserverflexalpha_instance.import-example
|
|
||||||
id = "${var.project_id},${var.region},${var.sql_instance_id}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `backup_schedule` (String) The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
|
|
||||||
- `flavor_id` (String) The id of the instance flavor.
|
|
||||||
- `name` (String) The name of the instance.
|
|
||||||
- `network` (Attributes) the network configuration of the instance. (see [below for nested schema](#nestedatt--network))
|
|
||||||
- `retention_days` (Number) The days for how long the backup files should be stored before cleaned up. 30 to 365
|
|
||||||
- `storage` (Attributes) The object containing information about the storage size and class. (see [below for nested schema](#nestedatt--storage))
|
|
||||||
- `version` (String) The sqlserver version used for the instance.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `encryption` (Attributes) this defines which key to use for storage encryption (see [below for nested schema](#nestedatt--encryption))
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `edition` (String) Edition of the MSSQL server instance
|
|
||||||
- `id` (String) The ID of the instance.
|
|
||||||
- `is_deletable` (Boolean) Whether the instance can be deleted or not.
|
|
||||||
- `replicas` (Number) How many replicas the instance should have.
|
|
||||||
- `status` (String)
|
|
||||||
|
|
||||||
<a id="nestedatt--network"></a>
|
|
||||||
### Nested Schema for `network`
|
|
||||||
|
|
||||||
Required:
|
|
||||||
|
|
||||||
- `acl` (List of String) List of IPV4 cidr.
|
|
||||||
|
|
||||||
Optional:
|
|
||||||
|
|
||||||
- `access_scope` (String) The network access scope of the instance
|
|
||||||
|
|
||||||
⚠️ **Note:** 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.
|
|
||||||
|
|
||||||
Read-Only:
|
|
||||||
|
|
||||||
- `instance_address` (String)
|
|
||||||
- `router_address` (String)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--storage"></a>
|
|
||||||
### Nested Schema for `storage`
|
|
||||||
|
|
||||||
Required:
|
|
||||||
|
|
||||||
- `class` (String) The storage class for the storage.
|
|
||||||
- `size` (Number) The storage size in Gigabytes.
|
|
||||||
|
|
||||||
|
|
||||||
<a id="nestedatt--encryption"></a>
|
|
||||||
### Nested Schema for `encryption`
|
|
||||||
|
|
||||||
Required:
|
|
||||||
|
|
||||||
- `kek_key_id` (String) The key identifier
|
|
||||||
- `kek_key_ring_id` (String) The keyring identifier
|
|
||||||
- `kek_key_version` (String) The key version
|
|
||||||
- `service_account` (String)
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexalpha_user Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexalpha_user (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
resource "stackitprivatepreview_sqlserverflexalpha_user" "example" {
|
|
||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
||||||
username = "username"
|
|
||||||
roles = ["role"]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Only use the import statement, if you want to import an existing sqlserverflex user
|
|
||||||
import {
|
|
||||||
to = stackitprivatepreview_sqlserverflexalpha_user.import-example
|
|
||||||
id = "${var.project_id},${var.region},${var.sql_instance_id},${var.sql_user_id}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `roles` (List of String) A list containing the user roles for the instance. A list with the valid user roles can be retrieved using the List Roles endpoint.
|
|
||||||
- `username` (String) The name of the user.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `default_database` (String) The default database for a user of the instance.
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
- `user_id` (Number) The ID of the user.
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `host` (String) The host of the instance in which the user belongs to.
|
|
||||||
- `id` (Number) The ID of the user.
|
|
||||||
- `password` (String) The password for the user.
|
|
||||||
- `port` (Number) The port of the instance in which the user belongs to.
|
|
||||||
- `status` (String) The current status of the user.
|
|
||||||
- `uri` (String) The connection string for the user to the instance.
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexbeta_database Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexbeta_database (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
### Required
|
|
||||||
|
|
||||||
- `name` (String) The name of the database.
|
|
||||||
- `owner` (String) The owner of the database.
|
|
||||||
|
|
||||||
### Optional
|
|
||||||
|
|
||||||
- `collation` (String) The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint.
|
|
||||||
- `compatibility` (Number) CompatibilityLevel of the Database.
|
|
||||||
- `database_name` (String) The name of the database.
|
|
||||||
- `instance_id` (String) The ID of the instance.
|
|
||||||
- `project_id` (String) The STACKIT project ID.
|
|
||||||
- `region` (String) The region which should be addressed
|
|
||||||
|
|
||||||
### Read-Only
|
|
||||||
|
|
||||||
- `collation_name` (String) The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint.
|
|
||||||
- `compatibility_level` (Number) CompatibilityLevel of the Database.
|
|
||||||
- `id` (Number) The id of the database.
|
|
||||||
|
|
@ -1,158 +0,0 @@
|
||||||
---
|
|
||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
||||||
page_title: "stackitprivatepreview_sqlserverflexbeta_instance Resource - stackitprivatepreview"
|
|
||||||
subcategory: ""
|
|
||||||
description: |-
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# stackitprivatepreview_sqlserverflexbeta_instance (Resource)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example Usage
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
# without encryption and SNA
|
|
||||||
resource "stackitprivatepreview_sqlserverflexbeta_instance" "instance" {
|
|||||||