1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. GeoBackupPolicy
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi

azure-native.sql.GeoBackupPolicy

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi

    A Geo backup policy. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2014-04-01.

    Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview.

    Example Usage

    Create or update a database default Geo backup policy.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var geoBackupPolicy = new AzureNative.Sql.GeoBackupPolicy("geoBackupPolicy", new()
        {
            DatabaseName = "testdw",
            GeoBackupPolicyName = "Default",
            ResourceGroupName = "sqlcrudtest-4799",
            ServerName = "sqlcrudtest-5961",
            State = AzureNative.Sql.GeoBackupPolicyState.Enabled,
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewGeoBackupPolicy(ctx, "geoBackupPolicy", &sql.GeoBackupPolicyArgs{
    			DatabaseName:        pulumi.String("testdw"),
    			GeoBackupPolicyName: pulumi.String("Default"),
    			ResourceGroupName:   pulumi.String("sqlcrudtest-4799"),
    			ServerName:          pulumi.String("sqlcrudtest-5961"),
    			State:               sql.GeoBackupPolicyStateEnabled,
    		})
    		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.sql.GeoBackupPolicy;
    import com.pulumi.azurenative.sql.GeoBackupPolicyArgs;
    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 geoBackupPolicy = new GeoBackupPolicy("geoBackupPolicy", GeoBackupPolicyArgs.builder()
                .databaseName("testdw")
                .geoBackupPolicyName("Default")
                .resourceGroupName("sqlcrudtest-4799")
                .serverName("sqlcrudtest-5961")
                .state("Enabled")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    geo_backup_policy = azure_native.sql.GeoBackupPolicy("geoBackupPolicy",
        database_name="testdw",
        geo_backup_policy_name="Default",
        resource_group_name="sqlcrudtest-4799",
        server_name="sqlcrudtest-5961",
        state=azure_native.sql.GeoBackupPolicyState.ENABLED)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const geoBackupPolicy = new azure_native.sql.GeoBackupPolicy("geoBackupPolicy", {
        databaseName: "testdw",
        geoBackupPolicyName: "Default",
        resourceGroupName: "sqlcrudtest-4799",
        serverName: "sqlcrudtest-5961",
        state: azure_native.sql.GeoBackupPolicyState.Enabled,
    });
    
    resources:
      geoBackupPolicy:
        type: azure-native:sql:GeoBackupPolicy
        properties:
          databaseName: testdw
          geoBackupPolicyName: Default
          resourceGroupName: sqlcrudtest-4799
          serverName: sqlcrudtest-5961
          state: Enabled
    

    Create GeoBackupPolicy Resource

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

    Constructor syntax

    new GeoBackupPolicy(name: string, args: GeoBackupPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def GeoBackupPolicy(resource_name: str,
                        args: GeoBackupPolicyArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def GeoBackupPolicy(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        database_name: Optional[str] = None,
                        resource_group_name: Optional[str] = None,
                        server_name: Optional[str] = None,
                        state: Optional[GeoBackupPolicyState] = None,
                        geo_backup_policy_name: Optional[str] = None)
    func NewGeoBackupPolicy(ctx *Context, name string, args GeoBackupPolicyArgs, opts ...ResourceOption) (*GeoBackupPolicy, error)
    public GeoBackupPolicy(string name, GeoBackupPolicyArgs args, CustomResourceOptions? opts = null)
    public GeoBackupPolicy(String name, GeoBackupPolicyArgs args)
    public GeoBackupPolicy(String name, GeoBackupPolicyArgs args, CustomResourceOptions options)
    
    type: azure-native:sql:GeoBackupPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GeoBackupPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GeoBackupPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GeoBackupPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GeoBackupPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GeoBackupPolicyArgs
    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 geoBackupPolicyResource = new AzureNative.Sql.GeoBackupPolicy("geoBackupPolicyResource", new()
    {
        DatabaseName = "string",
        ResourceGroupName = "string",
        ServerName = "string",
        State = AzureNative.Sql.GeoBackupPolicyState.Enabled,
        GeoBackupPolicyName = "string",
    });
    
    example, err := sql.NewGeoBackupPolicy(ctx, "geoBackupPolicyResource", &sql.GeoBackupPolicyArgs{
    	DatabaseName:        pulumi.String("string"),
    	ResourceGroupName:   pulumi.String("string"),
    	ServerName:          pulumi.String("string"),
    	State:               sql.GeoBackupPolicyStateEnabled,
    	GeoBackupPolicyName: pulumi.String("string"),
    })
    
    var geoBackupPolicyResource = new GeoBackupPolicy("geoBackupPolicyResource", GeoBackupPolicyArgs.builder()
        .databaseName("string")
        .resourceGroupName("string")
        .serverName("string")
        .state("Enabled")
        .geoBackupPolicyName("string")
        .build());
    
    geo_backup_policy_resource = azure_native.sql.GeoBackupPolicy("geoBackupPolicyResource",
        database_name="string",
        resource_group_name="string",
        server_name="string",
        state=azure_native.sql.GeoBackupPolicyState.ENABLED,
        geo_backup_policy_name="string")
    
    const geoBackupPolicyResource = new azure_native.sql.GeoBackupPolicy("geoBackupPolicyResource", {
        databaseName: "string",
        resourceGroupName: "string",
        serverName: "string",
        state: azure_native.sql.GeoBackupPolicyState.Enabled,
        geoBackupPolicyName: "string",
    });
    
    type: azure-native:sql:GeoBackupPolicy
    properties:
        databaseName: string
        geoBackupPolicyName: string
        resourceGroupName: string
        serverName: string
        state: Enabled
    

    GeoBackupPolicy 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 GeoBackupPolicy resource accepts the following input properties:

    DatabaseName string
    The name of the database.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    State Pulumi.AzureNative.Sql.GeoBackupPolicyState
    The state of the geo backup policy.
    GeoBackupPolicyName string
    The name of the Geo backup policy. This should always be 'Default'.
    DatabaseName string
    The name of the database.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    State GeoBackupPolicyStateEnum
    The state of the geo backup policy.
    GeoBackupPolicyName string
    The name of the Geo backup policy. This should always be 'Default'.
    databaseName String
    The name of the database.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    state GeoBackupPolicyState
    The state of the geo backup policy.
    geoBackupPolicyName String
    The name of the Geo backup policy. This should always be 'Default'.
    databaseName string
    The name of the database.
    resourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName string
    The name of the server.
    state GeoBackupPolicyState
    The state of the geo backup policy.
    geoBackupPolicyName string
    The name of the Geo backup policy. This should always be 'Default'.
    database_name str
    The name of the database.
    resource_group_name str
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    server_name str
    The name of the server.
    state GeoBackupPolicyState
    The state of the geo backup policy.
    geo_backup_policy_name str
    The name of the Geo backup policy. This should always be 'Default'.
    databaseName String
    The name of the database.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    state "Enabled" | "Disabled"
    The state of the geo backup policy.
    geoBackupPolicyName String
    The name of the Geo backup policy. This should always be 'Default'.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    Kind of geo backup policy. This is metadata used for the Azure portal experience.
    Location string
    Backup policy location.
    Name string
    Resource name.
    StorageType string
    The storage type of the geo backup policy.
    Type string
    Resource type.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    Kind of geo backup policy. This is metadata used for the Azure portal experience.
    Location string
    Backup policy location.
    Name string
    Resource name.
    StorageType string
    The storage type of the geo backup policy.
    Type string
    Resource type.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    Kind of geo backup policy. This is metadata used for the Azure portal experience.
    location String
    Backup policy location.
    name String
    Resource name.
    storageType String
    The storage type of the geo backup policy.
    type String
    Resource type.
    id string
    The provider-assigned unique ID for this managed resource.
    kind string
    Kind of geo backup policy. This is metadata used for the Azure portal experience.
    location string
    Backup policy location.
    name string
    Resource name.
    storageType string
    The storage type of the geo backup policy.
    type string
    Resource type.
    id str
    The provider-assigned unique ID for this managed resource.
    kind str
    Kind of geo backup policy. This is metadata used for the Azure portal experience.
    location str
    Backup policy location.
    name str
    Resource name.
    storage_type str
    The storage type of the geo backup policy.
    type str
    Resource type.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    Kind of geo backup policy. This is metadata used for the Azure portal experience.
    location String
    Backup policy location.
    name String
    Resource name.
    storageType String
    The storage type of the geo backup policy.
    type String
    Resource type.

    Supporting Types

    GeoBackupPolicyState, GeoBackupPolicyStateArgs

    Enabled
    Enabled
    Disabled
    Disabled
    GeoBackupPolicyStateEnabled
    Enabled
    GeoBackupPolicyStateDisabled
    Disabled
    Enabled
    Enabled
    Disabled
    Disabled
    Enabled
    Enabled
    Disabled
    Disabled
    ENABLED
    Enabled
    DISABLED
    Disabled
    "Enabled"
    Enabled
    "Disabled"
    Disabled

    Import

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

    $ pulumi import azure-native:sql:GeoBackupPolicy Default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName} 
    

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

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi