env

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeletePollInterval = 30 * time.Second
View Source
var DeleteTimeout = 60 * time.Minute
View Source
var MFATimeout = 5 * time.Minute

Functions

func CustomDomainsToModel added in v0.7.0

func CustomDomainsToModel(priorCustomDomains types.List, specCustomDomain *string, specCustomDomains []string) (types.String, types.List, diag.Diagnostics)

CustomDomainsToModel maps the API response back to the two mutually-exclusive model fields for a resource Read. It is driven by prior state (priorCustomDomains): if the user manages domains via the list, refresh the list and keep the deprecated scalar null; otherwise mirror the deprecated scalar and keep the list null. This avoids the API's customDomains[0] echo flipping a list-managed resource into a permanent diff on the deprecated attribute. Data sources expose both fields directly and must not use this helper.

func CustomDomainsToSDK added in v0.7.0

func CustomDomainsToSDK(ctx context.Context, customDomain types.String, customDomains types.List) (*string, []string, diag.Diagnostics)

CustomDomainsToSDK resolves the deprecated custom_domain and the custom_domains list into SDK inputs. They are mutually exclusive at config level (enforced by a ConflictsWith validator), so prefer the list when set and fall back to the deprecated scalar otherwise. Both are unknown-safe (treated as "not set").

func DataSourceCustomDomainsToModel added in v0.7.0

func DataSourceCustomDomainsToModel(specCustomDomain *string, specCustomDomains []string) (types.String, types.List, diag.Diagnostics)

DataSourceCustomDomainsToModel populates both the deprecated custom_domain and the custom_domains list from the API response. Data sources are read-only and have no "user intent" to preserve, so they expose the actual values of both attributes.

func DatadogToSDK added in v0.7.0

func DatadogToSDK(datadog *DatadogModel) *client.DatadogSpecInput

func FormatDeleteError added in v0.6.0

func FormatDeleteError(envName string, err error) string

FormatDeleteError returns a user-friendly error message for delete failures.

func KeyValueToSDK

func KeyValueToSDK(input []KeyValueModel) []*client.KeyValueInput

func ListStringToModel

func ListStringToModel(input []string) []types.String

func ListStringToSDK

func ListStringToSDK(input []basetypes.StringValue) []string

func ListToModel

func ListToModel(input []string) (types.List, diag.Diagnostics)

func MaintenanceWindowsToSDK

func MaintenanceWindowsToSDK(maintenanceWindows []MaintenanceWindowModel) []*client.MaintenanceWindowSpecInput

func ReorderByKey added in v0.6.0

func ReorderByKey[M any, S any](model []M, items []S, getModelKey func(M) string, getItemKey func(S) string) []S

func ReorderList added in v0.4.13

func ReorderList(ctx context.Context, model types.List, input []string) ([]string, diag.Diagnostics)

func ReservationsToModel

func ReservationsToModel(input []client.NodeReservation) (types.Set, diag.Diagnostics)

func SetToModel

func SetToModel(input []string) (types.Set, diag.Diagnostics)

func ValidateDatadog added in v0.7.0

func ValidateDatadog(datadog *DatadogModel) diag.Diagnostics

ValidateDatadog enforces that enc_api_key is provided when the Datadog agent is enabled. Unknown values are skipped: enc_api_key commonly references a secret resource whose value is not known until apply, so it can only be checked once resolved.

func ValidateDisconnected added in v0.6.0

func ValidateDisconnected(envName string, errorCode string, appliedSpecRevision int64, skipDeprovision, allowDeleteDisconnected bool) diag.Diagnostics

ValidateDisconnected checks if the environment is DISCONNECTED and returns differentiated error messages based on whether the env was ever provisioned.

func ValidateForceDestroy added in v0.6.0

func ValidateForceDestroy(envName string, forceDestroy bool) diag.Diagnostics

ValidateForceDestroy checks if the environment is protected from deletion.

func WaitForDeletion added in v0.6.0

func WaitForDeletion(ctx context.Context, resp *resource.DeleteResponse, envName string, pendingMfa bool, checkStatus StatusCheckFunc, deleteTimeout time.Duration, mfaTimeout time.Duration)

Types

type DatadogModel added in v0.7.0

type DatadogModel struct {
	Enabled        types.Bool   `tfsdk:"enabled"`
	EncAPIKey      types.String `tfsdk:"enc_api_key"`
	Domain         types.String `tfsdk:"domain"`
	LogsEnabled    types.Bool   `tfsdk:"logs_enabled"`
	MetricsEnabled types.Bool   `tfsdk:"metrics_enabled"`
}

type EnvResourceBase added in v0.3.0

type EnvResourceBase struct {
	Client *client.Client
	Auth   *auth.Auth
}

func (*EnvResourceBase) Configure added in v0.3.0

func (*EnvResourceBase) ImportState added in v0.3.0

func (*EnvResourceBase) ModifyPlan added in v0.3.0

type KeyValueModel

type KeyValueModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

type MaintenanceWindowModel

type MaintenanceWindowModel struct {
	Name          types.String   `tfsdk:"name"`
	Enabled       types.Bool     `tfsdk:"enabled"`
	Hour          types.Int64    `tfsdk:"hour"`
	LengthInHours types.Int64    `tfsdk:"length_in_hours"`
	Days          []types.String `tfsdk:"days"`
}

type NodeGroupsModel

type NodeGroupsModel struct {
	Name            types.String `tfsdk:"name"`
	NodeType        types.String `tfsdk:"node_type"`
	CapacityPerZone types.Int64  `tfsdk:"capacity_per_zone"`
	Zones           types.List   `tfsdk:"zones"`
	Reservations    types.Set    `tfsdk:"reservations"`
}

type StatusCheckFunc added in v0.6.0

type StatusCheckFunc func(ctx context.Context, name string) (bool, error)

StatusCheckFunc checks if the env is still being deleted. Returns (pendingDelete bool, err error). err should be the raw SDK error (not-found handling is done by the caller).

Jump to

Keyboard shortcuts

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