create

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasResourceUniqueIdPlusAdditionalSuffix

func HasResourceUniqueIdPlusAdditionalSuffix(s string, additionalSuffix string) bool

HasResourceUniqueIdPlusAdditionalSuffix returns true if the string has the built-in unique ID suffix plus an additional suffix

func HasResourceUniqueIdSuffix

func HasResourceUniqueIdSuffix(s string) bool

HasResourceUniqueIdSuffix returns true if the string has the built-in unique ID suffix

func Name

func Name(name string, namePrefix string) string

Name returns in order the name if non-empty, a prefix generated name if non-empty, or fully generated name prefixed with terraform-

func NamePrefixFromName

func NamePrefixFromName(name string) *string

NamePrefixFromName returns a name prefix if the string matches prefix criteria

The input to this function must be strictly the "name" and not any additional information such as a full Amazon Resource Name (ARN).

An expected usage might be:

d.Set("name_prefix", naming.NamePrefixFromName(d.Id()))

func NamePrefixFromNameWithSuffix

func NamePrefixFromNameWithSuffix(name, nameSuffix string) *string

func NameWithSuffix

func NameWithSuffix(name string, namePrefix string, nameSuffix string) string

NameWithSuffix returns in order the name if non-empty, a prefix generated name if non-empty, or fully generated name prefixed with "terraform-". In the latter two cases, any suffix is appended to the generated name

func StringHashcode

func StringHashcode(s string) int

StringHashcode hashes a string to a unique hashcode.

crc32 returns a uint32, but for our use we need and non negative integer. Here we cast to an integer and invert it if the result is negative.

func TestCheckResourceAttrNameFromPrefix

func TestCheckResourceAttrNameFromPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc

TestCheckResourceAttrNameFromPrefix verifies that the state attribute value matches name generated from given prefix

func TestCheckResourceAttrNameGenerated

func TestCheckResourceAttrNameGenerated(resourceName string, attributeName string) resource.TestCheckFunc

TestCheckResourceAttrNameGenerated verifies that the state attribute value matches name automatically generated without prefix

func TestCheckResourceAttrNameWithSuffixFromPrefix

func TestCheckResourceAttrNameWithSuffixFromPrefix(resourceName string, attributeName string, prefix string, suffix string) resource.TestCheckFunc

TestCheckResourceAttrNameWithSuffixFromPrefix verifies that the state attribute value matches name with suffix generated from given prefix

func TestCheckResourceAttrNameWithSuffixGenerated

func TestCheckResourceAttrNameWithSuffixGenerated(resourceName string, attributeName string, suffix string) resource.TestCheckFunc

TestCheckResourceAttrNameWithSuffixGenerated verifies that the state attribute value matches name with suffix automatically generated without prefix

Types

type AttributeMap

type AttributeMap map[string]attributeInfo

func AttrMap

func AttrMap(attrMap map[string]string, schemaMap map[string]*schema.Schema) AttributeMap

AttrMap returns a new AttributeMap from the specified Terraform resource attribute name to AWS API attribute name map and resource schema.

func (AttributeMap) ApiAttributeNames

func (m AttributeMap) ApiAttributeNames() []string

ApiAttributeNames returns the AWS API attribute names.

func (AttributeMap) ApiAttributesToResourceData

func (m AttributeMap) ApiAttributesToResourceData(apiAttributes map[string]string, d *schema.ResourceData) error

ApiAttributesToResourceData sets Terraform ResourceData from a map of AWS API attributes.

func (AttributeMap) ResourceDataToApiAttributesCreate

func (m AttributeMap) ResourceDataToApiAttributesCreate(d *schema.ResourceData) (map[string]string, error)

ResourceDataToApiAttributesCreate returns a map of AWS API attributes from Terraform ResourceData. The API attributes map is suitable for resource create.

func (AttributeMap) ResourceDataToApiAttributesUpdate

func (m AttributeMap) ResourceDataToApiAttributesUpdate(d *schema.ResourceData) (map[string]string, error)

ResourceDataToApiAttributesUpdate returns a map of AWS API attributes from Terraform ResourceData. The API attributes map is suitable for resource update.

Jump to

Keyboard shortcuts

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