mdb_postgresql_cluster_beta

package
v0.139.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2025 License: MPL-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessAttrTypes = map[string]attr.Type{
	"data_lens":     types.BoolType,
	"web_sql":       types.BoolType,
	"serverless":    types.BoolType,
	"data_transfer": types.BoolType,
}
View Source
var BackupWindowStartAttrTypes = map[string]attr.Type{
	"hours":   types.Int64Type,
	"minutes": types.Int64Type,
}
View Source
var ConfigAttrTypes = map[string]attr.Type{
	"version":                   types.StringType,
	"resources":                 types.ObjectType{AttrTypes: ResourcesAttrTypes},
	"autofailover":              types.BoolType,
	"access":                    types.ObjectType{AttrTypes: AccessAttrTypes},
	"performance_diagnostics":   types.ObjectType{AttrTypes: PerformanceDiagnosticsAttrTypes},
	"backup_retain_period_days": types.Int64Type,
	"backup_window_start":       types.ObjectType{AttrTypes: BackupWindowStartAttrTypes},
	"postgresql_config":         PgSettingsMapType{MapType: types.MapType{ElemType: types.StringType}},
	"pooler_config":             types.ObjectType{AttrTypes: PoolerConfigAttrTypes},
}
View Source
var MaintenanceWindowAttrTypes = map[string]attr.Type{
	"type": types.StringType,
	"day":  types.StringType,
	"hour": types.Int64Type,
}
View Source
var PerformanceDiagnosticsAttrTypes = map[string]attr.Type{
	"enabled":                      types.BoolType,
	"sessions_sampling_interval":   types.Int64Type,
	"statements_sampling_interval": types.Int64Type,
}
View Source
var PoolerConfigAttrTypes = map[string]attr.Type{
	"pooling_mode": types.StringType,
	"pool_discard": types.BoolType,
}
View Source
var ResourcesAttrTypes = map[string]attr.Type{
	"resource_preset_id": types.StringType,
	"disk_size":          types.Int64Type,
	"disk_type_id":       types.StringType,
}

Functions

func NewAtLeastIfConfiguredValidator added in v0.139.0

func NewAtLeastIfConfiguredValidator(expressions ...path.Expression) *atLeastIfConfiguredValidator

func NewMaintenanceWindowStructValidator

func NewMaintenanceWindowStructValidator() *maintenanceWindowStructValidator

func NewPostgreSQLClusterResourceBeta

func NewPostgreSQLClusterResourceBeta() resource.Resource

func RetryListPGHosts

func RetryListPGHosts(ctx context.Context, sdk *ycsdk.SDK, diag *diag.Diagnostics, cid string) ([]*postgresql.Host, error)

retry with 1, 2, 4, 8, 16, 32, 64, 128 seconds if no succeess while at least one host is unknown and there is no master

Types

type Access

type Access struct {
	DataLens     types.Bool `tfsdk:"data_lens"`
	WebSql       types.Bool `tfsdk:"web_sql"`
	Serverless   types.Bool `tfsdk:"serverless"`
	DataTransfer types.Bool `tfsdk:"data_transfer"`
}

type BackupWindowStart

type BackupWindowStart struct {
	Hours   types.Int64 `tfsdk:"hours"`
	Minutes types.Int64 `tfsdk:"minutes"`
}

type Cluster

type Cluster struct {
	Id                 types.String `tfsdk:"id"`
	FolderId           types.String `tfsdk:"folder_id"`
	NetworkId          types.String `tfsdk:"network_id"`
	Name               types.String `tfsdk:"name"`
	Description        types.String `tfsdk:"description"`
	Environment        types.String `tfsdk:"environment"`
	Labels             types.Map    `tfsdk:"labels"`
	Config             types.Object `tfsdk:"config"`
	HostSpecs          types.Map    `tfsdk:"hosts"`
	MaintenanceWindow  types.Object `tfsdk:"maintenance_window"`
	DeletionProtection types.Bool   `tfsdk:"deletion_protection"`
	SecurityGroupIds   types.Set    `tfsdk:"security_group_ids"`
}

type Config

type Config struct {
	Version                types.String       `tfsdk:"version"`
	Resources              types.Object       `tfsdk:"resources"`
	Autofailover           types.Bool         `tfsdk:"autofailover"`
	Access                 types.Object       `tfsdk:"access"`
	PerformanceDiagnostics types.Object       `tfsdk:"performance_diagnostics"`
	BackupRetainPeriodDays types.Int64        `tfsdk:"backup_retain_period_days"`
	BackupWindowStart      types.Object       `tfsdk:"backup_window_start"`
	PostgtgreSQLConfig     PgSettingsMapValue `tfsdk:"postgresql_config"`
	PoolerConfig           types.Object       `tfsdk:"pooler_config"`
}

type Host

type Host struct {
	Zone              types.String `tfsdk:"zone"`
	SubnetId          types.String `tfsdk:"subnet_id"`
	AssignPublicIp    types.Bool   `tfsdk:"assign_public_ip"`
	FQDN              types.String `tfsdk:"fqdn"`
	ReplicationSource types.String `tfsdk:"replication_source"`
}

type MaintenanceWindow

type MaintenanceWindow struct {
	Type types.String `tfsdk:"type"`
	Day  types.String `tfsdk:"day"`
	Hour types.Int64  `tfsdk:"hour"`
}

type PerformanceDiagnostics

type PerformanceDiagnostics struct {
	Enabled                    types.Bool  `tfsdk:"enabled"`
	SessionsSamplingInterval   types.Int64 `tfsdk:"sessions_sampling_interval"`
	StatementsSamplingInterval types.Int64 `tfsdk:"statements_sampling_interval"`
}

type PgSettingsMapType added in v0.139.0

type PgSettingsMapType struct {
	basetypes.MapType
}

PgSettingsMapType type is based on the example in the terraform plugin framerwork documentation https://developer.hashicorp.com/terraform/plugin/framework/handling-data/types/custom

Type is add-on to the string map for the mapping to primitive fields (Numbers, Bool, String) Used to configure Postgresql settings.

func (PgSettingsMapType) Equal added in v0.139.0

func (t PgSettingsMapType) Equal(o attr.Type) bool

Equal compare PgSettingsMapType with provided type

func (PgSettingsMapType) String added in v0.139.0

func (t PgSettingsMapType) String() string

func (PgSettingsMapType) ValueFromMap added in v0.139.0

ValueFromMap used to get PgSettingsMapType from a map value

func (PgSettingsMapType) ValueFromTerraform added in v0.139.0

func (t PgSettingsMapType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

ValueFromTerraform is a basic implementation of getting PgSettingsMapType value from terraform value

From example: https://developer.hashicorp.com/terraform/plugin/framework/handling-data/types/custom

func (PgSettingsMapType) ValueType added in v0.139.0

func (t PgSettingsMapType) ValueType(ctx context.Context) attr.Value

type PgSettingsMapValue added in v0.139.0

type PgSettingsMapValue struct {
	basetypes.MapValue
}

func NewPgSettingsMapNull added in v0.139.0

func NewPgSettingsMapNull() PgSettingsMapValue

func NewPgSettingsMapUnknown added in v0.139.0

func NewPgSettingsMapUnknown() PgSettingsMapValue

func NewPgSettingsMapValue added in v0.139.0

func NewPgSettingsMapValue(elements map[string]attr.Value) (PgSettingsMapValue, diag.Diagnostics)

NewPgSettingsMapValue creates PgSettingsMapValue from map[string]attr.Value, where attr.Value is a primitive value

func NewPgSettingsMapValueMust added in v0.139.0

func NewPgSettingsMapValueMust(elements map[string]attr.Value) PgSettingsMapValue

func (PgSettingsMapValue) Equal added in v0.139.0

func (v PgSettingsMapValue) Equal(o attr.Value) bool

Compare map values and elements values inside

func (PgSettingsMapValue) PrimitiveElements added in v0.139.0

func (v PgSettingsMapValue) PrimitiveElements(ctx context.Context, diags *diag.Diagnostics) map[string]attr.Value

PrimitiveElements is necessary to get primitive values map from a PgSettingsMapValue

func (PgSettingsMapValue) Type added in v0.139.0

type PoolerConfig added in v0.139.0

type PoolerConfig struct {
	PoolDiscard types.Bool   `tfsdk:"pool_discard"`
	PoolingMode types.String `tfsdk:"pooling_mode"`
}

type Resources

type Resources struct {
	ResourcePresetID types.String `tfsdk:"resource_preset_id"`
	DiskSize         types.Int64  `tfsdk:"disk_size"`
	DiskTypeID       types.String `tfsdk:"disk_type_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL