BackupLongTermRetentionPolicy

class BackupLongTermRetentionPolicy : KotlinCustomResource

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/v2"
"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}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

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

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

Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val type: Output<String>

Resource type.

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

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

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

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

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

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