Documentation
¶
Index ¶
- Variables
- func BoolFromFramework(ctx context.Context, v basetypes.BoolValuable) *bool
- func BoolToFramework(ctx context.Context, v *bool) types.Bool
- func BoolToFrameworkLegacy(_ 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 ExpandFrameworkInt32List(ctx context.Context, v basetypes.ListValuable) []*int32
- func ExpandFrameworkInt32Set(ctx context.Context, v basetypes.SetValuable) []*int32
- func ExpandFrameworkInt32ValueList(ctx context.Context, v basetypes.ListValuable) []int32
- func ExpandFrameworkInt32ValueSet(ctx context.Context, v basetypes.SetValuable) []int32
- func ExpandFrameworkInt64List(ctx context.Context, v basetypes.ListValuable) []*int64
- func ExpandFrameworkInt64Set(ctx context.Context, v basetypes.SetValuable) []*int64
- func ExpandFrameworkInt64ValueList(ctx context.Context, v basetypes.ListValuable) []int64
- func ExpandFrameworkInt64ValueSet(ctx context.Context, v basetypes.SetValuable) []int64
- func ExpandFrameworkStringList(ctx context.Context, v basetypes.ListValuable) []*string
- func ExpandFrameworkStringMap(ctx context.Context, v basetypes.MapValuable) map[string]*string
- func ExpandFrameworkStringSet(ctx context.Context, v basetypes.SetValuable) []*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) itypes.Set[string]
- func ExpandFrameworkStringyValueSet[T ~string](ctx context.Context, v basetypes.SetValuable) itypes.Set[T]
- func Flatten(ctx context.Context, apiObject, tfObject any, optFns ...AutoFlexOptionsFunc) diag.Diagnostics
- func FlattenFrameworkInt32List(ctx context.Context, v []*int32) types.List
- func FlattenFrameworkInt32Set(ctx context.Context, v []*int32) types.Set
- func FlattenFrameworkInt32ValueList[T ~int32](ctx context.Context, v []T) types.List
- func FlattenFrameworkInt32ValueSet[T ~int32](ctx context.Context, v []T) types.Set
- func FlattenFrameworkInt64List(ctx context.Context, v []*int64) types.List
- func FlattenFrameworkInt64Set(ctx context.Context, v []*int64) types.Set
- func FlattenFrameworkInt64ValueList[T ~int64](ctx context.Context, v []T) types.List
- func FlattenFrameworkInt64ValueSet[T ~int64](ctx context.Context, v []T) types.Set
- func FlattenFrameworkStringList(ctx context.Context, v []*string) types.List
- func FlattenFrameworkStringListLegacy(_ context.Context, vs []*string) types.List
- func FlattenFrameworkStringMap(ctx context.Context, v map[string]*string) types.Map
- func FlattenFrameworkStringSet(ctx context.Context, v []*string) types.Set
- 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.ListValueOf[basetypes.StringValue]
- 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 Float32ToFrameworkFloat64(_ context.Context, v *float32) types.Float64
- func Float32ToFrameworkFloat64Legacy(_ context.Context, v *float32) types.Float64
- func Float64ToFramework(ctx context.Context, v *float64) types.Float64
- func Float64ToFrameworkLegacy(_ context.Context, v *float64) types.Float64
- func Int32FromFramework(ctx context.Context, v basetypes.Int32Valuable) *int32
- func Int32FromFrameworkInt64(ctx context.Context, v basetypes.Int64Valuable) *int32
- func Int32FromFrameworkLegacy(_ context.Context, v types.Int32) *int32
- func Int32ToFramework(ctx context.Context, v *int32) types.Int32
- func Int32ToFrameworkInt64(ctx context.Context, v *int32) types.Int64
- func Int32ToFrameworkInt64Legacy(_ 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 Int64ValueFromFramework(ctx context.Context, v basetypes.Int64Valuable) int64
- func RegisterLogger(ctx context.Context) context.Context
- func StringFromFramework(ctx context.Context, v basetypes.StringValuable) *string
- func StringFromFrameworkLegacy(_ context.Context, v types.String) *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 ~string](ctx context.Context, v T) types.String
- func StringValueToFrameworkLegacy[T ~string](_ 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 BoolToFrameworkLegacy ¶
BoolToFrameworkLegacy converts a bool pointer to a Framework Bool value. A nil bool pointer is converted to a false 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 ExpandFrameworkInt32List ¶
func ExpandFrameworkInt32List(ctx context.Context, v basetypes.ListValuable) []*int32
func ExpandFrameworkInt32Set ¶
func ExpandFrameworkInt32Set(ctx context.Context, v basetypes.SetValuable) []*int32
func ExpandFrameworkInt32ValueList ¶
func ExpandFrameworkInt32ValueList(ctx context.Context, v basetypes.ListValuable) []int32
func ExpandFrameworkInt32ValueSet ¶
func ExpandFrameworkInt32ValueSet(ctx context.Context, v basetypes.SetValuable) []int32
func ExpandFrameworkInt64List ¶
func ExpandFrameworkInt64List(ctx context.Context, v basetypes.ListValuable) []*int64
func ExpandFrameworkInt64Set ¶
func ExpandFrameworkInt64Set(ctx context.Context, v basetypes.SetValuable) []*int64
func ExpandFrameworkInt64ValueList ¶
func ExpandFrameworkInt64ValueList(ctx context.Context, v basetypes.ListValuable) []int64
func ExpandFrameworkInt64ValueSet ¶
func ExpandFrameworkInt64ValueSet(ctx context.Context, v basetypes.SetValuable) []int64
func ExpandFrameworkStringList ¶
func ExpandFrameworkStringList(ctx context.Context, v basetypes.ListValuable) []*string
func ExpandFrameworkStringSet ¶
func ExpandFrameworkStringSet(ctx context.Context, v basetypes.SetValuable) []*string
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 FlattenFrameworkInt32List ¶
FlattenFrameworkInt64List converts a slice of int32 pointers to a framework List value.
A nil slice is converted to a null List. An empty slice is converted to a null List.
func FlattenFrameworkInt32Set ¶
FlattenFrameworkInt64Set converts a slice of int32 pointers to a framework Set value.
A nil slice is converted to a null Set. An empty slice is converted to a null Set.
func FlattenFrameworkInt32ValueList ¶
FlattenFrameworkInt64ValueList converts a slice of int32 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 FlattenFrameworkInt32ValueSet ¶
FlattenFrameworkInt64ValueSet converts a slice of int32 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 FlattenFrameworkInt64List ¶
FlattenFrameworkInt64List converts a slice of int64 pointers to a framework List value.
A nil slice is converted to a null List. An empty slice is converted to a null List.
func FlattenFrameworkInt64Set ¶
FlattenFrameworkInt64Set converts a slice of int64 pointers to a framework Set value.
A nil slice is converted to a null Set. An empty slice is converted to a null Set.
func FlattenFrameworkInt64ValueList ¶
FlattenFrameworkInt64ValueList converts a slice of int64 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 FlattenFrameworkInt64ValueSet ¶
FlattenFrameworkInt64ValueSet converts a slice of int64 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 FlattenFrameworkStringList ¶
FlattenFrameworkStringList converts a slice of string pointers to a framework List value.
A nil slice is converted to a null List. An empty slice is converted to a null List.
func FlattenFrameworkStringListLegacy ¶
FlattenFrameworkStringListLegacy is the Plugin Framework variant of FlattenStringList. A nil slice is converted to an empty (non-null) List.
func FlattenFrameworkStringMap ¶
FlattenFrameworkStringMap converts a map of string pointers to a framework Map value.
A nil map is converted to a null Map. An empty map is converted to a null Map.
func FlattenFrameworkStringSet ¶
FlattenFrameworkStringSet converts a slice of string pointers to a framework Set value.
A nil slice is converted to a null Set. An empty slice is converted to a null Set.
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.ListValueOf[basetypes.StringValue]
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 Float32ToFrameworkFloat64 ¶
Float32ToFrameworkFloat64 converts a float32 pointer to a Framework Float64 value. A nil float32 pointer is converted to a null Float64.
func Float32ToFrameworkFloat64Legacy ¶
Float32ToFrameworkFloat64Legacy converts a float32 pointer to a Framework Float64 value. A nil float32 pointer is converted to a zero float64.
func Float64ToFramework ¶
Float64ToFramework converts a float64 pointer to a Framework Float64 value. A nil float64 pointer is converted to a null Float64.
func Float64ToFrameworkLegacy ¶
Float64ToFrameworkLegacy converts a float64 pointer to a Framework Float64 value. A nil float64 pointer is converted to a zero float64.
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 Int32ToFrameworkInt64Legacy ¶
Int32ToFrameworkInt64Legacy converts an int32 pointer to a Framework Int64 value. A nil int32 pointer is converted to a zero Int64.
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 Int64ValueFromFramework ¶
func Int64ValueFromFramework(ctx context.Context, v basetypes.Int64Valuable) 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