1. Packages
  2. Azure Native v1
  3. API Docs
  4. netapp
  5. BackupPolicy
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.netapp.BackupPolicy

Explore with Pulumi AI

These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

Backup policy information API Version: 2020-12-01.

Example Usage

BackupPolicies_Create

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var backupPolicy = new AzureNative.NetApp.BackupPolicy("backupPolicy", new()
    {
        AccountName = "account1",
        BackupPolicyName = "backupPolicyName",
        DailyBackupsToKeep = 10,
        Enabled = true,
        Location = "westus",
        MonthlyBackupsToKeep = 10,
        ResourceGroupName = "myRG",
        WeeklyBackupsToKeep = 10,
    });

});
Copy
package main

import (
	netapp "github.com/pulumi/pulumi-azure-native-sdk/netapp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := netapp.NewBackupPolicy(ctx, "backupPolicy", &netapp.BackupPolicyArgs{
			AccountName:          pulumi.String("account1"),
			BackupPolicyName:     pulumi.String("backupPolicyName"),
			DailyBackupsToKeep:   pulumi.Int(10),
			Enabled:              pulumi.Bool(true),
			Location:             pulumi.String("westus"),
			MonthlyBackupsToKeep: pulumi.Int(10),
			ResourceGroupName:    pulumi.String("myRG"),
			WeeklyBackupsToKeep:  pulumi.Int(10),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.netapp.BackupPolicy;
import com.pulumi.azurenative.netapp.BackupPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var backupPolicy = new BackupPolicy("backupPolicy", BackupPolicyArgs.builder()        
            .accountName("account1")
            .backupPolicyName("backupPolicyName")
            .dailyBackupsToKeep(10)
            .enabled(true)
            .location("westus")
            .monthlyBackupsToKeep(10)
            .resourceGroupName("myRG")
            .weeklyBackupsToKeep(10)
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const backupPolicy = new azure_native.netapp.BackupPolicy("backupPolicy", {
    accountName: "account1",
    backupPolicyName: "backupPolicyName",
    dailyBackupsToKeep: 10,
    enabled: true,
    location: "westus",
    monthlyBackupsToKeep: 10,
    resourceGroupName: "myRG",
    weeklyBackupsToKeep: 10,
});
Copy
import pulumi
import pulumi_azure_native as azure_native

backup_policy = azure_native.netapp.BackupPolicy("backupPolicy",
    account_name="account1",
    backup_policy_name="backupPolicyName",
    daily_backups_to_keep=10,
    enabled=True,
    location="westus",
    monthly_backups_to_keep=10,
    resource_group_name="myRG",
    weekly_backups_to_keep=10)
Copy
resources:
  backupPolicy:
    type: azure-native:netapp:BackupPolicy
    properties:
      accountName: account1
      backupPolicyName: backupPolicyName
      dailyBackupsToKeep: 10
      enabled: true
      location: westus
      monthlyBackupsToKeep: 10
      resourceGroupName: myRG
      weeklyBackupsToKeep: 10
Copy

Create BackupPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new BackupPolicy(name: string, args: BackupPolicyArgs, opts?: CustomResourceOptions);
@overload
def BackupPolicy(resource_name: str,
                 args: BackupPolicyArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def BackupPolicy(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 account_name: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 backup_policy_name: Optional[str] = None,
                 daily_backups_to_keep: Optional[int] = None,
                 enabled: Optional[bool] = None,
                 location: Optional[str] = None,
                 monthly_backups_to_keep: Optional[int] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 volume_backups: Optional[Sequence[VolumeBackupsArgs]] = None,
                 volumes_assigned: Optional[int] = None,
                 weekly_backups_to_keep: Optional[int] = None,
                 yearly_backups_to_keep: Optional[int] = None)
func NewBackupPolicy(ctx *Context, name string, args BackupPolicyArgs, opts ...ResourceOption) (*BackupPolicy, error)
public BackupPolicy(string name, BackupPolicyArgs args, CustomResourceOptions? opts = null)
public BackupPolicy(String name, BackupPolicyArgs args)
public BackupPolicy(String name, BackupPolicyArgs args, CustomResourceOptions options)
type: azure-native:netapp:BackupPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BackupPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. BackupPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. BackupPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BackupPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. BackupPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var azure_nativeBackupPolicyResource = new AzureNative.Netapp.BackupPolicy("azure-nativeBackupPolicyResource", new()
{
    AccountName = "string",
    ResourceGroupName = "string",
    BackupPolicyName = "string",
    DailyBackupsToKeep = 0,
    Enabled = false,
    Location = "string",
    MonthlyBackupsToKeep = 0,
    Tags = 
    {
        { "string", "string" },
    },
    VolumeBackups = new[]
    {
        
        {
            { "backupsCount", 0 },
            { "policyEnabled", false },
            { "volumeName", "string" },
        },
    },
    VolumesAssigned = 0,
    WeeklyBackupsToKeep = 0,
    YearlyBackupsToKeep = 0,
});
Copy
example, err := netapp.NewBackupPolicy(ctx, "azure-nativeBackupPolicyResource", &netapp.BackupPolicyArgs{
	AccountName:          "string",
	ResourceGroupName:    "string",
	BackupPolicyName:     "string",
	DailyBackupsToKeep:   0,
	Enabled:              false,
	Location:             "string",
	MonthlyBackupsToKeep: 0,
	Tags: map[string]interface{}{
		"string": "string",
	},
	VolumeBackups: []map[string]interface{}{
		map[string]interface{}{
			"backupsCount":  0,
			"policyEnabled": false,
			"volumeName":    "string",
		},
	},
	VolumesAssigned:     0,
	WeeklyBackupsToKeep: 0,
	YearlyBackupsToKeep: 0,
})
Copy
var azure_nativeBackupPolicyResource = new BackupPolicy("azure-nativeBackupPolicyResource", BackupPolicyArgs.builder()
    .accountName("string")
    .resourceGroupName("string")
    .backupPolicyName("string")
    .dailyBackupsToKeep(0)
    .enabled(false)
    .location("string")
    .monthlyBackupsToKeep(0)
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .volumeBackups(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .volumesAssigned(0)
    .weeklyBackupsToKeep(0)
    .yearlyBackupsToKeep(0)
    .build());
Copy
azure_native_backup_policy_resource = azure_native.netapp.BackupPolicy("azure-nativeBackupPolicyResource",
    account_name=string,
    resource_group_name=string,
    backup_policy_name=string,
    daily_backups_to_keep=0,
    enabled=False,
    location=string,
    monthly_backups_to_keep=0,
    tags={
        string: string,
    },
    volume_backups=[{
        backupsCount: 0,
        policyEnabled: False,
        volumeName: string,
    }],
    volumes_assigned=0,
    weekly_backups_to_keep=0,
    yearly_backups_to_keep=0)
Copy
const azure_nativeBackupPolicyResource = new azure_native.netapp.BackupPolicy("azure-nativeBackupPolicyResource", {
    accountName: "string",
    resourceGroupName: "string",
    backupPolicyName: "string",
    dailyBackupsToKeep: 0,
    enabled: false,
    location: "string",
    monthlyBackupsToKeep: 0,
    tags: {
        string: "string",
    },
    volumeBackups: [{
        backupsCount: 0,
        policyEnabled: false,
        volumeName: "string",
    }],
    volumesAssigned: 0,
    weeklyBackupsToKeep: 0,
    yearlyBackupsToKeep: 0,
});
Copy
type: azure-native:netapp:BackupPolicy
properties:
    accountName: string
    backupPolicyName: string
    dailyBackupsToKeep: 0
    enabled: false
    location: string
    monthlyBackupsToKeep: 0
    resourceGroupName: string
    tags:
        string: string
    volumeBackups:
        - backupsCount: 0
          policyEnabled: false
          volumeName: string
    volumesAssigned: 0
    weeklyBackupsToKeep: 0
    yearlyBackupsToKeep: 0
Copy

BackupPolicy Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The BackupPolicy resource accepts the following input properties:

AccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the NetApp account
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
BackupPolicyName Changes to this property will trigger replacement. string
Backup policy Name which uniquely identify backup policy.
DailyBackupsToKeep int
Daily backups count to keep
Enabled bool
The property to decide policy is enabled or not
Location Changes to this property will trigger replacement. string
Resource location
MonthlyBackupsToKeep int
Monthly backups count to keep
Tags Dictionary<string, string>
Resource tags
VolumeBackups List<Pulumi.AzureNative.NetApp.Inputs.VolumeBackups>
A list of volumes assigned to this policy
VolumesAssigned int
Volumes using current backup policy
WeeklyBackupsToKeep int
Weekly backups count to keep
YearlyBackupsToKeep int
Yearly backups count to keep
AccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the NetApp account
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
BackupPolicyName Changes to this property will trigger replacement. string
Backup policy Name which uniquely identify backup policy.
DailyBackupsToKeep int
Daily backups count to keep
Enabled bool
The property to decide policy is enabled or not
Location Changes to this property will trigger replacement. string
Resource location
MonthlyBackupsToKeep int
Monthly backups count to keep
Tags map[string]string
Resource tags
VolumeBackups []VolumeBackupsArgs
A list of volumes assigned to this policy
VolumesAssigned int
Volumes using current backup policy
WeeklyBackupsToKeep int
Weekly backups count to keep
YearlyBackupsToKeep int
Yearly backups count to keep
accountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the NetApp account
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
backupPolicyName Changes to this property will trigger replacement. String
Backup policy Name which uniquely identify backup policy.
dailyBackupsToKeep Integer
Daily backups count to keep
enabled Boolean
The property to decide policy is enabled or not
location Changes to this property will trigger replacement. String
Resource location
monthlyBackupsToKeep Integer
Monthly backups count to keep
tags Map<String,String>
Resource tags
volumeBackups List<VolumeBackups>
A list of volumes assigned to this policy
volumesAssigned Integer
Volumes using current backup policy
weeklyBackupsToKeep Integer
Weekly backups count to keep
yearlyBackupsToKeep Integer
Yearly backups count to keep
accountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the NetApp account
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
backupPolicyName Changes to this property will trigger replacement. string
Backup policy Name which uniquely identify backup policy.
dailyBackupsToKeep number
Daily backups count to keep
enabled boolean
The property to decide policy is enabled or not
location Changes to this property will trigger replacement. string
Resource location
monthlyBackupsToKeep number
Monthly backups count to keep
tags {[key: string]: string}
Resource tags
volumeBackups VolumeBackups[]
A list of volumes assigned to this policy
volumesAssigned number
Volumes using current backup policy
weeklyBackupsToKeep number
Weekly backups count to keep
yearlyBackupsToKeep number
Yearly backups count to keep
account_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the NetApp account
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
backup_policy_name Changes to this property will trigger replacement. str
Backup policy Name which uniquely identify backup policy.
daily_backups_to_keep int
Daily backups count to keep
enabled bool
The property to decide policy is enabled or not
location Changes to this property will trigger replacement. str
Resource location
monthly_backups_to_keep int
Monthly backups count to keep
tags Mapping[str, str]
Resource tags
volume_backups Sequence[VolumeBackupsArgs]
A list of volumes assigned to this policy
volumes_assigned int
Volumes using current backup policy
weekly_backups_to_keep int
Weekly backups count to keep
yearly_backups_to_keep int
Yearly backups count to keep
accountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the NetApp account
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
backupPolicyName Changes to this property will trigger replacement. String
Backup policy Name which uniquely identify backup policy.
dailyBackupsToKeep Number
Daily backups count to keep
enabled Boolean
The property to decide policy is enabled or not
location Changes to this property will trigger replacement. String
Resource location
monthlyBackupsToKeep Number
Monthly backups count to keep
tags Map<String>
Resource tags
volumeBackups List<Property Map>
A list of volumes assigned to this policy
volumesAssigned Number
Volumes using current backup policy
weeklyBackupsToKeep Number
Weekly backups count to keep
yearlyBackupsToKeep Number
Yearly backups count to keep

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
Name of backup policy
ProvisioningState string
Azure lifecycle management
Type string
Resource type
Id string
The provider-assigned unique ID for this managed resource.
Name string
Name of backup policy
ProvisioningState string
Azure lifecycle management
Type string
Resource type
id String
The provider-assigned unique ID for this managed resource.
name String
Name of backup policy
provisioningState String
Azure lifecycle management
type String
Resource type
id string
The provider-assigned unique ID for this managed resource.
name string
Name of backup policy
provisioningState string
Azure lifecycle management
type string
Resource type
id str
The provider-assigned unique ID for this managed resource.
name str
Name of backup policy
provisioning_state str
Azure lifecycle management
type str
Resource type
id String
The provider-assigned unique ID for this managed resource.
name String
Name of backup policy
provisioningState String
Azure lifecycle management
type String
Resource type

Supporting Types

VolumeBackups
, VolumeBackupsArgs

BackupsCount int
Total count of backups for volume
PolicyEnabled bool
Policy enabled
VolumeName string
Volume name
BackupsCount int
Total count of backups for volume
PolicyEnabled bool
Policy enabled
VolumeName string
Volume name
backupsCount Integer
Total count of backups for volume
policyEnabled Boolean
Policy enabled
volumeName String
Volume name
backupsCount number
Total count of backups for volume
policyEnabled boolean
Policy enabled
volumeName string
Volume name
backups_count int
Total count of backups for volume
policy_enabled bool
Policy enabled
volume_name str
Volume name
backupsCount Number
Total count of backups for volume
policyEnabled Boolean
Policy enabled
volumeName String
Volume name

VolumeBackupsResponse
, VolumeBackupsResponseArgs

BackupsCount int
Total count of backups for volume
PolicyEnabled bool
Policy enabled
VolumeName string
Volume name
BackupsCount int
Total count of backups for volume
PolicyEnabled bool
Policy enabled
VolumeName string
Volume name
backupsCount Integer
Total count of backups for volume
policyEnabled Boolean
Policy enabled
volumeName String
Volume name
backupsCount number
Total count of backups for volume
policyEnabled boolean
Policy enabled
volumeName string
Volume name
backups_count int
Total count of backups for volume
policy_enabled bool
Policy enabled
volume_name str
Volume name
backupsCount Number
Total count of backups for volume
policyEnabled Boolean
Policy enabled
volumeName String
Volume name

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:netapp:BackupPolicy account1/backupPolicyName /subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v1 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi