Documentation ¶
Index ¶
- func HasResourceUniqueIdPlusAdditionalSuffix(s string, additionalSuffix string) bool
- func HasResourceUniqueIdSuffix(s string) bool
- func Name(name string, namePrefix string) string
- func NamePrefixFromName(name string) *string
- func NamePrefixFromNameWithSuffix(name, nameSuffix string) *string
- func NameWithSuffix(name string, namePrefix string, nameSuffix string) string
- func StringHashcode(s string) int
- func TestCheckResourceAttrNameFromPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc
- func TestCheckResourceAttrNameGenerated(resourceName string, attributeName string) resource.TestCheckFunc
- func TestCheckResourceAttrNameWithSuffixFromPrefix(resourceName string, attributeName string, prefix string, suffix string) resource.TestCheckFunc
- func TestCheckResourceAttrNameWithSuffixGenerated(resourceName string, attributeName string, suffix string) resource.TestCheckFunc
- type AttributeMap
- func (m AttributeMap) ApiAttributeNames() []string
- func (m AttributeMap) ApiAttributesToResourceData(apiAttributes map[string]string, d *schema.ResourceData) error
- func (m AttributeMap) ResourceDataToApiAttributesCreate(d *schema.ResourceData) (map[string]string, error)
- func (m AttributeMap) ResourceDataToApiAttributesUpdate(d *schema.ResourceData) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasResourceUniqueIdPlusAdditionalSuffix ¶
HasResourceUniqueIdPlusAdditionalSuffix returns true if the string has the built-in unique ID suffix plus an additional suffix
func HasResourceUniqueIdSuffix ¶
HasResourceUniqueIdSuffix returns true if the string has the built-in unique ID suffix
func Name ¶
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 ¶
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 NameWithSuffix ¶
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 ¶
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 ¶
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.