ContainerStorageAccount

Manages registration of a storage account with Azure Backup. Storage accounts must be registered with an Azure Recovery Vault in order to backup file shares within the storage account. Registering a storage account with a vault creates what is known as a protection container within Azure Recovery Services. Once the container is created, Azure file shares within the storage account can be backed up using the azure.backup.ProtectedFileShare resource.

NOTE: Azure Backup for Azure File Shares is currently in public preview. During the preview, the service is subject to additional limitations and unsupported backup scenarios. Read More

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var rg = new Azure.Core.ResourceGroup("rg", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var vault = new Azure.RecoveryServices.Vault("vault", new Azure.RecoveryServices.VaultArgs
        {
            Location = rg.Location,
            ResourceGroupName = rg.Name,
            Sku = "Standard",
        });
        var sa = new Azure.Storage.Account("sa", new Azure.Storage.AccountArgs
        {
            Location = rg.Location,
            ResourceGroupName = rg.Name,
            AccountTier = "Standard",
            AccountReplicationType = "LRS",
        });
        var container = new Azure.Backup.ContainerStorageAccount("container", new Azure.Backup.ContainerStorageAccountArgs
        {
            ResourceGroupName = rg.Name,
            RecoveryVaultName = vault.Name,
            StorageAccountId = sa.Id,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/backup"
	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/recoveryservices"
	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		rg, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
			Location:          rg.Location,
			ResourceGroupName: rg.Name,
			Sku:               pulumi.String("Standard"),
		})
		if err != nil {
			return err
		}
		sa, err := storage.NewAccount(ctx, "sa", &storage.AccountArgs{
			Location:               rg.Location,
			ResourceGroupName:      rg.Name,
			AccountTier:            pulumi.String("Standard"),
			AccountReplicationType: pulumi.String("LRS"),
		})
		if err != nil {
			return err
		}
		_, err = backup.NewContainerStorageAccount(ctx, "container", &backup.ContainerStorageAccountArgs{
			ResourceGroupName: rg.Name,
			RecoveryVaultName: vault.Name,
			StorageAccountId:  sa.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_azure as azure

rg = azure.core.ResourceGroup("rg", location="West Europe")
vault = azure.recoveryservices.Vault("vault",
    location=rg.location,
    resource_group_name=rg.name,
    sku="Standard")
sa = azure.storage.Account("sa",
    location=rg.location,
    resource_group_name=rg.name,
    account_tier="Standard",
    account_replication_type="LRS")
container = azure.backup.ContainerStorageAccount("container",
    resource_group_name=rg.name,
    recovery_vault_name=vault.name,
    storage_account_id=sa.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const rg = new azure.core.ResourceGroup("rg", {location: "West Europe"});
const vault = new azure.recoveryservices.Vault("vault", {
    location: rg.location,
    resourceGroupName: rg.name,
    sku: "Standard",
});
const sa = new azure.storage.Account("sa", {
    location: rg.location,
    resourceGroupName: rg.name,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const container = new azure.backup.ContainerStorageAccount("container", {
    resourceGroupName: rg.name,
    recoveryVaultName: vault.name,
    storageAccountId: sa.id,
});

Create a ContainerStorageAccount Resource

new ContainerStorageAccount(name: string, args: ContainerStorageAccountArgs, opts?: CustomResourceOptions);
@overload
def ContainerStorageAccount(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            recovery_vault_name: Optional[str] = None,
                            resource_group_name: Optional[str] = None,
                            storage_account_id: Optional[str] = None)
@overload
def ContainerStorageAccount(resource_name: str,
                            args: ContainerStorageAccountArgs,
                            opts: Optional[ResourceOptions] = None)
func NewContainerStorageAccount(ctx *Context, name string, args ContainerStorageAccountArgs, opts ...ResourceOption) (*ContainerStorageAccount, error)
public ContainerStorageAccount(string name, ContainerStorageAccountArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ContainerStorageAccountArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ContainerStorageAccountArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ContainerStorageAccountArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ContainerStorageAccountArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ContainerStorageAccount Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ContainerStorageAccount resource accepts the following input properties:

RecoveryVaultName string
The name of the vault where the storage account will be registered.
ResourceGroupName string
Name of the resource group where the vault is located.
StorageAccountId string
The ID of the Storage Account to be registered
RecoveryVaultName string
The name of the vault where the storage account will be registered.
ResourceGroupName string
Name of the resource group where the vault is located.
StorageAccountId string
The ID of the Storage Account to be registered
recoveryVaultName string
The name of the vault where the storage account will be registered.
resourceGroupName string
Name of the resource group where the vault is located.
storageAccountId string
The ID of the Storage Account to be registered
recovery_vault_name str
The name of the vault where the storage account will be registered.
resource_group_name str
Name of the resource group where the vault is located.
storage_account_id str
The ID of the Storage Account to be registered

Outputs

All input properties are implicitly available as output properties. Additionally, the ContainerStorageAccount resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ContainerStorageAccount Resource

Get an existing ContainerStorageAccount resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ContainerStorageAccountState, opts?: CustomResourceOptions): ContainerStorageAccount
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        recovery_vault_name: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        storage_account_id: Optional[str] = None) -> ContainerStorageAccount
func GetContainerStorageAccount(ctx *Context, name string, id IDInput, state *ContainerStorageAccountState, opts ...ResourceOption) (*ContainerStorageAccount, error)
public static ContainerStorageAccount Get(string name, Input<string> id, ContainerStorageAccountState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

RecoveryVaultName string
The name of the vault where the storage account will be registered.
ResourceGroupName string
Name of the resource group where the vault is located.
StorageAccountId string
The ID of the Storage Account to be registered
RecoveryVaultName string
The name of the vault where the storage account will be registered.
ResourceGroupName string
Name of the resource group where the vault is located.
StorageAccountId string
The ID of the Storage Account to be registered
recoveryVaultName string
The name of the vault where the storage account will be registered.
resourceGroupName string
Name of the resource group where the vault is located.
storageAccountId string
The ID of the Storage Account to be registered
recovery_vault_name str
The name of the vault where the storage account will be registered.
resource_group_name str
Name of the resource group where the vault is located.
storage_account_id str
The ID of the Storage Account to be registered

Import

Backup Storage Account Containers can be imported using the resource id, e.g.

 $ pulumi import azure:backup/containerStorageAccount:ContainerStorageAccount mycontainer "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/backupFabrics/Azure/protectionContainers/StorageContainer;storage;storage-rg-name;storage-account"

Note the ID requires quoting as there are semicolons

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.