Documentation ¶
Index ¶
- func Generate(name string, namePrefix string) string
- func HasResourceUniqueIdPrefix(s string) bool
- func HasResourceUniqueIdSuffix(s string) bool
- func NamePrefixFromName(name string) *string
- func TestCheckResourceAttrNameFromPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc
- func TestCheckResourceAttrNameGenerated(resourceName string, attributeName string) resource.TestCheckFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate returns in order the name if non-empty, a prefix generated name if non-empty, or fully generated name prefixed with terraform-
func HasResourceUniqueIdPrefix ¶
HasResourceUniqueIdPrefix returns true if the string has the built-in unique ID prefix
func HasResourceUniqueIdSuffix ¶
HasResourceUniqueIdSuffix returns true if the string has the built-in unique ID suffix
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). The output is suitable for custom resource Importer State functions after nil checking to ensure differences are not reported with ImportStateVerify testing, e.g.
if namePrefix := naming.NamePrefixFromName(d.Id()); namePrefix != nil { d.Set("name_prefix", namePrefix) }
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
Types ¶
This section is empty.