Documentation ¶
Index ¶
- Constants
- func AddCommonReferences(r *tjconfig.Resource) error
- func GetAttributeValue(attrMap map[string]interface{}, attr string) (string, error)
- func GetFullyQualifiedIDFn(serviceProvider string, keyPairs ...string) tjconfig.GetIDFn
- func GetNameFromFullyQualifiedID(tfstate map[string]interface{}) (string, error)
- func GetResourceNameFromIDURLFn(pos int) tjconfig.GetExternalNameFn
- func ParseNameFromIDField(attrMap map[string]interface{}, idAttr string) (string, error)
Constants ¶
const ( // ErrFmtNoAttribute is an error string for not-found attributes ErrFmtNoAttribute = `"attribute not found: %s` // ErrFmtUnexpectedType is an error string for attribute map values of unexpected type ErrFmtUnexpectedType = `unexpected type for attribute %s: Expecting a string` // VersionV1Alpha2 is used as minimum version for all manually configured resources. VersionV1Alpha2 = "v1alpha2" )
Variables ¶
This section is empty.
Functions ¶
func AddCommonReferences ¶ added in v0.6.0
AddCommonReferences adds some common reference fields. This is a part of resource generation pipeline.
func GetAttributeValue ¶ added in v0.6.0
GetAttributeValue reads a string attribute from the specified map
func GetFullyQualifiedIDFn ¶
GetFullyQualifiedIDFn returns a GetIDFn that can parse any Azure fully qualifier. An example identifier is as follows: /subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sqlDatabases/%s/containers/%s An input to this function to parse it would be: serviceProvider: "Microsoft.DocumentDB" keyPairs: []string{"databaseAccounts", "account_name", "sqlDatabases", "database_name", "containers", "name"}
func GetNameFromFullyQualifiedID ¶
GetNameFromFullyQualifiedID extracts external-name from Azure ID using the "id" attribute. Examples of fully qualifiers: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforMySQL/servers/server1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkInterfaces/nic1
func GetResourceNameFromIDURLFn ¶ added in v0.6.0
func GetResourceNameFromIDURLFn(pos int) tjconfig.GetExternalNameFn
GetResourceNameFromIDURLFn returns a GetExternalNameFn fuction that extracts external-name from an Azure URL ID at the specified pos. Examples of persistent IDs to be parsed with pos==2: https://example.vault.azure.net/secrets/example-secret/c0ffee5f4d45440cb60c28672887f832 https://example-keyvault.vault.azure.net/keys/example-key/fdf067c93bbb4b22bff4d8b7a9a56217 https://key-vault-name.vault.azure.net/certificates/issuers/example
func ParseNameFromIDField ¶ added in v0.6.0
ParseNameFromIDField extracts external-name from Azure ID using the specified field. Examples of fully qualifiers: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforMySQL/servers/server1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkInterfaces/nic1
Types ¶
This section is empty.