We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.netapp.getSnapshotPolicy
Explore with Pulumi AI
Uses this data source to access information about an existing NetApp Snapshot Policy.
NetApp Snapshot Policy Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.netapp.getSnapshotPolicy({
    resourceGroupName: "acctestRG",
    accountName: "acctestnetappaccount",
    name: "example-snapshot-policy",
});
export const id = example.then(example => example.id);
export const name = example.then(example => example.name);
export const enabled = example.then(example => example.enabled);
export const hourlySchedule = example.then(example => example.hourlySchedules);
export const dailySchedule = example.then(example => example.dailySchedules);
export const weeklySchedule = example.then(example => example.weeklySchedules);
export const monthlySchedule = example.then(example => example.monthlySchedules);
import pulumi
import pulumi_azure as azure
example = azure.netapp.get_snapshot_policy(resource_group_name="acctestRG",
    account_name="acctestnetappaccount",
    name="example-snapshot-policy")
pulumi.export("id", example.id)
pulumi.export("name", example.name)
pulumi.export("enabled", example.enabled)
pulumi.export("hourlySchedule", example.hourly_schedules)
pulumi.export("dailySchedule", example.daily_schedules)
pulumi.export("weeklySchedule", example.weekly_schedules)
pulumi.export("monthlySchedule", example.monthly_schedules)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/netapp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := netapp.LookupSnapshotPolicy(ctx, &netapp.LookupSnapshotPolicyArgs{
			ResourceGroupName: "acctestRG",
			AccountName:       "acctestnetappaccount",
			Name:              "example-snapshot-policy",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		ctx.Export("name", example.Name)
		ctx.Export("enabled", example.Enabled)
		ctx.Export("hourlySchedule", example.HourlySchedules)
		ctx.Export("dailySchedule", example.DailySchedules)
		ctx.Export("weeklySchedule", example.WeeklySchedules)
		ctx.Export("monthlySchedule", example.MonthlySchedules)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.NetApp.GetSnapshotPolicy.Invoke(new()
    {
        ResourceGroupName = "acctestRG",
        AccountName = "acctestnetappaccount",
        Name = "example-snapshot-policy",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Id),
        ["name"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Name),
        ["enabled"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Enabled),
        ["hourlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.HourlySchedules),
        ["dailySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.DailySchedules),
        ["weeklySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.WeeklySchedules),
        ["monthlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.MonthlySchedules),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.netapp.NetappFunctions;
import com.pulumi.azure.netapp.inputs.GetSnapshotPolicyArgs;
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) {
        final var example = NetappFunctions.getSnapshotPolicy(GetSnapshotPolicyArgs.builder()
            .resourceGroupName("acctestRG")
            .accountName("acctestnetappaccount")
            .name("example-snapshot-policy")
            .build());
        ctx.export("id", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.id()));
        ctx.export("name", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.name()));
        ctx.export("enabled", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.enabled()));
        ctx.export("hourlySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.hourlySchedules()));
        ctx.export("dailySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.dailySchedules()));
        ctx.export("weeklySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.weeklySchedules()));
        ctx.export("monthlySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.monthlySchedules()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:netapp:getSnapshotPolicy
      arguments:
        resourceGroupName: acctestRG
        accountName: acctestnetappaccount
        name: example-snapshot-policy
outputs:
  id: ${example.id}
  name: ${example.name}
  enabled: ${example.enabled}
  hourlySchedule: ${example.hourlySchedules}
  dailySchedule: ${example.dailySchedules}
  weeklySchedule: ${example.weeklySchedules}
  monthlySchedule: ${example.monthlySchedules}
Using getSnapshotPolicy
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSnapshotPolicy(args: GetSnapshotPolicyArgs, opts?: InvokeOptions): Promise<GetSnapshotPolicyResult>
function getSnapshotPolicyOutput(args: GetSnapshotPolicyOutputArgs, opts?: InvokeOptions): Output<GetSnapshotPolicyResult>def get_snapshot_policy(account_name: Optional[str] = None,
                        name: Optional[str] = None,
                        resource_group_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetSnapshotPolicyResult
def get_snapshot_policy_output(account_name: Optional[pulumi.Input[str]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        resource_group_name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotPolicyResult]func LookupSnapshotPolicy(ctx *Context, args *LookupSnapshotPolicyArgs, opts ...InvokeOption) (*LookupSnapshotPolicyResult, error)
func LookupSnapshotPolicyOutput(ctx *Context, args *LookupSnapshotPolicyOutputArgs, opts ...InvokeOption) LookupSnapshotPolicyResultOutput> Note: This function is named LookupSnapshotPolicy in the Go SDK.
public static class GetSnapshotPolicy 
{
    public static Task<GetSnapshotPolicyResult> InvokeAsync(GetSnapshotPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetSnapshotPolicyResult> Invoke(GetSnapshotPolicyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSnapshotPolicyResult> getSnapshotPolicy(GetSnapshotPolicyArgs args, InvokeOptions options)
public static Output<GetSnapshotPolicyResult> getSnapshotPolicy(GetSnapshotPolicyArgs args, InvokeOptions options)
fn::invoke:
  function: azure:netapp/getSnapshotPolicy:getSnapshotPolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AccountName string
- The name of the NetApp account where the NetApp Snapshot Policy exists.
- Name string
- The name of the NetApp Snapshot Policy.
- ResourceGroup stringName 
- The Name of the Resource Group where the NetApp Snapshot Policy exists.
- AccountName string
- The name of the NetApp account where the NetApp Snapshot Policy exists.
- Name string
- The name of the NetApp Snapshot Policy.
- ResourceGroup stringName 
- The Name of the Resource Group where the NetApp Snapshot Policy exists.
- accountName String
- The name of the NetApp account where the NetApp Snapshot Policy exists.
- name String
- The name of the NetApp Snapshot Policy.
- resourceGroup StringName 
- The Name of the Resource Group where the NetApp Snapshot Policy exists.
- accountName string
- The name of the NetApp account where the NetApp Snapshot Policy exists.
- name string
- The name of the NetApp Snapshot Policy.
- resourceGroup stringName 
- The Name of the Resource Group where the NetApp Snapshot Policy exists.
- account_name str
- The name of the NetApp account where the NetApp Snapshot Policy exists.
- name str
- The name of the NetApp Snapshot Policy.
- resource_group_ strname 
- The Name of the Resource Group where the NetApp Snapshot Policy exists.
- accountName String
- The name of the NetApp account where the NetApp Snapshot Policy exists.
- name String
- The name of the NetApp Snapshot Policy.
- resourceGroup StringName 
- The Name of the Resource Group where the NetApp Snapshot Policy exists.
getSnapshotPolicy Result
The following output properties are available:
- AccountName string
- The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- DailySchedules List<GetSnapshot Policy Daily Schedule> 
- Daily snapshot schedule.
- Enabled bool
- Defines that the NetApp Snapshot Policy is enabled or not.
- HourlySchedules List<GetSnapshot Policy Hourly Schedule> 
- Hourly snapshot schedule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Specifies the supported Azure location where the resource exists.
- MonthlySchedules List<GetSnapshot Policy Monthly Schedule> 
- List of the days of the month when the snapshots will be created.
- Name string
- The name of the NetApp Snapshot Policy.
- ResourceGroup stringName 
- The name of the resource group where the NetApp Snapshot Policy should be created.
- Dictionary<string, string>
- WeeklySchedules List<GetSnapshot Policy Weekly Schedule> 
- Weekly snapshot schedule.
- AccountName string
- The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- DailySchedules []GetSnapshot Policy Daily Schedule 
- Daily snapshot schedule.
- Enabled bool
- Defines that the NetApp Snapshot Policy is enabled or not.
- HourlySchedules []GetSnapshot Policy Hourly Schedule 
- Hourly snapshot schedule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Specifies the supported Azure location where the resource exists.
- MonthlySchedules []GetSnapshot Policy Monthly Schedule 
- List of the days of the month when the snapshots will be created.
- Name string
- The name of the NetApp Snapshot Policy.
- ResourceGroup stringName 
- The name of the resource group where the NetApp Snapshot Policy should be created.
- map[string]string
- WeeklySchedules []GetSnapshot Policy Weekly Schedule 
- Weekly snapshot schedule.
- accountName String
- The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- dailySchedules List<GetSnapshot Policy Daily Schedule> 
- Daily snapshot schedule.
- enabled Boolean
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourlySchedules List<GetSnapshot Policy Hourly Schedule> 
- Hourly snapshot schedule.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- Specifies the supported Azure location where the resource exists.
- monthlySchedules List<GetSnapshot Policy Monthly Schedule> 
- List of the days of the month when the snapshots will be created.
- name String
- The name of the NetApp Snapshot Policy.
- resourceGroup StringName 
- The name of the resource group where the NetApp Snapshot Policy should be created.
- Map<String,String>
- weeklySchedules List<GetSnapshot Policy Weekly Schedule> 
- Weekly snapshot schedule.
- accountName string
- The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- dailySchedules GetSnapshot Policy Daily Schedule[] 
- Daily snapshot schedule.
- enabled boolean
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourlySchedules GetSnapshot Policy Hourly Schedule[] 
- Hourly snapshot schedule.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- Specifies the supported Azure location where the resource exists.
- monthlySchedules GetSnapshot Policy Monthly Schedule[] 
- List of the days of the month when the snapshots will be created.
- name string
- The name of the NetApp Snapshot Policy.
- resourceGroup stringName 
- The name of the resource group where the NetApp Snapshot Policy should be created.
- {[key: string]: string}
- weeklySchedules GetSnapshot Policy Weekly Schedule[] 
- Weekly snapshot schedule.
- account_name str
- The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- daily_schedules Sequence[GetSnapshot Policy Daily Schedule] 
- Daily snapshot schedule.
- enabled bool
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourly_schedules Sequence[GetSnapshot Policy Hourly Schedule] 
- Hourly snapshot schedule.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- Specifies the supported Azure location where the resource exists.
- monthly_schedules Sequence[GetSnapshot Policy Monthly Schedule] 
- List of the days of the month when the snapshots will be created.
- name str
- The name of the NetApp Snapshot Policy.
- resource_group_ strname 
- The name of the resource group where the NetApp Snapshot Policy should be created.
- Mapping[str, str]
- weekly_schedules Sequence[GetSnapshot Policy Weekly Schedule] 
- Weekly snapshot schedule.
- accountName String
- The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- dailySchedules List<Property Map>
- Daily snapshot schedule.
- enabled Boolean
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourlySchedules List<Property Map>
- Hourly snapshot schedule.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- Specifies the supported Azure location where the resource exists.
- monthlySchedules List<Property Map>
- List of the days of the month when the snapshots will be created.
- name String
- The name of the NetApp Snapshot Policy.
- resourceGroup StringName 
- The name of the resource group where the NetApp Snapshot Policy should be created.
- Map<String>
- weeklySchedules List<Property Map>
- Weekly snapshot schedule.
Supporting Types
GetSnapshotPolicyDailySchedule    
- Hour int
- Hour of the day that the snapshots will be created.
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- Hour int
- Hour of the day that the snapshots will be created.
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- hour Integer
- Hour of the day that the snapshots will be created.
- minute Integer
- Minute of the hour that the snapshots will be created.
- snapshotsTo IntegerKeep 
- How many hourly snapshots to keep.
- hour number
- Hour of the day that the snapshots will be created.
- minute number
- Minute of the hour that the snapshots will be created.
- snapshotsTo numberKeep 
- How many hourly snapshots to keep.
- hour int
- Hour of the day that the snapshots will be created.
- minute int
- Minute of the hour that the snapshots will be created.
- snapshots_to_ intkeep 
- How many hourly snapshots to keep.
- hour Number
- Hour of the day that the snapshots will be created.
- minute Number
- Minute of the hour that the snapshots will be created.
- snapshotsTo NumberKeep 
- How many hourly snapshots to keep.
GetSnapshotPolicyHourlySchedule    
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- minute Integer
- Minute of the hour that the snapshots will be created.
- snapshotsTo IntegerKeep 
- How many hourly snapshots to keep.
- minute number
- Minute of the hour that the snapshots will be created.
- snapshotsTo numberKeep 
- How many hourly snapshots to keep.
- minute int
- Minute of the hour that the snapshots will be created.
- snapshots_to_ intkeep 
- How many hourly snapshots to keep.
- minute Number
- Minute of the hour that the snapshots will be created.
- snapshotsTo NumberKeep 
- How many hourly snapshots to keep.
GetSnapshotPolicyMonthlySchedule    
- DaysOf List<int>Months 
- Hour int
- Hour of the day that the snapshots will be created.
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- DaysOf []intMonths 
- Hour int
- Hour of the day that the snapshots will be created.
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- daysOf List<Integer>Months 
- hour Integer
- Hour of the day that the snapshots will be created.
- minute Integer
- Minute of the hour that the snapshots will be created.
- snapshotsTo IntegerKeep 
- How many hourly snapshots to keep.
- daysOf number[]Months 
- hour number
- Hour of the day that the snapshots will be created.
- minute number
- Minute of the hour that the snapshots will be created.
- snapshotsTo numberKeep 
- How many hourly snapshots to keep.
- days_of_ Sequence[int]months 
- hour int
- Hour of the day that the snapshots will be created.
- minute int
- Minute of the hour that the snapshots will be created.
- snapshots_to_ intkeep 
- How many hourly snapshots to keep.
- daysOf List<Number>Months 
- hour Number
- Hour of the day that the snapshots will be created.
- minute Number
- Minute of the hour that the snapshots will be created.
- snapshotsTo NumberKeep 
- How many hourly snapshots to keep.
GetSnapshotPolicyWeeklySchedule    
- DaysOf List<string>Weeks 
- List of the week days using English names when the snapshots will be created.
- Hour int
- Hour of the day that the snapshots will be created.
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- DaysOf []stringWeeks 
- List of the week days using English names when the snapshots will be created.
- Hour int
- Hour of the day that the snapshots will be created.
- Minute int
- Minute of the hour that the snapshots will be created.
- SnapshotsTo intKeep 
- How many hourly snapshots to keep.
- daysOf List<String>Weeks 
- List of the week days using English names when the snapshots will be created.
- hour Integer
- Hour of the day that the snapshots will be created.
- minute Integer
- Minute of the hour that the snapshots will be created.
- snapshotsTo IntegerKeep 
- How many hourly snapshots to keep.
- daysOf string[]Weeks 
- List of the week days using English names when the snapshots will be created.
- hour number
- Hour of the day that the snapshots will be created.
- minute number
- Minute of the hour that the snapshots will be created.
- snapshotsTo numberKeep 
- How many hourly snapshots to keep.
- days_of_ Sequence[str]weeks 
- List of the week days using English names when the snapshots will be created.
- hour int
- Hour of the day that the snapshots will be created.
- minute int
- Minute of the hour that the snapshots will be created.
- snapshots_to_ intkeep 
- How many hourly snapshots to keep.
- daysOf List<String>Weeks 
- List of the week days using English names when the snapshots will be created.
- hour Number
- Hour of the day that the snapshots will be created.
- minute Number
- Minute of the hour that the snapshots will be created.
- snapshotsTo NumberKeep 
- How many hourly snapshots to keep.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.