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 US",
});
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/v3/go/azure/backup"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/recoveryservices"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
rg, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{
Location: pulumi.String("West US"),
})
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 US")
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 US"});
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);def ContainerStorageAccount(resource_name, opts=None, recovery_vault_name=None, resource_group_name=None, storage_account_id=None, __props__=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.
- opts ResourceOptions
- A bag of options that control this 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:
- Recovery
Vault stringName The name of the vault where the storage account will be registered.
- Resource
Group stringName Name of the resource group where the vault is located.
- Storage
Account stringId Azure Resource ID of the storage account to be registered
- Recovery
Vault stringName The name of the vault where the storage account will be registered.
- Resource
Group stringName Name of the resource group where the vault is located.
- Storage
Account stringId Azure Resource ID of the storage account to be registered
- recovery
Vault stringName The name of the vault where the storage account will be registered.
- resource
Group stringName Name of the resource group where the vault is located.
- storage
Account stringId Azure Resource ID of the storage account to be registered
- recovery_
vault_ strname The name of the vault where the storage account will be registered.
- resource_
group_ strname Name of the resource group where the vault is located.
- storage_
account_ strid Azure Resource 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:
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): ContainerStorageAccountstatic get(resource_name, id, opts=None, recovery_vault_name=None, resource_group_name=None, storage_account_id=None, __props__=None);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:
- Recovery
Vault stringName The name of the vault where the storage account will be registered.
- Resource
Group stringName Name of the resource group where the vault is located.
- Storage
Account stringId Azure Resource ID of the storage account to be registered
- Recovery
Vault stringName The name of the vault where the storage account will be registered.
- Resource
Group stringName Name of the resource group where the vault is located.
- Storage
Account stringId Azure Resource ID of the storage account to be registered
- recovery
Vault stringName The name of the vault where the storage account will be registered.
- resource
Group stringName Name of the resource group where the vault is located.
- storage
Account stringId Azure Resource ID of the storage account to be registered
- recovery_
vault_ strname The name of the vault where the storage account will be registered.
- resource_
group_ strname Name of the resource group where the vault is located.
- storage_
account_ strid Azure Resource ID of the storage account to be registered
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.