Azure Native

v1.87.0 published on Tuesday, Nov 22, 2022 by Pulumi

BackupShortTermRetentionPolicy

A short term retention policy. API Version: 2020-11-01-preview.

Example Usage

Update the short term retention policy for the database.

using System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var backupShortTermRetentionPolicy = new AzureNative.Sql.BackupShortTermRetentionPolicy("backupShortTermRetentionPolicy", new()
    {
        DatabaseName = "testdb",
        PolicyName = "default",
        ResourceGroupName = "resourceGroup",
        RetentionDays = 14,
        ServerName = "testsvr",
    });

});
package main

import (
	sql "github.com/pulumi/pulumi-azure-native/sdk/go/azure/sql"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sql.NewBackupShortTermRetentionPolicy(ctx, "backupShortTermRetentionPolicy", &sql.BackupShortTermRetentionPolicyArgs{
			DatabaseName:      pulumi.String("testdb"),
			PolicyName:        pulumi.String("default"),
			ResourceGroupName: pulumi.String("resourceGroup"),
			RetentionDays:     pulumi.Int(14),
			ServerName:        pulumi.String("testsvr"),
		})
		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.BackupShortTermRetentionPolicy;
import com.pulumi.azurenative.sql.BackupShortTermRetentionPolicyArgs;
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 backupShortTermRetentionPolicy = new BackupShortTermRetentionPolicy("backupShortTermRetentionPolicy", BackupShortTermRetentionPolicyArgs.builder()        
            .databaseName("testdb")
            .policyName("default")
            .resourceGroupName("resourceGroup")
            .retentionDays(14)
            .serverName("testsvr")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

backup_short_term_retention_policy = azure_native.sql.BackupShortTermRetentionPolicy("backupShortTermRetentionPolicy",
    database_name="testdb",
    policy_name="default",
    resource_group_name="resourceGroup",
    retention_days=14,
    server_name="testsvr")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const backupShortTermRetentionPolicy = new azure_native.sql.BackupShortTermRetentionPolicy("backupShortTermRetentionPolicy", {
    databaseName: "testdb",
    policyName: "default",
    resourceGroupName: "resourceGroup",
    retentionDays: 14,
    serverName: "testsvr",
});
resources:
  backupShortTermRetentionPolicy:
    type: azure-native:sql:BackupShortTermRetentionPolicy
    properties:
      databaseName: testdb
      policyName: default
      resourceGroupName: resourceGroup
      retentionDays: 14
      serverName: testsvr

Create BackupShortTermRetentionPolicy Resource

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

name string
The unique name of the resource.
args BackupShortTermRetentionPolicyArgs
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 BackupShortTermRetentionPolicyArgs
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 BackupShortTermRetentionPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BackupShortTermRetentionPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BackupShortTermRetentionPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

BackupShortTermRetentionPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The BackupShortTermRetentionPolicy 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.

PolicyName string

The policy name. Should always be "default".

RetentionDays int

The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

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.

PolicyName string

The policy name. Should always be "default".

RetentionDays int

The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

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.

policyName String

The policy name. Should always be "default".

retentionDays Integer

The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

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.

policyName string

The policy name. Should always be "default".

retentionDays number

The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

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.

policy_name str

The policy name. Should always be "default".

retention_days int

The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

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.

policyName String

The policy name. Should always be "default".

retentionDays Number

The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type.

id string

The provider-assigned unique ID for this managed resource.

name string

Resource name.

type string

Resource type.

id str

The provider-assigned unique ID for this managed resource.

name str

Resource name.

type str

Resource type.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type.

Import

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

$ pulumi import azure-native:sql:BackupShortTermRetentionPolicy default /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testsvr/databases/testdb/backupShortTermRetentionPolicies/default 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0