utils

package
v1.24.1-0...-4a156ac Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidateSubnetV2IPv6Mode = validation.StringInSlice([]string{
	"slaac", "dhcpv6-stateful", "dhcpv6-stateless",
}, false)

Functions

func BuildCreateParam

func BuildCreateParam(opts interface{}, d *schema.ResourceData, nameMap *map[string]string) ([]string, error)

func BuildUpdateParam

func BuildUpdateParam(opts interface{}, d *schema.ResourceData, nameMap *map[string]string) ([]string, error)

func CompareJsonTemplateAreEquivalent

func CompareJsonTemplateAreEquivalent(tem1, tem2 string) (bool, error)

func ConvertStructToMap

func ConvertStructToMap(obj interface{}, nameMap map[string]string) (map[string]interface{}, error)

ConvertStructToMap converts an instance of struct to a map object, and changes each key of fileds to the value of 'nameMap' if the key in it or to its corresponding lowercase.

func DataResourceIdHash

func DataResourceIdHash(ids []string) string

DataResourceIdHash generates a hash for the set hash function used by the ID

func ExpandResourceTags

func ExpandResourceTags(tagmap map[string]interface{}) []tags.ResourceTag

ExpandResourceTags returns the tags for the given map of data.

func ExpandToStringList

func ExpandToStringList(v []interface{}) []string

ExpandToStringList takes the result for an array of strings and returns a []string

func FlattenStackOutputs

func FlattenStackOutputs(stackOutputs []*stacks.Output) map[string]string

func FlattenStackParameters

func FlattenStackParameters(stackParams map[string]string,
	originalParams map[string]interface{}) map[string]string

FlattenStackParameters is flattening list of stack Parameters and only returning existing parameters to avoid clash with default values

func GetDNSRecordSetTagType

func GetDNSRecordSetTagType(zoneType string) (string, error)

GetDNSRecordSetTagType returns resource tag type of DNS record set by zoneType

func GetDNSZoneTagType

func GetDNSZoneTagType(zoneType string) (string, error)

GetDNSZoneTagType returns resource tag type of DNS zone by zoneType

func IsResourceNotFound

func IsResourceNotFound(err error) bool

func JsonMarshal

func JsonMarshal(t interface{}) ([]byte, error)

func NormalizeJsonString

func NormalizeJsonString(jsonString interface{}) (string, error)

Takes a value containing JSON string and passes it through the JSON parser to normalize it, returns either a parsing error or normalized JSON string.

func NormalizeStackTemplate

func NormalizeStackTemplate(templateString interface{}) (string, error)

func RefreshResourceData

func RefreshResourceData(resource interface{}, d *schema.ResourceData, nameMap *map[string]string) error

func RemoveDuplicateElem

func RemoveDuplicateElem(s []string) []string

RemoveDuplicateElem removes duplicate elements from slice

func RemoveNil

func RemoveNil(data map[string]interface{}) map[string]interface{}

func StrSliceContains

func StrSliceContains(haystack []string, needle string) bool

StrSliceContains checks if a given string is contained in a slice When anybody asks why Go needs generics, here you go.

func SuppressCaseDiffs

func SuppressCaseDiffs(k, old, new string, d *schema.ResourceData) bool

Suppress changes if we get a string with or without cases

func SuppressComputedFixedWhenFloatingIp

func SuppressComputedFixedWhenFloatingIp(k, old, new string, d *schema.ResourceData) bool

Suppress changes if we get a fixed ip when not expecting one, if we have a floating ip (generates fixed ip).

func SuppressDiffAll

func SuppressDiffAll(k, old, new string, d *schema.ResourceData) bool

Suppress all changes

func SuppressEquivalentAwsPolicyDiffs

func SuppressEquivalentAwsPolicyDiffs(k, old, new string, d *schema.ResourceData) bool

func SuppressEquivilentTimeDiffs

func SuppressEquivilentTimeDiffs(k, old, new string, d *schema.ResourceData) bool

func SuppressLBWhitelistDiffs

func SuppressLBWhitelistDiffs(k, old, new string, d *schema.ResourceData) bool

func SuppressMinDisk

func SuppressMinDisk(k, old, new string, d *schema.ResourceData) bool

Suppress changes if we get a computed min_disk_gb if value is unspecified (default 0)

func SuppressNewLineDiffs

func SuppressNewLineDiffs(k, old, new string, d *schema.ResourceData) bool

Suppress changes if we get a string with or without new line

func SuppressSnatFiplistDiffs

func SuppressSnatFiplistDiffs(k, old, new string, d *schema.ResourceData) bool

func TagsToMap

func TagsToMap(tags []tags.ResourceTag) map[string]string

TagsToMap returns the list of tags into a map.

func UpdateResourceTags

func UpdateResourceTags(conn *golangsdk.ServiceClient, d *schema.ResourceData, resourceType, id string) error

UpdateResourceTags is a helper to update the tags for a resource. It expects the tags field to be named "tags"

func ValidateCIDR

func ValidateCIDR(v interface{}, k string) (ws []string, errors []error)

func ValidateECSTagValue

func ValidateECSTagValue(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

func ValidateIP

func ValidateIP(v interface{}, k string) (ws []string, errors []error)

func ValidateIPRange

func ValidateIPRange(v interface{}, k string) (ws []string, errors []error)

func ValidateJsonString

func ValidateJsonString(v interface{}, k string) (ws []string, errors []error)

func ValidateName

func ValidateName(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

func ValidateStackTemplate

func ValidateStackTemplate(v interface{}, k string) (ws []string, errors []error)

func ValidateString64WithChinese

func ValidateString64WithChinese(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

func ValidateTrueOnly

func ValidateTrueOnly(v interface{}, k string) (ws []string, errors []error)

func ValidateVBSBackupDescription

func ValidateVBSBackupDescription(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

func ValidateVBSBackupName

func ValidateVBSBackupName(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

func ValidateVBSPolicyName

func ValidateVBSPolicyName(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

func ValidateVBSTagKey

func ValidateVBSTagKey(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

func ValidateVBSTagValue

func ValidateVBSTagValue(v interface{}, k string) (ws []string, errors []error)

lintignore:V001

Types

This section is empty.

Jump to

Keyboard shortcuts

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