SnapshotPolicy

class SnapshotPolicy : KotlinCustomResource

Manages a NetApp Snapshot Policy.

NetApp Snapshot Policy Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"});
const exampleAccount = new azure.netapp.Account("exampleAccount", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
});
const exampleSnapshotPolicy = new azure.netapp.SnapshotPolicy("exampleSnapshotPolicy", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
accountName: exampleAccount.name,
enabled: true,
hourlySchedule: {
snapshotsToKeep: 4,
minute: 15,
},
dailySchedule: {
snapshotsToKeep: 2,
hour: 20,
minute: 15,
},
weeklySchedule: {
snapshotsToKeep: 1,
daysOfWeeks: [
"Monday",
"Friday",
],
hour: 23,
minute: 0,
},
monthlySchedule: {
snapshotsToKeep: 1,
daysOfMonths: [
1,
15,
20,
30,
],
hour: 5,
minute: 45,
},
});
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US")
example_account = azure.netapp.Account("exampleAccount",
location=example_resource_group.location,
resource_group_name=example_resource_group.name)
example_snapshot_policy = azure.netapp.SnapshotPolicy("exampleSnapshotPolicy",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
account_name=example_account.name,
enabled=True,
hourly_schedule=azure.netapp.SnapshotPolicyHourlyScheduleArgs(
snapshots_to_keep=4,
minute=15,
),
daily_schedule=azure.netapp.SnapshotPolicyDailyScheduleArgs(
snapshots_to_keep=2,
hour=20,
minute=15,
),
weekly_schedule=azure.netapp.SnapshotPolicyWeeklyScheduleArgs(
snapshots_to_keep=1,
days_of_weeks=[
"Monday",
"Friday",
],
hour=23,
minute=0,
),
monthly_schedule=azure.netapp.SnapshotPolicyMonthlyScheduleArgs(
snapshots_to_keep=1,
days_of_months=[
1,
15,
20,
30,
],
hour=5,
minute=45,
))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "East US",
});
var exampleAccount = new Azure.NetApp.Account("exampleAccount", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
});
var exampleSnapshotPolicy = new Azure.NetApp.SnapshotPolicy("exampleSnapshotPolicy", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
AccountName = exampleAccount.Name,
Enabled = true,
HourlySchedule = new Azure.NetApp.Inputs.SnapshotPolicyHourlyScheduleArgs
{
SnapshotsToKeep = 4,
Minute = 15,
},
DailySchedule = new Azure.NetApp.Inputs.SnapshotPolicyDailyScheduleArgs
{
SnapshotsToKeep = 2,
Hour = 20,
Minute = 15,
},
WeeklySchedule = new Azure.NetApp.Inputs.SnapshotPolicyWeeklyScheduleArgs
{
SnapshotsToKeep = 1,
DaysOfWeeks = new[]
{
"Monday",
"Friday",
},
Hour = 23,
Minute = 0,
},
MonthlySchedule = new Azure.NetApp.Inputs.SnapshotPolicyMonthlyScheduleArgs
{
SnapshotsToKeep = 1,
DaysOfMonths = new[]
{
1,
15,
20,
30,
},
Hour = 5,
Minute = 45,
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("East US"),
})
if err != nil {
return err
}
exampleAccount, err := netapp.NewAccount(ctx, "exampleAccount", &netapp.AccountArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
})
if err != nil {
return err
}
_, err = netapp.NewSnapshotPolicy(ctx, "exampleSnapshotPolicy", &netapp.SnapshotPolicyArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
AccountName: exampleAccount.Name,
Enabled: pulumi.Bool(true),
HourlySchedule: &netapp.SnapshotPolicyHourlyScheduleArgs{
SnapshotsToKeep: pulumi.Int(4),
Minute: pulumi.Int(15),
},
DailySchedule: &netapp.SnapshotPolicyDailyScheduleArgs{
SnapshotsToKeep: pulumi.Int(2),
Hour: pulumi.Int(20),
Minute: pulumi.Int(15),
},
WeeklySchedule: &netapp.SnapshotPolicyWeeklyScheduleArgs{
SnapshotsToKeep: pulumi.Int(1),
DaysOfWeeks: pulumi.StringArray{
pulumi.String("Monday"),
pulumi.String("Friday"),
},
Hour: pulumi.Int(23),
Minute: pulumi.Int(0),
},
MonthlySchedule: &netapp.SnapshotPolicyMonthlyScheduleArgs{
SnapshotsToKeep: pulumi.Int(1),
DaysOfMonths: pulumi.IntArray{
pulumi.Int(1),
pulumi.Int(15),
pulumi.Int(20),
pulumi.Int(30),
},
Hour: pulumi.Int(5),
Minute: pulumi.Int(45),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.netapp.Account;
import com.pulumi.azure.netapp.AccountArgs;
import com.pulumi.azure.netapp.SnapshotPolicy;
import com.pulumi.azure.netapp.SnapshotPolicyArgs;
import com.pulumi.azure.netapp.inputs.SnapshotPolicyHourlyScheduleArgs;
import com.pulumi.azure.netapp.inputs.SnapshotPolicyDailyScheduleArgs;
import com.pulumi.azure.netapp.inputs.SnapshotPolicyWeeklyScheduleArgs;
import com.pulumi.azure.netapp.inputs.SnapshotPolicyMonthlyScheduleArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("East US")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleSnapshotPolicy = new SnapshotPolicy("exampleSnapshotPolicy", SnapshotPolicyArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.accountName(exampleAccount.name())
.enabled(true)
.hourlySchedule(SnapshotPolicyHourlyScheduleArgs.builder()
.snapshotsToKeep(4)
.minute(15)
.build())
.dailySchedule(SnapshotPolicyDailyScheduleArgs.builder()
.snapshotsToKeep(2)
.hour(20)
.minute(15)
.build())
.weeklySchedule(SnapshotPolicyWeeklyScheduleArgs.builder()
.snapshotsToKeep(1)
.daysOfWeeks(
"Monday",
"Friday")
.hour(23)
.minute(0)
.build())
.monthlySchedule(SnapshotPolicyMonthlyScheduleArgs.builder()
.snapshotsToKeep(1)
.daysOfMonths(
1,
15,
20,
30)
.hour(5)
.minute(45)
.build())
.build());
}
}
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: East US
exampleAccount:
type: azure:netapp:Account
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
exampleSnapshotPolicy:
type: azure:netapp:SnapshotPolicy
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
accountName: ${exampleAccount.name}
enabled: true
hourlySchedule:
snapshotsToKeep: 4
minute: 15
dailySchedule:
snapshotsToKeep: 2
hour: 20
minute: 15
weeklySchedule:
snapshotsToKeep: 1
daysOfWeeks:
- Monday
- Friday
hour: 23
minute: 0
monthlySchedule:
snapshotsToKeep: 1
daysOfMonths:
- 1
- 15
- 20
- 30
hour: 5
minute: 45

Import

NetApp Snapshot Policy can be imported using the resource id, e.g.

$ pulumi import azure:netapp/snapshotPolicy:SnapshotPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotpolicy1

Properties

Link copied to clipboard
val accountName: Output<String>

The name of the NetApp Account in which the NetApp Snapshot Policy should be created. Changing this forces a new resource to be created.

Link copied to clipboard

Sets a daily snapshot schedule. See details in below daily_schedule block.

Link copied to clipboard
val enabled: Output<Boolean>

Defines that the NetApp Snapshot Policy is enabled or not.

Link copied to clipboard

Sets an hourly snapshot schedule. See details in below hourly_schedule block.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard

Sets a monthly snapshot schedule. See details in below monthly_schedule block.

Link copied to clipboard
val name: Output<String>

The name of the NetApp Snapshot Policy. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group where the NetApp Snapshot Policy should be created. Changing this forces a new resource to be created.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

Sets a weekly snapshot schedule. See details in below weekly_schedule block.