feat: add database resource schema for PostgreSQL flex alpha

This commit is contained in:
Andre_Harms 2026-02-04 08:39:49 +01:00
parent eb736225a9
commit 615f88579b

View file

@ -4,7 +4,9 @@ package postgresflexalpha
import ( import (
"context" "context"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types"
@ -31,14 +33,21 @@ func DatabaseDataSourceSchema(ctx context.Context) schema.Schema {
}, },
"name": schema.StringAttribute{ "name": schema.StringAttribute{
Computed: true, Computed: true,
Optional: true,
Description: "The name of the database.", Description: "The name of the database.",
MarkdownDescription: "The name of the database.", MarkdownDescription: "The name of the database.",
}, },
"owner": schema.StringAttribute{ "owner": schema.StringAttribute{
Optional: true,
Computed: true, Computed: true,
Description: "The owner of the database.", Description: "The owner of the database.",
MarkdownDescription: "The owner of the database.", MarkdownDescription: "The owner of the database.",
}, },
"instance_id": schema.StringAttribute{
Required: true,
Description: "The ID of the instance.",
MarkdownDescription: "The ID of the instance.",
},
"project_id": schema.StringAttribute{ "project_id": schema.StringAttribute{
Required: true, Required: true,
Description: "The STACKIT project ID.", Description: "The STACKIT project ID.",
@ -64,6 +73,7 @@ type DatabaseModel struct {
InstanceId types.String `tfsdk:"instance_id"` InstanceId types.String `tfsdk:"instance_id"`
Name types.String `tfsdk:"name"` Name types.String `tfsdk:"name"`
Owner types.String `tfsdk:"owner"` Owner types.String `tfsdk:"owner"`
InstanceId types.String `tfsdk:"instance_id"`
ProjectId types.String `tfsdk:"project_id"` ProjectId types.String `tfsdk:"project_id"`
Region types.String `tfsdk:"region"` Region types.String `tfsdk:"region"`
} }