Documentation
¶
Index ¶
- Variables
- func BoolFromFramework(ctx context.Context, v basetypes.BoolValuable) *bool
- func BoolToFramework(ctx context.Context, v *bool) types.Bool
- func BoolValueFromFramework(ctx context.Context, v basetypes.BoolValuable) bool
- func BoolValueToFramework(ctx context.Context, v bool) types.Bool
- func DiagFlatteningIncompatibleTypes(sourceType, targetType reflect.Type) diag.ErrorDiagnostic
- func EmptyStringAsNull(v types.String) types.String
- func Expand(ctx context.Context, tfObject, apiObject any, optFns ...AutoFlexOptionsFunc) diag.Diagnostics
- func ExpandFrameworkStringMap(ctx context.Context, v basetypes.MapValuable) map[string]*string
- func ExpandFrameworkStringValueList(ctx context.Context, v basetypes.ListValuable) []string
- func ExpandFrameworkStringValueMap(ctx context.Context, v basetypes.MapValuable) map[string]string
- func ExpandFrameworkStringValueSet(ctx context.Context, v basetypes.SetValuable) inttypes.Set[string]
- func ExpandFrameworkStringyValueSet[E ~string](ctx context.Context, v basetypes.SetValuable) inttypes.Set[E]
- func Flatten(ctx context.Context, apiObject, tfObject any, optFns ...AutoFlexOptionsFunc) diag.Diagnostics
- func FlattenFrameworkStringValueList[T ~string](ctx context.Context, v []T) types.List
- func FlattenFrameworkStringValueListLegacy[T ~string](_ context.Context, vs []T) types.List
- func FlattenFrameworkStringValueListOfString(ctx context.Context, vs []string) fwtypes.ListOfString
- func FlattenFrameworkStringValueListOfStringLegacy(ctx context.Context, vs []string) fwtypes.ListOfString
- func FlattenFrameworkStringValueMap(ctx context.Context, v map[string]string) types.Map
- func FlattenFrameworkStringValueMapLegacy(_ context.Context, m map[string]string) types.Map
- func FlattenFrameworkStringValueSet[T ~string](ctx context.Context, v []T) types.Set
- func FlattenFrameworkStringValueSetLegacy[T ~string](_ context.Context, vs []T) types.Set
- func FlattenFrameworkStringValueSetOfString(ctx context.Context, vs []string) fwtypes.SetOfString
- func FlattenFrameworkStringValueSetOfStringLegacy(ctx context.Context, vs []string) fwtypes.SetOfString
- func FlattenFrameworkStringyValueSetOfStringEnum[T enum.Valueser[T]](ctx context.Context, vs []T) fwtypes.SetOfStringEnum[T]
- func Float64FromFramework(ctx context.Context, v basetypes.Float64Valuable) *float64
- func Int32FromFramework(ctx context.Context, v basetypes.Int32Valuable) *int32
- func Int32FromFrameworkInt64(ctx context.Context, v basetypes.Int64Valuable) *int32
- func Int32ToFramework(ctx context.Context, v *int32) types.Int32
- func Int32ToFrameworkInt64(ctx context.Context, v *int32) types.Int64
- func Int32ValueFromFrameworkInt64(ctx context.Context, v basetypes.Int64Valuable) int32
- func Int32ValueToFrameworkInt64(ctx context.Context, v int32) types.Int64
- func Int64FromFramework(ctx context.Context, v basetypes.Int64Valuable) *int64
- func Int64FromFrameworkLegacy(_ context.Context, v types.Int64) *int64
- func Int64ToFramework(ctx context.Context, v *int64) types.Int64
- func Int64ToFrameworkLegacy(_ context.Context, v *int64) types.Int64
- func Int64ValueToFramework(ctx context.Context, v int64) types.Int64
- func RegisterLogger(ctx context.Context) context.Context
- func StringFromFramework(ctx context.Context, v basetypes.StringValuable) *string
- func StringSliceValueFromFramework(ctx context.Context, v basetypes.StringValuable) []string
- func StringToFramework(ctx context.Context, v *string) types.String
- func StringToFrameworkARN(ctx context.Context, v *string) fwtypes.ARN
- func StringToFrameworkLegacy(_ context.Context, v *string) types.String
- func StringToFrameworkValuable[T basetypes.StringValuable](ctx context.Context, v *string) T
- func StringValueFromFramework(ctx context.Context, v basetypes.StringValuable) string
- func StringValueToFramework[T tfslices.Stringable](ctx context.Context, v T) types.String
- func StringValueToFrameworkLegacy[T tfslices.Stringable](_ context.Context, v T) types.String
- func TimeFromFramework(ctx context.Context, v timetypes.RFC3339) *time.Time
- func TimeToFramework(ctx context.Context, v *time.Time) timetypes.RFC3339
- func ZeroInt32AsNull(v types.Int32) types.Int32
- type AutoFlexOptions
- type AutoFlexOptionsFunc
- type ChangeOption
- type ChangeOptions
- type Expander
- type Flattener
- type Results
- type TypedExpander
Constants ¶
This section is empty.
Variables ¶
var (
DefaultIgnoredFieldNames = []string{
"Tags",
}
)
Functions ¶
func BoolFromFramework ¶
func BoolFromFramework(ctx context.Context, v basetypes.BoolValuable) *bool
BoolFromFramework converts a Framework Bool value to a bool pointer. A null Bool is converted to a nil bool pointer.
func BoolToFramework ¶
BoolToFramework converts a bool pointer to a Framework Bool value. A nil bool pointer is converted to a null Bool.
func BoolValueFromFramework ¶
func BoolValueFromFramework(ctx context.Context, v basetypes.BoolValuable) bool
func BoolValueToFramework ¶
BoolValueToFramework converts a bool value to a Framework Bool value.
func DiagFlatteningIncompatibleTypes ¶
func DiagFlatteningIncompatibleTypes(sourceType, targetType reflect.Type) diag.ErrorDiagnostic
func Expand ¶
func Expand(ctx context.Context, tfObject, apiObject any, optFns ...AutoFlexOptionsFunc) diag.Diagnostics
Expand "expands" a resource's "business logic" data structure, implemented using Terraform Plugin Framework data types, into an AWS SDK for Go v2 API data structure. The resource's data structure is walked and exported fields that have a corresponding field in the API data structure (and a suitable target data type) are copied.
func ExpandFrameworkStringValueList ¶
func ExpandFrameworkStringValueList(ctx context.Context, v basetypes.ListValuable) []string
func Flatten ¶
func Flatten(ctx context.Context, apiObject, tfObject any, optFns ...AutoFlexOptionsFunc) diag.Diagnostics
Flatten "flattens" an AWS SDK for Go v2 API data structure into a resource's "business logic" data structure, implemented using Terraform Plugin Framework data types. The API data structure's fields are walked and exported fields that have a corresponding field in the resource's data structure (and a suitable target data type) are copied.
func FlattenFrameworkStringValueList ¶
FlattenFrameworkStringValueList converts a slice of string values to a framework List value.
A nil slice is converted to a null List. An empty slice is converted to a null List.
func FlattenFrameworkStringValueListLegacy ¶
FlattenFrameworkStringValueListLegacy is the Plugin Framework variant of FlattenStringValueList. A nil slice is converted to an empty (non-null) List.
func FlattenFrameworkStringValueListOfString ¶
func FlattenFrameworkStringValueListOfString(ctx context.Context, vs []string) fwtypes.ListOfString
func FlattenFrameworkStringValueListOfStringLegacy ¶
func FlattenFrameworkStringValueListOfStringLegacy(ctx context.Context, vs []string) fwtypes.ListOfString
func FlattenFrameworkStringValueMap ¶
FlattenFrameworkStringValueMap converts a map of strings to a framework Map value.
A nil map is converted to a null Map. An empty map is converted to a null Map.
func FlattenFrameworkStringValueMapLegacy ¶
FlattenFrameworkStringValueMapLegacy has no Plugin SDK equivalent as schema.ResourceData.Set can be passed string value maps directly. A nil map is converted to an empty (non-null) Map.
func FlattenFrameworkStringValueSet ¶
FlattenFrameworkStringValueSet converts a slice of string values to a framework Set value.
A nil slice is converted to a null Set. An empty slice is converted to a null Set.
func FlattenFrameworkStringValueSetLegacy ¶
FlattenFrameworkStringValueSetLegacy is the Plugin Framework variant of FlattenStringValueSet. A nil slice is converted to an empty (non-null) Set.
func FlattenFrameworkStringValueSetOfString ¶
func FlattenFrameworkStringValueSetOfString(ctx context.Context, vs []string) fwtypes.SetOfString
func FlattenFrameworkStringValueSetOfStringLegacy ¶
func FlattenFrameworkStringValueSetOfStringLegacy(ctx context.Context, vs []string) fwtypes.SetOfString
func Float64FromFramework ¶
func Float64FromFramework(ctx context.Context, v basetypes.Float64Valuable) *float64
Float64FromFramework converts a Framework Int64 value to an int64 pointer. A null Int64 is converted to a nil int64 pointer.
func Int32FromFramework ¶
func Int32FromFramework(ctx context.Context, v basetypes.Int32Valuable) *int32
Int32FromFramework coverts a Framework Int32 value to an int32 pointer. A null Int32 is converted to a nil int32 pointer.
func Int32FromFrameworkInt64 ¶
func Int32FromFrameworkInt64(ctx context.Context, v basetypes.Int64Valuable) *int32
Int32FromFrameworkInt64 coverts a Framework Int64 value to an int32 pointer. A null Int64 is converted to a nil int32 pointer.
func Int32ToFramework ¶
Int32ToFramework converts an int32 pointer to a Framework Int32 value. A nil int32 pointer is converted to a null Int32.
func Int32ValueFromFrameworkInt64 ¶
func Int32ValueFromFrameworkInt64(ctx context.Context, v basetypes.Int64Valuable) int32
Int32ValueFromFrameworkInt64 coverts a Framework Int64 value to an int32 value. A null Int64 is converted to a nil int32 pointer.
func Int64FromFramework ¶
func Int64FromFramework(ctx context.Context, v basetypes.Int64Valuable) *int64
Int64FromFramework converts a Framework Int64 value to an int64 pointer. A null Int64 is converted to a nil int64 pointer.
func Int64ToFramework ¶
Int64ToFramework converts an int64 pointer to a Framework Int64 value. A nil int64 pointer is converted to a null Int64.
func Int64ToFrameworkLegacy ¶
Int64ToFrameworkLegacy converts an int64 pointer to a Framework Int64 value. A nil int64 pointer is converted to a zero Int64.
func StringFromFramework ¶
func StringFromFramework(ctx context.Context, v basetypes.StringValuable) *string
StringFromFramework converts a Framework String value to a string pointer. A null String is converted to a nil string pointer.
func StringSliceValueFromFramework ¶
func StringSliceValueFromFramework(ctx context.Context, v basetypes.StringValuable) []string
StringSliceValueFromFramework converts a single Framework String value to a string slice. A null String is converted to a nil slice.
func StringToFramework ¶
StringToFramework converts a string pointer to a Framework String value. A nil string pointer is converted to a null String.
func StringToFrameworkARN ¶
StringToFrameworkARN converts a string pointer to a Framework custom ARN value. A nil string pointer is converted to a null ARN.
func StringToFrameworkLegacy ¶
StringToFrameworkLegacy converts a string pointer to a Framework String value. A nil string pointer is converted to an empty String.
func StringToFrameworkValuable ¶
func StringToFrameworkValuable[T basetypes.StringValuable](ctx context.Context, v *string) T
StringToFrameworkValuable converts a string pointer to a Framework StringValuable value. A nil string pointer is converted to a null StringValuable.
func StringValueFromFramework ¶
func StringValueFromFramework(ctx context.Context, v basetypes.StringValuable) string
StringValueFromFramework converts a Framework String value to a string. A null String is converted to an empty string.
func StringValueToFramework ¶
StringValueToFramework converts a string value to a Framework String value. An empty string is converted to a null String.
func StringValueToFrameworkLegacy ¶
StringValueToFrameworkLegacy converts a string value to a Framework String value. An empty string is left as an empty String.
func TimeFromFramework ¶
TimeFromFramework converts a Framework RFC3339 value to a time pointer. A null or unknonwn RFC3339 is converted to a nil time pointer.
func TimeToFramework ¶
TimeFromFramework converts a Framework RFC3339 value to a time pointer.
Types ¶
type AutoFlexOptions ¶
type AutoFlexOptions struct {
// contains filtered or unexported fields
}
AutoFlexOptions stores configurable options for an auto-flattener or expander.
type AutoFlexOptionsFunc ¶
type AutoFlexOptionsFunc func(*AutoFlexOptions)
AutoFlexOptionsFunc is a type alias for an autoFlexer functional option.
func WithFieldNamePrefix ¶
func WithFieldNamePrefix(s string) AutoFlexOptionsFunc
WithFieldNamePrefix specifies a prefix to be accounted for when matching field names between Terraform and AWS data structures
Use this option to improve fuzzy matching of field names during AutoFlex expand/flatten operations.
func WithFieldNameSuffix ¶
func WithFieldNameSuffix(s string) AutoFlexOptionsFunc
WithFieldNameSuffix specifies a suffix to be accounted for when matching field names between Terraform and AWS data structures
Use this option to improve fuzzy matching of field names during AutoFlex expand/flatten operations.
func WithIgnoredFieldNames ¶
func WithIgnoredFieldNames(fields []string) AutoFlexOptionsFunc
WithIgnoredFieldNames sets the list of ignored field names
Use this option to fully overwrite the ignored fields list. To preseve preexisting items, use WithIgnoredFieldNamesAppend instead.
func WithIgnoredFieldNamesAppend ¶
func WithIgnoredFieldNamesAppend(s string) AutoFlexOptionsFunc
WithIgnoredFieldNamesAppend appends to the list of ignored field names
Use this option to preserve preexisting items in the ignored fields list.
func WithNoIgnoredFieldNames ¶
func WithNoIgnoredFieldNames() AutoFlexOptionsFunc
WithNoIgnoredFieldNames empties the list of ignored field names
type ChangeOption ¶
type ChangeOption func(*ChangeOptions)
ChangeOption is a type alias for a functional option that modifies ChangeOptions
func WithIgnoredField ¶
func WithIgnoredField(fieldName string) ChangeOption
WithIgnoredField specifies a field name to be ignored when calculating plan changes
type ChangeOptions ¶
type ChangeOptions struct {
IgnoredFields []string
}
ChangeOptions holds configuration for calculating plan changes
func NewChangeOptions ¶
func NewChangeOptions(options ...ChangeOption) *ChangeOptions
NewChangeOptions initializes ChangeOptions with the provided options
type Expander ¶
type Expander interface {
Expand(ctx context.Context) (any, diag.Diagnostics)
}
Expander is implemented by types that customize their expansion
type Flattener ¶
type Flattener interface {
Flatten(ctx context.Context, v any) diag.Diagnostics
}
Flattener is implemented by types that customize their flattening
type Results ¶
type Results struct {
// contains filtered or unexported fields
}
func Diff ¶
func Diff(ctx context.Context, plan, state any, options ...ChangeOption) (*Results, diag.Diagnostics)
Diff compares the plan and state values and returns whether there are changes
func (*Results) HasChanges ¶
HasChanges returns whether there are changes between the plan and state values
func (*Results) IgnoredFieldNames ¶
IgnoredFieldNames returns the list of ignored field names
func (*Results) IgnoredFieldNamesOpts ¶
func (r *Results) IgnoredFieldNamesOpts() []AutoFlexOptionsFunc
IgnoredFieldNamesOpts returns the list of ignored field names as AutoFlexOptionsFunc
type TypedExpander ¶
type TypedExpander interface {
ExpandTo(ctx context.Context, targetType reflect.Type) (any, diag.Diagnostics)
}
Expander is implemented by types that customize their expansion and can have multiple target types