SnapshotPolicy

class SnapshotPolicy : KotlinCustomResource

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

Example Usage

SnapshotPolicies_Create

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var snapshotPolicy = new AzureNative.NetApp.SnapshotPolicy("snapshotPolicy", new()
{
AccountName = "account1",
DailySchedule = new AzureNative.NetApp.Inputs.DailyScheduleArgs
{
Hour = 14,
Minute = 30,
SnapshotsToKeep = 4,
},
HourlySchedule = new AzureNative.NetApp.Inputs.HourlyScheduleArgs
{
Minute = 50,
SnapshotsToKeep = 2,
},
Location = "eastus",
MonthlySchedule = new AzureNative.NetApp.Inputs.MonthlyScheduleArgs
{
DaysOfMonth = "10,11,12",
Hour = 14,
Minute = 15,
SnapshotsToKeep = 5,
},
ResourceGroupName = "myRG",
SnapshotPolicyName = "snapshotPolicyName",
WeeklySchedule = new AzureNative.NetApp.Inputs.WeeklyScheduleArgs
{
Day = "Wednesday",
Hour = 14,
Minute = 45,
SnapshotsToKeep = 3,
},
});
});
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.NewSnapshotPolicy(ctx, "snapshotPolicy", &netapp.SnapshotPolicyArgs{
AccountName: pulumi.String("account1"),
DailySchedule: &netapp.DailyScheduleArgs{
Hour: pulumi.Int(14),
Minute: pulumi.Int(30),
SnapshotsToKeep: pulumi.Int(4),
},
HourlySchedule: &netapp.HourlyScheduleArgs{
Minute: pulumi.Int(50),
SnapshotsToKeep: pulumi.Int(2),
},
Location: pulumi.String("eastus"),
MonthlySchedule: &netapp.MonthlyScheduleArgs{
DaysOfMonth: pulumi.String("10,11,12"),
Hour: pulumi.Int(14),
Minute: pulumi.Int(15),
SnapshotsToKeep: pulumi.Int(5),
},
ResourceGroupName: pulumi.String("myRG"),
SnapshotPolicyName: pulumi.String("snapshotPolicyName"),
WeeklySchedule: &netapp.WeeklyScheduleArgs{
Day: pulumi.String("Wednesday"),
Hour: pulumi.Int(14),
Minute: pulumi.Int(45),
SnapshotsToKeep: pulumi.Int(3),
},
})
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.azurenative.netapp.SnapshotPolicy;
import com.pulumi.azurenative.netapp.SnapshotPolicyArgs;
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 snapshotPolicy = new SnapshotPolicy("snapshotPolicy", SnapshotPolicyArgs.builder()
.accountName("account1")
.dailySchedule(Map.ofEntries(
Map.entry("hour", 14),
Map.entry("minute", 30),
Map.entry("snapshotsToKeep", 4)
))
.hourlySchedule(Map.ofEntries(
Map.entry("minute", 50),
Map.entry("snapshotsToKeep", 2)
))
.location("eastus")
.monthlySchedule(Map.ofEntries(
Map.entry("daysOfMonth", "10,11,12"),
Map.entry("hour", 14),
Map.entry("minute", 15),
Map.entry("snapshotsToKeep", 5)
))
.resourceGroupName("myRG")
.snapshotPolicyName("snapshotPolicyName")
.weeklySchedule(Map.ofEntries(
Map.entry("day", "Wednesday"),
Map.entry("hour", 14),
Map.entry("minute", 45),
Map.entry("snapshotsToKeep", 3)
))
.build());
}
}

Import

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

$ pulumi import azure-native:netapp:SnapshotPolicy account1/snapshotPolicy1 /subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1

Properties

Link copied to clipboard

Schedule for daily snapshots

Link copied to clipboard
val enabled: Output<Boolean>?

The property to decide policy is enabled or not

Link copied to clipboard

Schedule for hourly snapshots

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

Resource location

Link copied to clipboard

Schedule for monthly snapshots

Link copied to clipboard
val name: Output<String>

Resource name

Link copied to clipboard

Azure lifecycle management

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

Resource tags

Link copied to clipboard
val type: Output<String>

Resource type

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

Schedule for weekly snapshots