Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CRUD operations for PITR configs #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/yugabyte/terraform-provider-ybm

go 1.22.7

toolchain go1.23.1
toolchain go1.23.4

require (
github.com/golang/mock v1.6.0
Expand Down
2 changes: 2 additions & 0 deletions managed/fflags/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ const (
CONNECTION_POOLING FeatureFlag = "CONNECTION_POOLING"
DR FeatureFlag = "DR"
API_KEYS_ALLOW_LIST FeatureFlag = "API_KEYS_ALLOW_LIST"
PITR FeatureFlag = "PITR"
)

var flagEnabled = map[FeatureFlag]bool{
CONNECTION_POOLING: false,
DR: false,
API_KEYS_ALLOW_LIST: false,
PITR: false,
}

func (f FeatureFlag) String() string {
Expand Down
13 changes: 13 additions & 0 deletions managed/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,16 @@ type DrConfig struct {
TargetClusterId types.String `tfsdk:"target_cluster_id"`
Databases []types.String `tfsdk:"databases"`
}

type PitrConfig struct {
AccountId types.String `tfsdk:"account_id"`
ProjectId types.String `tfsdk:"project_id"`
ClusterId types.String `tfsdk:"cluster_id"`
PitrConfigId types.String `tfsdk:"pitr_config_id"`
NamespaceName types.String `tfsdk:"namespace_name"`
NamespaceType types.String `tfsdk:"namespace_type"`
RetentionPeriodInDays types.Int64 `tfsdk:"retention_period_in_days"`
State types.String `tfsdk:"state"`
EarliestRecoveryTimeMillis types.Int64 `tfsdk:"earliest_recovery_time_millis"`
LatestRecoveryTimeMillis types.Int64 `tfsdk:"latest_recovery_time_millis"`
}
5 changes: 5 additions & 0 deletions managed/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ func (p *provider) GetResources(_ context.Context) (map[string]tfsdk.ResourceTyp
resources["ybm_dr_config"] = resourceDrConfigType{}
}

// Add PITR config resource only if the feature flag is enabled
if fflags.IsFeatureFlagEnabled(fflags.PITR) {
resources["ybm_pitr_config"] = resourcePitrConfigType{}
}

return resources, nil
}

Expand Down
Loading
Loading