PolicyFileShare

Manages an Azure File Share Backup Policy within a Recovery Services vault.

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 policy = new Azure.Backup.PolicyFileShare("policy", new Azure.Backup.PolicyFileShareArgs
        {
            ResourceGroupName = rg.Name,
            RecoveryVaultName = vault.Name,
            Timezone = "UTC",
            Backup = new Azure.Backup.Inputs.PolicyFileShareBackupArgs
            {
                Frequency = "Daily",
                Time = "23:00",
            },
            RetentionDaily = new Azure.Backup.Inputs.PolicyFileShareRetentionDailyArgs
            {
                Count = 10,
            },
        });
    }

}
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/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
		}
		_, err = backup.NewPolicyFileShare(ctx, "policy", &backup.PolicyFileShareArgs{
			ResourceGroupName: rg.Name,
			RecoveryVaultName: vault.Name,
			Timezone:          pulumi.String("UTC"),
			Backup: &backup.PolicyFileShareBackupArgs{
				Frequency: pulumi.String("Daily"),
				Time:      pulumi.String("23:00"),
			},
			RetentionDaily: &backup.PolicyFileShareRetentionDailyArgs{
				Count: pulumi.Int(10),
			},
		})
		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")
policy = azure.backup.PolicyFileShare("policy",
    resource_group_name=rg.name,
    recovery_vault_name=vault.name,
    timezone="UTC",
    backup=azure.backup.PolicyFileShareBackupArgs(
        frequency="Daily",
        time="23:00",
    ),
    retention_daily=azure.backup.PolicyFileShareRetentionDailyArgs(
        count=10,
    ))
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 policy = new azure.backup.PolicyFileShare("policy", {
    resourceGroupName: rg.name,
    recoveryVaultName: vault.name,
    timezone: "UTC",
    backup: {
        frequency: "Daily",
        time: "23:00",
    },
    retentionDaily: {
        count: 10,
    },
});

Create a PolicyFileShare Resource

new PolicyFileShare(name: string, args: PolicyFileShareArgs, opts?: CustomResourceOptions);
@overload
def PolicyFileShare(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    backup: Optional[PolicyFileShareBackupArgs] = None,
                    name: Optional[str] = None,
                    recovery_vault_name: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    retention_daily: Optional[PolicyFileShareRetentionDailyArgs] = None,
                    timezone: Optional[str] = None)
@overload
def PolicyFileShare(resource_name: str,
                    args: PolicyFileShareArgs,
                    opts: Optional[ResourceOptions] = None)
func NewPolicyFileShare(ctx *Context, name string, args PolicyFileShareArgs, opts ...ResourceOption) (*PolicyFileShare, error)
public PolicyFileShare(string name, PolicyFileShareArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PolicyFileShareArgs
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 PolicyFileShareArgs
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 PolicyFileShareArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PolicyFileShareArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

PolicyFileShare Resource Properties

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

Inputs

The PolicyFileShare resource accepts the following input properties:

Backup PolicyFileShareBackupArgs
Configures the Policy backup frequency and times as documented in the backup block below.
RecoveryVaultName string
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
RetentionDaily PolicyFileShareRetentionDailyArgs
Configures the policy daily retention as documented in the retention_daily block below.
Name string
Specifies the name of the policy. Changing this forces a new resource to be created.
Timezone string
Specifies the timezone. the possible values are defined here. Defaults to UTC
Backup PolicyFileShareBackup
Configures the Policy backup frequency and times as documented in the backup block below.
RecoveryVaultName string
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
RetentionDaily PolicyFileShareRetentionDaily
Configures the policy daily retention as documented in the retention_daily block below.
Name string
Specifies the name of the policy. Changing this forces a new resource to be created.
Timezone string
Specifies the timezone. the possible values are defined here. Defaults to UTC
backup PolicyFileShareBackupArgs
Configures the Policy backup frequency and times as documented in the backup block below.
recoveryVaultName string
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
resourceGroupName string
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
retentionDaily PolicyFileShareRetentionDailyArgs
Configures the policy daily retention as documented in the retention_daily block below.
name string
Specifies the name of the policy. Changing this forces a new resource to be created.
timezone string
Specifies the timezone. the possible values are defined here. Defaults to UTC
backup PolicyFileShareBackupArgs
Configures the Policy backup frequency and times as documented in the backup block below.
recovery_vault_name str
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
resource_group_name str
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
retention_daily PolicyFileShareRetentionDailyArgs
Configures the policy daily retention as documented in the retention_daily block below.
name str
Specifies the name of the policy. Changing this forces a new resource to be created.
timezone str
Specifies the timezone. the possible values are defined here. Defaults to UTC

Outputs

All input properties are implicitly available as output properties. Additionally, the PolicyFileShare 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 PolicyFileShare Resource

Get an existing PolicyFileShare 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?: PolicyFileShareState, opts?: CustomResourceOptions): PolicyFileShare
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backup: Optional[PolicyFileShareBackupArgs] = None,
        name: Optional[str] = None,
        recovery_vault_name: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        retention_daily: Optional[PolicyFileShareRetentionDailyArgs] = None,
        timezone: Optional[str] = None) -> PolicyFileShare
func GetPolicyFileShare(ctx *Context, name string, id IDInput, state *PolicyFileShareState, opts ...ResourceOption) (*PolicyFileShare, error)
public static PolicyFileShare Get(string name, Input<string> id, PolicyFileShareState? 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:

Backup PolicyFileShareBackupArgs
Configures the Policy backup frequency and times as documented in the backup block below.
Name string
Specifies the name of the policy. Changing this forces a new resource to be created.
RecoveryVaultName string
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
RetentionDaily PolicyFileShareRetentionDailyArgs
Configures the policy daily retention as documented in the retention_daily block below.
Timezone string
Specifies the timezone. the possible values are defined here. Defaults to UTC
Backup PolicyFileShareBackup
Configures the Policy backup frequency and times as documented in the backup block below.
Name string
Specifies the name of the policy. Changing this forces a new resource to be created.
RecoveryVaultName string
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
RetentionDaily PolicyFileShareRetentionDaily
Configures the policy daily retention as documented in the retention_daily block below.
Timezone string
Specifies the timezone. the possible values are defined here. Defaults to UTC
backup PolicyFileShareBackupArgs
Configures the Policy backup frequency and times as documented in the backup block below.
name string
Specifies the name of the policy. Changing this forces a new resource to be created.
recoveryVaultName string
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
resourceGroupName string
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
retentionDaily PolicyFileShareRetentionDailyArgs
Configures the policy daily retention as documented in the retention_daily block below.
timezone string
Specifies the timezone. the possible values are defined here. Defaults to UTC
backup PolicyFileShareBackupArgs
Configures the Policy backup frequency and times as documented in the backup block below.
name str
Specifies the name of the policy. Changing this forces a new resource to be created.
recovery_vault_name str
Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
resource_group_name str
The name of the resource group in which to create the policy. Changing this forces a new resource to be created.
retention_daily PolicyFileShareRetentionDailyArgs
Configures the policy daily retention as documented in the retention_daily block below.
timezone str
Specifies the timezone. the possible values are defined here. Defaults to UTC

Supporting Types

PolicyFileShareBackup

Frequency string
Sets the backup frequency. Currently, only Daily is supported
Time string
Frequency string
Sets the backup frequency. Currently, only Daily is supported
Time string
frequency string
Sets the backup frequency. Currently, only Daily is supported
time string
frequency str
Sets the backup frequency. Currently, only Daily is supported
time str

PolicyFileShareRetentionDaily

Count int
The number of daily backups to keep. Must be between 1 and 180 (inclusive)
Count int
The number of daily backups to keep. Must be between 1 and 180 (inclusive)
count number
The number of daily backups to keep. Must be between 1 and 180 (inclusive)
count int
The number of daily backups to keep. Must be between 1 and 180 (inclusive)

Import

Azure File Share Backup Policies can be imported using the resource id, e.g.

 $ pulumi import azure:backup/policyFileShare:PolicyFileShare policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/example-recovery-vault/backupPolicies/policy1

Package Details

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