Documentation
¶
Index ¶
- Variables
- func CustomDomainsToModel(priorCustomDomains types.List, specCustomDomain *string, ...) (types.String, types.List, diag.Diagnostics)
- func CustomDomainsToSDK(ctx context.Context, customDomain types.String, customDomains types.List) (*string, []string, diag.Diagnostics)
- func DataSourceCustomDomainsToModel(specCustomDomain *string, specCustomDomains []string) (types.String, types.List, diag.Diagnostics)
- func DatadogToSDK(datadog *DatadogModel) *client.DatadogSpecInput
- func FormatDeleteError(envName string, err error) string
- func KeyValueToSDK(input []KeyValueModel) []*client.KeyValueInput
- func ListStringToModel(input []string) []types.String
- func ListStringToSDK(input []basetypes.StringValue) []string
- func ListToModel(input []string) (types.List, diag.Diagnostics)
- func MaintenanceWindowsToSDK(maintenanceWindows []MaintenanceWindowModel) []*client.MaintenanceWindowSpecInput
- func ReorderByKey[M any, S any](model []M, items []S, getModelKey func(M) string, getItemKey func(S) string) []S
- func ReorderList(ctx context.Context, model types.List, input []string) ([]string, diag.Diagnostics)
- func ReorderNodeGroupZones[M any, S any](ctx context.Context, model []M, items []S, getModelKey func(M) string, ...) diag.Diagnostics
- func ReservationsToModel(input []client.NodeReservation) (types.Set, diag.Diagnostics)
- func SetToModel(input []string) (types.Set, diag.Diagnostics)
- func ValidateDatadog(datadog *DatadogModel) diag.Diagnostics
- func ValidateDisconnected(envName string, errorCode string, appliedSpecRevision int64, ...) diag.Diagnostics
- func ValidateForceDestroy(envName string, forceDestroy bool) diag.Diagnostics
- func WaitForDeletion(ctx context.Context, resp *resource.DeleteResponse, envName string, ...)
- type DatadogModel
- type EnvResourceBase
- type KeyValueModel
- type MaintenanceWindowModel
- type NodeGroupsModel
- type StatusCheckFunc
Constants ¶
This section is empty.
Variables ¶
var DeletePollInterval = 30 * time.Second
var DeleteTimeout = 60 * time.Minute
var ErrEnvNotFound = errors.New("environment not found")
ErrEnvNotFound reports an env that is already gone. A status query can succeed and still return a null env, which carries no SDK error for IsNotFoundError to recognize; returning (false, nil) instead would strand a pendingMFA delete in PENDING_MFA until the MFA timeout, so callers return this to mean "deleted".
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)
Refreshes whichever field prior state manages and keeps the other null, so the API's customDomains[0] echo can't flip a list-managed resource into a permanent diff on the deprecated scalar. Resources only; data sources expose both fields.
func CustomDomainsToSDK ¶ added in v0.7.0
func CustomDomainsToSDK(ctx context.Context, customDomain types.String, customDomains types.List) (*string, []string, diag.Diagnostics)
Prefers custom_domains over the deprecated custom_domain (mutually exclusive via validator); unknown-safe.
func DataSourceCustomDomainsToModel ¶ added in v0.7.0
func DataSourceCustomDomainsToModel(specCustomDomain *string, specCustomDomains []string) (types.String, types.List, diag.Diagnostics)
Data sources are read-only with no user intent to preserve, so expose both attributes as returned.
func DatadogToSDK ¶ added in v0.7.0
func DatadogToSDK(datadog *DatadogModel) *client.DatadogSpecInput
func FormatDeleteError ¶ added in v0.6.0
FormatDeleteError returns a user-friendly error message for delete failures.
func KeyValueToSDK ¶
func KeyValueToSDK(input []KeyValueModel) []*client.KeyValueInput
func ListStringToModel ¶
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
ReorderByKey returns items in model (config) order, pairing by key; unmatched items go last, duplicate keys pair positionally, nil stays nil (null in state).
func ReorderList ¶ added in v0.4.13
func ReorderNodeGroupZones ¶ added in v0.7.3
func ReorderNodeGroupZones[M any, S any]( ctx context.Context, model []M, items []S, getModelKey func(M) string, getItemKey func(S) string, modelList func(M) types.List, itemList func(S) *[]string, ) diag.Diagnostics
Pairing mirrors ReorderByKey so both resolve the same model/item pairs; mutates items via itemList.
func ReservationsToModel ¶
func ReservationsToModel(input []client.NodeReservation) (types.Set, diag.Diagnostics)
Always non-null; safe only while reservations attrs are Required or defaulted.
func SetToModel ¶
func SetToModel(input []string) (types.Set, diag.Diagnostics)
SetToModel/ListToModel always return non-null; unsafe for plain Optional attrs where null must stay null.
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
Types ¶
type DatadogModel ¶ added in v0.7.0
type EnvResourceBase ¶ added in v0.3.0
func (*EnvResourceBase) Configure ¶ added in v0.3.0
func (r *EnvResourceBase) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*EnvResourceBase) ImportState ¶ added in v0.3.0
func (r *EnvResourceBase) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (*EnvResourceBase) ModifyPlan ¶ added in v0.3.0
func (r *EnvResourceBase) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
type KeyValueModel ¶
type MaintenanceWindowModel ¶
type NodeGroupsModel ¶
type StatusCheckFunc ¶ added in v0.6.0
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), or ErrEnvNotFound when the query succeeded but returned no environment.