1. Packages
  2. Azure Native v2
  3. API Docs
  4. sql
  5. GeoBackupPolicy
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.sql.GeoBackupPolicy

Explore with Pulumi AI

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,
    });

});
Copy
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
	})
}
Copy
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());

    }
}
Copy
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,
});
Copy
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)
Copy
resources:
  geoBackupPolicy:
    type: azure-native:sql:GeoBackupPolicy
    properties:
      databaseName: testdw
      geoBackupPolicyName: Default
      resourceGroupName: sqlcrudtest-4799
      serverName: sqlcrudtest-5961
      state: Enabled
Copy

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

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
This property is required.
Changes to this property will trigger replacement.
string
The name of the database.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
State This property is required. Pulumi.AzureNative.Sql.GeoBackupPolicyState
The state of the geo backup policy.
GeoBackupPolicyName Changes to this property will trigger replacement. string
The name of the Geo backup policy. This should always be 'Default'.
DatabaseName
This property is required.
Changes to this property will trigger replacement.
string
The name of the database.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
State This property is required. GeoBackupPolicyStateEnum
The state of the geo backup policy.
GeoBackupPolicyName Changes to this property will trigger replacement. string
The name of the Geo backup policy. This should always be 'Default'.
databaseName
This property is required.
Changes to this property will trigger replacement.
String
The name of the database.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
state This property is required. GeoBackupPolicyState
The state of the geo backup policy.
geoBackupPolicyName Changes to this property will trigger replacement. String
The name of the Geo backup policy. This should always be 'Default'.
databaseName
This property is required.
Changes to this property will trigger replacement.
string
The name of the database.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
state This property is required. GeoBackupPolicyState
The state of the geo backup policy.
geoBackupPolicyName Changes to this property will trigger replacement. string
The name of the Geo backup policy. This should always be 'Default'.
database_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the database.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
str
The name of the server.
state This property is required. GeoBackupPolicyState
The state of the geo backup policy.
geo_backup_policy_name Changes to this property will trigger replacement. str
The name of the Geo backup policy. This should always be 'Default'.
databaseName
This property is required.
Changes to this property will trigger replacement.
String
The name of the database.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
state This property is required. "Enabled" | "Disabled"
The state of the geo backup policy.
geoBackupPolicyName Changes to this property will trigger replacement. 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} 
Copy

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

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0