keyvault

package
v0.0.0-...-e747c7c Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateComplexKeyVault

func CreateComplexKeyVault(ctx context.Context, vaultName, userID string) (vault keyvault.Vault, err error)

CreateComplexKeyVault creates a new vault which grants access to the the current user and the service principal in use

func CreateKeyBundle

func CreateKeyBundle(ctx context.Context, vaultName string) (key keyvault.KeyBundle, err error)

CreateKeyBundle creates a key in the specified keyvault

func CreateVault

func CreateVault(ctx context.Context, vaultName string) (keyvault.Vault, error)

CreateVault creates a new vault

func DeleteVault

func DeleteVault(ctx context.Context, vaultName string) (autorest.Response, error)

DeleteVault deletes an existing vault

func GetVault

func GetVault(ctx context.Context, vaultName string) (keyvault.Vault, error)

GetVault returns an existing vault

func GetVaults

func GetVaults()

GetVaults lists all key vaults in a subscription

func SetVaultPermissions

func SetVaultPermissions(ctx context.Context, vaultName string) (keyvault.Vault, error)

SetVaultPermissions adds an access policy permitting this app's Client ID to manage keys and secrets.

Example
helpers.SetResourceGroupName("SetVaultPermissions")
ctx := context.Background()
defer resources.Cleanup(ctx)
_, err := resources.CreateGroup(ctx, helpers.ResourceGroupName())
if err != nil {
	helpers.PrintAndLog(err.Error())
}

_, err = CreateVault(ctx, vaultName)
if err != nil {
	helpers.PrintAndLog(err.Error())
}
helpers.PrintAndLog("vault created")

_, err = SetVaultPermissions(ctx, vaultName)
if err != nil {
	helpers.PrintAndLog(err.Error())
}
helpers.PrintAndLog("set vault permissions")
Output:

vault created
set vault permissions

func SetVaultPermissionsForDeployment

func SetVaultPermissionsForDeployment(ctx context.Context, vaultName string) (keyvault.Vault, error)

SetVaultPermissionsForDeployment updates a key vault to enable deployments and add permissions to the application")

Types

This section is empty.

Jump to

Keyboard shortcuts

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