1. Packages
  2. Azure Classic
  3. API Docs
  4. netapp
  5. getBackupPolicy

We recommend using Azure Native.

Azure v6.11.0 published on Monday, Nov 25, 2024 by Pulumi

azure.netapp.getBackupPolicy

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.11.0 published on Monday, Nov 25, 2024 by Pulumi

    Use this data source to access information about an existing NetApp Backup Vault.

    NetApp Backup Policy Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.netapp.getBackupPolicy({
        resourceGroupName: "example-resource-group",
        accountName: "example-netappaccount",
        name: "example-backuppolicy",
    });
    export const backupPolicyId = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.netapp.get_backup_policy(resource_group_name="example-resource-group",
        account_name="example-netappaccount",
        name="example-backuppolicy")
    pulumi.export("backupPolicyId", example.id)
    
    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.LookupBackupPolicy(ctx, &netapp.LookupBackupPolicyArgs{
    			ResourceGroupName: "example-resource-group",
    			AccountName:       "example-netappaccount",
    			Name:              "example-backuppolicy",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("backupPolicyId", example.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.NetApp.GetBackupPolicy.Invoke(new()
        {
            ResourceGroupName = "example-resource-group",
            AccountName = "example-netappaccount",
            Name = "example-backuppolicy",
        });
    
        return new Dictionary<string, object?>
        {
            ["backupPolicyId"] = example.Apply(getBackupPolicyResult => getBackupPolicyResult.Id),
        };
    });
    
    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.GetBackupPolicyArgs;
    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.getBackupPolicy(GetBackupPolicyArgs.builder()
                .resourceGroupName("example-resource-group")
                .accountName("example-netappaccount")
                .name("example-backuppolicy")
                .build());
    
            ctx.export("backupPolicyId", example.applyValue(getBackupPolicyResult -> getBackupPolicyResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:netapp:getBackupPolicy
          Arguments:
            resourceGroupName: example-resource-group
            accountName: example-netappaccount
            name: example-backuppolicy
    outputs:
      backupPolicyId: ${example.id}
    

    Using getBackupPolicy

    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 getBackupPolicy(args: GetBackupPolicyArgs, opts?: InvokeOptions): Promise<GetBackupPolicyResult>
    function getBackupPolicyOutput(args: GetBackupPolicyOutputArgs, opts?: InvokeOptions): Output<GetBackupPolicyResult>
    def get_backup_policy(account_name: Optional[str] = None,
                          name: Optional[str] = None,
                          resource_group_name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetBackupPolicyResult
    def get_backup_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[GetBackupPolicyResult]
    func LookupBackupPolicy(ctx *Context, args *LookupBackupPolicyArgs, opts ...InvokeOption) (*LookupBackupPolicyResult, error)
    func LookupBackupPolicyOutput(ctx *Context, args *LookupBackupPolicyOutputArgs, opts ...InvokeOption) LookupBackupPolicyResultOutput

    > Note: This function is named LookupBackupPolicy in the Go SDK.

    public static class GetBackupPolicy 
    {
        public static Task<GetBackupPolicyResult> InvokeAsync(GetBackupPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetBackupPolicyResult> Invoke(GetBackupPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBackupPolicyResult> getBackupPolicy(GetBackupPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:netapp/getBackupPolicy:getBackupPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountName string
    The name of the NetApp Account in which the NetApp Policy exists.
    Name string
    The name of the NetApp Backup Policy.
    ResourceGroupName string
    The name of the resource group where the NetApp Backup Policy exists.
    AccountName string
    The name of the NetApp Account in which the NetApp Policy exists.
    Name string
    The name of the NetApp Backup Policy.
    ResourceGroupName string
    The name of the resource group where the NetApp Backup Policy exists.
    accountName String
    The name of the NetApp Account in which the NetApp Policy exists.
    name String
    The name of the NetApp Backup Policy.
    resourceGroupName String
    The name of the resource group where the NetApp Backup Policy exists.
    accountName string
    The name of the NetApp Account in which the NetApp Policy exists.
    name string
    The name of the NetApp Backup Policy.
    resourceGroupName string
    The name of the resource group where the NetApp Backup Policy exists.
    account_name str
    The name of the NetApp Account in which the NetApp Policy exists.
    name str
    The name of the NetApp Backup Policy.
    resource_group_name str
    The name of the resource group where the NetApp Backup Policy exists.
    accountName String
    The name of the NetApp Account in which the NetApp Policy exists.
    name String
    The name of the NetApp Backup Policy.
    resourceGroupName String
    The name of the resource group where the NetApp Backup Policy exists.

    getBackupPolicy Result

    The following output properties are available:

    AccountName string
    The name of the NetApp account in which the NetApp Policy exists.
    DailyBackupsToKeep int
    The number of daily backups to keep.
    Enabled bool
    Whether the Backup Policy is enabled.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    NetApp Backup Policy location.
    MonthlyBackupsToKeep int
    The number of monthly backups to keep.
    Name string
    ResourceGroupName string
    Tags Dictionary<string, string>
    List of tags assigned to the resource.
    WeeklyBackupsToKeep int
    The number of weekly backups to keep.
    AccountName string
    The name of the NetApp account in which the NetApp Policy exists.
    DailyBackupsToKeep int
    The number of daily backups to keep.
    Enabled bool
    Whether the Backup Policy is enabled.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    NetApp Backup Policy location.
    MonthlyBackupsToKeep int
    The number of monthly backups to keep.
    Name string
    ResourceGroupName string
    Tags map[string]string
    List of tags assigned to the resource.
    WeeklyBackupsToKeep int
    The number of weekly backups to keep.
    accountName String
    The name of the NetApp account in which the NetApp Policy exists.
    dailyBackupsToKeep Integer
    The number of daily backups to keep.
    enabled Boolean
    Whether the Backup Policy is enabled.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    NetApp Backup Policy location.
    monthlyBackupsToKeep Integer
    The number of monthly backups to keep.
    name String
    resourceGroupName String
    tags Map<String,String>
    List of tags assigned to the resource.
    weeklyBackupsToKeep Integer
    The number of weekly backups to keep.
    accountName string
    The name of the NetApp account in which the NetApp Policy exists.
    dailyBackupsToKeep number
    The number of daily backups to keep.
    enabled boolean
    Whether the Backup Policy is enabled.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    NetApp Backup Policy location.
    monthlyBackupsToKeep number
    The number of monthly backups to keep.
    name string
    resourceGroupName string
    tags {[key: string]: string}
    List of tags assigned to the resource.
    weeklyBackupsToKeep number
    The number of weekly backups to keep.
    account_name str
    The name of the NetApp account in which the NetApp Policy exists.
    daily_backups_to_keep int
    The number of daily backups to keep.
    enabled bool
    Whether the Backup Policy is enabled.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    NetApp Backup Policy location.
    monthly_backups_to_keep int
    The number of monthly backups to keep.
    name str
    resource_group_name str
    tags Mapping[str, str]
    List of tags assigned to the resource.
    weekly_backups_to_keep int
    The number of weekly backups to keep.
    accountName String
    The name of the NetApp account in which the NetApp Policy exists.
    dailyBackupsToKeep Number
    The number of daily backups to keep.
    enabled Boolean
    Whether the Backup Policy is enabled.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    NetApp Backup Policy location.
    monthlyBackupsToKeep Number
    The number of monthly backups to keep.
    name String
    resourceGroupName String
    tags Map<String>
    List of tags assigned to the resource.
    weeklyBackupsToKeep Number
    The number of weekly backups to keep.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.11.0 published on Monday, Nov 25, 2024 by Pulumi