Documentation
¶
Index ¶
- Constants
- Variables
- func AdaptRegion(ctx context.Context, configRegion types.String, planRegion *types.String, ...)
- func BuildInternalTerraformId(idParts ...string) types.String
- func FormatPossibleValues(values ...string) string
- func GetTimeFromStringAttribute(ctx context.Context, attributePath path.Path, source attributeGetter, ...) (diags diag.Diagnostics)
- func IsLegacyProjectRole(role string) bool
- func IsUndefined(val value) bool
- func ListValuetoStringSlice(list basetypes.ListValue) ([]string, error)
- func LogError(ctx context.Context, inputDiags *diag.Diagnostics, err error, ...)
- func QuoteValues(values []string) []string
- func ReconcileStringSlices(list1, list2 []string) []string
- func SimplifyBackupSchedule(schedule string) string
- func SupportedValuesDocumentation(values []string) string
- func ToTime(ctx context.Context, format string, val types.String, target *time.Time) (diags diag.Diagnostics)
- func UserAgentConfigOption(providerVersion string) config.ConfigurationOption
Constants ¶
const ( SKEServiceId = "cloud.stackit.ske" ModelServingServiceId = "cloud.stackit.model-serving" )
Variables ¶
var (
LegacyProjectRoles = []string{"project.admin", "project.auditor", "project.member", "project.owner"}
)
Functions ¶
func AdaptRegion ¶ added in v0.42.0
func AdaptRegion(ctx context.Context, configRegion types.String, planRegion *types.String, defaultRegion string, resp *resource.ModifyPlanResponse)
AdaptRegion rewrites the region of a terraform plan
func BuildInternalTerraformId ¶ added in v0.56.0
func FormatPossibleValues ¶ added in v0.54.0
FormatPossibleValues formats a slice into a comma-separated-list for usage in the provider docs
func GetTimeFromStringAttribute ¶ added in v0.42.0
func GetTimeFromStringAttribute(ctx context.Context, attributePath path.Path, source attributeGetter, dateFormat string, target *time.Time) (diags diag.Diagnostics)
GetTimeFromStringAttribute retrieves a string attribute from e.g. a [plan.Plan], [tfsdk.Config] or a [tfsdk.State] and converts it to a time.Time object with a given format, if possible.
func IsLegacyProjectRole ¶ added in v0.26.0
func IsUndefined ¶ added in v0.42.0
func IsUndefined(val value) bool
IsUndefined checks if a passed value is unknown or null
func ListValuetoStringSlice ¶
func LogError ¶ added in v0.49.0
func LogError(ctx context.Context, inputDiags *diag.Diagnostics, err error, summary, defaultDescription string, descriptions map[int]string)
LogError logs errors. In descriptions different messages for http status codes can be passed. When no one matches the defaultDescription will be used
func QuoteValues ¶ added in v0.26.0
func ReconcileStringSlices ¶
ReconcileStringSlices reconciles two string lists by removing elements from the first list that are not in the second list and appending elements from the second list that are not in the first list. This preserves the order of the elements in the first list that are also in the second list, which is useful when using ListAttributes in Terraform. The source of truth for the order is the first list and the source of truth for the content is the second list.
func SimplifyBackupSchedule ¶ added in v0.19.0
SimplifyBackupSchedule removes leading 0s from backup schedule numbers (e.g. "00 00 * * *" becomes "0 0 * * *") Needed as the API does it internally and would otherwise cause inconsistent result in Terraform
func SupportedValuesDocumentation ¶ added in v0.24.0
func UserAgentConfigOption ¶ added in v0.54.0
func UserAgentConfigOption(providerVersion string) config.ConfigurationOption
Types ¶
This section is empty.