core

package
v0.0.23-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Resource          ResourceType = "resource"
	Datasource        ResourceType = "datasource"
	EphemeralResource ResourceType = "ephemeral-resource"

	// Separator used for concatenation of TF-internal resource ID
	Separator = ","

	ResourceRegionFallbackDocstring   = "" /* 129-byte string literal not displayed */
	DatasourceRegionFallbackDocstring = "" /* 131-byte string literal not displayed */
)

Variables

View Source
var (
	// ErrRequestFailedAfterRetries is returned when a request fails after all retry attempts.
	ErrRequestFailedAfterRetries = errors.New("request failed after all retry attempts")
)

Functions

func DiagsToError

func DiagsToError(diags diag.Diagnostics) error

DiagsToError Converts TF diagnostics' errors into an error with a human-readable description. If there are no errors, the output is nil

func InitProviderContext

func InitProviderContext(ctx context.Context) context.Context

InitProviderContext extends the context to capture the http response

func LogAndAddError

func LogAndAddError(ctx context.Context, diags *diag.Diagnostics, summary, detail string)

LogAndAddError Logs the error and adds it to the diags

func LogAndAddErrorBeta

func LogAndAddErrorBeta(ctx context.Context, diags *diag.Diagnostics, name string, resourceType ResourceType)

func LogAndAddWarning

func LogAndAddWarning(ctx context.Context, diags *diag.Diagnostics, summary, detail string)

LogAndAddWarning Logs the warning and adds it to the diags

func LogAndAddWarningBeta

func LogAndAddWarningBeta(ctx context.Context, diags *diag.Diagnostics, name string, resourceType ResourceType)

func LogResponse

func LogResponse(ctx context.Context) context.Context

LogResponse logs the trace-id of the last request

Types

type EphemeralProviderData

type EphemeralProviderData struct {
	ProviderData

	PrivateKey            string
	PrivateKeyPath        string
	ServiceAccountKey     string
	ServiceAccountKeyPath string
	TokenCustomEndpoint   string
}

type ProviderData

type ProviderData struct {
	RoundTripper        http.RoundTripper
	ServiceAccountEmail string // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
	// Deprecated: Use DefaultRegion instead
	Region                          string
	DefaultRegion                   string
	AuthorizationCustomEndpoint     string
	CdnCustomEndpoint               string
	DnsCustomEndpoint               string
	GitCustomEndpoint               string
	IaaSCustomEndpoint              string
	KMSCustomEndpoint               string
	LoadBalancerCustomEndpoint      string
	LogMeCustomEndpoint             string
	MariaDBCustomEndpoint           string
	MongoDBFlexCustomEndpoint       string
	ModelServingCustomEndpoint      string
	ObjectStorageCustomEndpoint     string
	ObservabilityCustomEndpoint     string
	OpenSearchCustomEndpoint        string
	PostgresFlexCustomEndpoint      string
	RabbitMQCustomEndpoint          string
	RedisCustomEndpoint             string
	ResourceManagerCustomEndpoint   string
	ScfCustomEndpoint               string
	SecretsManagerCustomEndpoint    string
	SQLServerFlexCustomEndpoint     string
	ServerBackupCustomEndpoint      string
	ServerUpdateCustomEndpoint      string
	SKECustomEndpoint               string
	ServiceEnablementCustomEndpoint string
	ServiceAccountCustomEndpoint    string
	EnableBetaResources             bool
	Experiments                     []string

	Version string // version of the STACKIT Terraform provider
}

func (*ProviderData) GetRegion

func (pd *ProviderData) GetRegion() string

GetRegion returns the effective region for the provider, falling back to the deprecated _region_ attribute

func (*ProviderData) GetRegionWithOverride

func (pd *ProviderData) GetRegionWithOverride(overrideRegion types.String) string

type ResourceType

type ResourceType string

type RetryRoundTripper

type RetryRoundTripper struct {
	// contains filtered or unexported fields
}

RetryRoundTripper implements an http.RoundTripper that adds automatic retry logic for failed requests.

func NewRetryRoundTripper

func NewRetryRoundTripper(
	next http.RoundTripper,
	maxRetries int,
	initialDelay, maxDelay, perTryTimeout time.Duration,
) *RetryRoundTripper

NewRetryRoundTripper creates a new instance of the RetryRoundTripper with the specified configuration.

func (*RetryRoundTripper) RoundTrip

func (rrt *RetryRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes the request and retries on failure.

Jump to

Keyboard shortcuts

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