Documentation ¶
Index ¶
- func CreateKey(ctx context.Context, vaultName, keyName string) (key keyvault.KeyBundle, err error)
- func CreateVault(ctx context.Context, vaultName string) (keyvault.Vault, error)
- func CreateVaultWithPolicies(ctx context.Context, vaultName, userID string) (vault keyvault.Vault, err error)
- func DeleteVault(ctx context.Context, vaultName string) (autorest.Response, error)
- func GetVault(ctx context.Context, vaultName string) (keyvault.Vault, error)
- func GetVaults()
- func SetVaultPermissions(ctx context.Context, vaultName string) (keyvault.Vault, error)
- func SetVaultPermissionsForDeployment(ctx context.Context, vaultName string) (keyvault.Vault, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateVault ¶
CreateVault creates a new vault
func CreateVaultWithPolicies ¶
func CreateVaultWithPolicies(ctx context.Context, vaultName, userID string) (vault keyvault.Vault, err error)
CreateVaultWithPolicies creates a new Vault with policies granting access to the specified user.
func DeleteVault ¶
DeleteVault deletes an existing vault
func SetVaultPermissions ¶
SetVaultPermissions adds an access policy permitting this app's Client ID to manage keys and secrets.
Example ¶
var groupName = config.GenerateGroupName("KeyVault") config.SetGroupName(groupName) ctx := context.Background() defer resources.Cleanup(ctx) _, err := resources.CreateGroup(ctx, config.GroupName()) if err != nil { util.PrintAndLog(err.Error()) } _, err = CreateVault(ctx, kvName) if err != nil { util.PrintAndLog(err.Error()) } util.PrintAndLog("vault created") _, err = SetVaultPermissions(ctx, kvName) if err != nil { util.PrintAndLog(err.Error()) } util.PrintAndLog("set vault permissions") _, err = CreateKey(ctx, kvName, keyName) if err != nil { util.PrintAndLog(err.Error()) } util.PrintAndLog("created key")
Output: vault created set vault permissions created key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.