tfhelper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffFuncSuppressSecretChanged

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

DiffFuncSuppressSecretChanged is used to suppress unneeded `apply` updates to a resource.

It returns `true` when `new` appears to be the same value as a previously stored and bcrypt'd value stored in state during a previous `apply`. Relies on flatten/expand logic to help store that hash. See FlattenSecret, below.*/

func ExpandStringList

func ExpandStringList(d []interface{}) []string

ExpandStringList expand an array of interface into array of string

func ExpandStringSet

func ExpandStringSet(d *schema.Set) []string

ExpandStringSet expand a set into array of string

func FindMapInSetWithGivenKeyValue

func FindMapInSetWithGivenKeyValue(d *schema.ResourceData, setName string, keyName string, keyValue interface{}) map[string]interface{}

FindMapInSetWithGivenKeyValue Pulls an element of `TypeSet` from the state. The values of this set are assumed to be `TypeMap`. The maps in the set are searched until a map is found with a value for `keyName` equal to `keyValue`.

If no such map is found, `nil` is returned

func GenerateSecreteMemoSchema

func GenerateSecreteMemoSchema(secretKey string) (string, *schema.Schema)

GenerateSecreteMemoSchema is used to create Schema defs to house the hashed secret in `tfstate`

func HelpFlattenSecret

func HelpFlattenSecret(d *schema.ResourceData, secretKey string)

HelpFlattenSecret is used to store a hashed secret value into `tfstate`

func HelpFlattenSecretNested

func HelpFlattenSecretNested(d *schema.ResourceData, parentKey string, d2 map[string]interface{}, secretKey string) (string, string)

HelpFlattenSecretNested is used to store a hashed secret value into `tfstate`

func ImportProjectQualifiedResource

func ImportProjectQualifiedResource() *schema.ResourceImporter

ImportProjectQualifiedResource Import a resource by an ID that looks like one of the following:

<project ID>/<resource ID>
<project name>/<resource ID>

func ImportProjectQualifiedResourceInteger

func ImportProjectQualifiedResourceInteger() *schema.ResourceImporter

ImportProjectQualifiedResourceInteger Import a resource by an ID that looks like one of the following:

<project ID>/<resource ID as integer>
<project name>/<resource ID as integer>

func ImportProjectQualifiedResourceUUID

func ImportProjectQualifiedResourceUUID() *schema.ResourceImporter

ImportProjectQualifiedResourceUUID Import a resource by an ID that looks like one of the following:

<project ID>/<resource ID as uuid>
<project name>/<resource ID as uuid>

func ParseImportedID

func ParseImportedID(id string) (string, int, error)

ParseImportedID parse the imported int Id from the terraform import

func ParseImportedName

func ParseImportedName(id string) (string, string, error)

ParseImportedName parse the imported Id (Name) from the terraform import

func ParseImportedUUID

func ParseImportedUUID(id string) (string, string, error)

ParseImportedUUID parse the imported uuid from the terraform import

func ParseProjectIDAndResourceID

func ParseProjectIDAndResourceID(d *schema.ResourceData) (string, int, error)

ParseProjectIDAndResourceID parses from the schema's resource data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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