Skip to content

Commit

Permalink
feat: added from_deleted attribute to schema for cluster restore func…
Browse files Browse the repository at this point in the history
…tionality (#401)
  • Loading branch information
wai-wong-edb authored Nov 29, 2023
1 parent 7f9a62b commit b045931
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/provider/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type ClusterResourceModel struct {
ServiceAccountIds types.Set `tfsdk:"service_account_ids"`
PeAllowedPrincipalIds types.Set `tfsdk:"pe_allowed_principal_ids"`
SuperuserAccess types.Bool `tfsdk:"superuser_access"`
FromDeleted *bool `tfsdk:"from_deleted"`
Pgvector types.Bool `tfsdk:"pgvector"`

Timeouts timeouts.Value `tfsdk:"timeouts"`
Expand Down Expand Up @@ -392,6 +393,10 @@ func (c *clusterResource) Schema(ctx context.Context, req resource.SchemaRequest
Optional: true,
Computed: true,
},
"from_deleted": schema.BoolAttribute{
Description: "For restoring a cluster. Specifies if the cluster you want to restore is deleted",
Optional: true,
},
"pgvector": schema.BoolAttribute{
MarkdownDescription: "Is pgvector extension enabled. Adds support for vector storage and vector similarity search to Postgres.",
Optional: true,
Expand Down
5 changes: 5 additions & 0 deletions pkg/provider/resource_pgd.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func PgdSchema(ctx context.Context) schema.Schema {
Description: "Show the most recent cluster when there are multiple clusters with the same name",
Optional: true,
},
"from_deleted": schema.BoolAttribute{
Description: "For restoring a cluster. Specifies if the cluster you want to restore is deleted",
Optional: true,
},
"password": schema.StringAttribute{
Description: "Password for the user edb_admin. It must be 12 characters or more.",
Required: true,
Expand Down Expand Up @@ -606,6 +610,7 @@ type PGD struct {
ClusterId *string `tfsdk:"cluster_id"`
ClusterName *string `tfsdk:"cluster_name"`
MostRecent *bool `tfsdk:"most_recent"`
FromDeleted *bool `tfsdk:"from_deleted"`
Password *string `tfsdk:"password"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
DataGroups []terraform.DataGroup `tfsdk:"data_groups"`
Expand Down

0 comments on commit b045931

Please sign in to comment.