BackupLongTermRetentionPolicyArgs

data class BackupLongTermRetentionPolicyArgs(val databaseName: Output<String>? = null, val monthlyRetention: Output<String>? = null, val policyName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val serverName: Output<String>? = null, val weekOfYear: Output<Int>? = null, val weeklyRetention: Output<String>? = null, val yearlyRetention: Output<String>? = null) : ConvertibleToJava<BackupLongTermRetentionPolicyArgs>

A long term retention policy. Uses Azure REST API version 2017-03-01-preview. In version 2.x of the Azure Native provider, it used API version 2017-03-01-preview.

Example Usage

Create or update the long term retention policy for the database.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var backupLongTermRetentionPolicy = new AzureNative.Sql.BackupLongTermRetentionPolicy("backupLongTermRetentionPolicy", new()
{
DatabaseName = "testDatabase",
MonthlyRetention = "P1Y",
PolicyName = "default",
ResourceGroupName = "resourceGroup",
ServerName = "testserver",
WeekOfYear = 5,
WeeklyRetention = "P1M",
YearlyRetention = "P5Y",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewBackupLongTermRetentionPolicy(ctx, "backupLongTermRetentionPolicy", &sql.BackupLongTermRetentionPolicyArgs{
DatabaseName: pulumi.String("testDatabase"),
MonthlyRetention: pulumi.String("P1Y"),
PolicyName: pulumi.String("default"),
ResourceGroupName: pulumi.String("resourceGroup"),
ServerName: pulumi.String("testserver"),
WeekOfYear: pulumi.Int(5),
WeeklyRetention: pulumi.String("P1M"),
YearlyRetention: pulumi.String("P5Y"),
})
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.BackupLongTermRetentionPolicy;
import com.pulumi.azurenative.sql.BackupLongTermRetentionPolicyArgs;
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 backupLongTermRetentionPolicy = new BackupLongTermRetentionPolicy("backupLongTermRetentionPolicy", BackupLongTermRetentionPolicyArgs.builder()
.databaseName("testDatabase")
.monthlyRetention("P1Y")
.policyName("default")
.resourceGroupName("resourceGroup")
.serverName("testserver")
.weekOfYear(5)
.weeklyRetention("P1M")
.yearlyRetention("P5Y")
.build());
}
}

Import

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

$ pulumi import azure-native:sql:BackupLongTermRetentionPolicy default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}

Constructors

Link copied to clipboard
constructor(databaseName: Output<String>? = null, monthlyRetention: Output<String>? = null, policyName: Output<String>? = null, resourceGroupName: Output<String>? = null, serverName: Output<String>? = null, weekOfYear: Output<Int>? = null, weeklyRetention: Output<String>? = null, yearlyRetention: Output<String>? = null)

Properties

Link copied to clipboard
val databaseName: Output<String>? = null

The name of the database.

Link copied to clipboard
val monthlyRetention: Output<String>? = null

The monthly retention policy for an LTR backup in an ISO 8601 format.

Link copied to clipboard
val policyName: Output<String>? = null

The policy name. Should always be Default.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

Link copied to clipboard
val serverName: Output<String>? = null

The name of the server.

Link copied to clipboard
val weeklyRetention: Output<String>? = null

The weekly retention policy for an LTR backup in an ISO 8601 format.

Link copied to clipboard
val weekOfYear: Output<Int>? = null

The week of year to take the yearly backup in an ISO 8601 format.

Link copied to clipboard
val yearlyRetention: Output<String>? = null

The yearly retention policy for an LTR backup in an ISO 8601 format.

Functions

Link copied to clipboard
open override fun toJava(): BackupLongTermRetentionPolicyArgs