Documentation
¶
Index ¶
- Constants
- Variables
- func AdaptRegion(ctx context.Context, configRegion types.String, planRegion *types.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 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)
Constants ¶
const (
SKEServiceId = "cloud.stackit.ske"
)
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 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 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
Remove 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
Types ¶
This section is empty.