Backup Policy Args
data class BackupPolicyArgs(val backupPolicyName: Output<String>? = null, val properties: Output<BackupPolicyArgs>? = null, val resourceGroupName: Output<String>? = null, val vaultName: Output<String>? = null) : ConvertibleToJava<BackupPolicyArgs>
BaseBackupPolicy resource API Version: 2021-01-01.
Example Usage
CreateOrUpdate BackupPolicy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var backupPolicy = new AzureNative.DataProtection.BackupPolicy("backupPolicy", new()
{
BackupPolicyName = "OSSDBPolicy",
Properties = new AzureNative.DataProtection.Inputs.BackupPolicyArgs
{
DatasourceTypes = new[]
{
"OssDB",
},
ObjectType = "BackupPolicy",
PolicyRules =
{
new AzureNative.DataProtection.Inputs.AzureBackupRuleArgs
{
BackupParameters = new AzureNative.DataProtection.Inputs.AzureBackupParamsArgs
{
BackupType = "Full",
ObjectType = "AzureBackupParams",
},
DataStore = new AzureNative.DataProtection.Inputs.DataStoreInfoBaseArgs
{
DataStoreType = "VaultStore",
ObjectType = "DataStoreInfoBase",
},
Name = "BackupWeekly",
ObjectType = "AzureBackupRule",
Trigger = new AzureNative.DataProtection.Inputs.ScheduleBasedTriggerContextArgs
{
ObjectType = "ScheduleBasedTriggerContext",
Schedule = new AzureNative.DataProtection.Inputs.BackupScheduleArgs
{
RepeatingTimeIntervals = new[]
{
"R/2019-11-20T08:00:00-08:00/P1W",
},
},
TaggingCriteria = new[]
{
new AzureNative.DataProtection.Inputs.TaggingCriteriaArgs
{
IsDefault = true,
TagInfo = new AzureNative.DataProtection.Inputs.RetentionTagArgs
{
TagName = "Default",
},
TaggingPriority = 99,
},
new AzureNative.DataProtection.Inputs.TaggingCriteriaArgs
{
Criteria = new[]
{
new AzureNative.DataProtection.Inputs.ScheduleBasedBackupCriteriaArgs
{
DaysOfTheWeek = new[]
{
"Sunday",
},
ObjectType = "ScheduleBasedBackupCriteria",
ScheduleTimes = new[]
{
"2019-03-01T13:00:00Z",
},
},
},
IsDefault = false,
TagInfo = new AzureNative.DataProtection.Inputs.RetentionTagArgs
{
TagName = "Weekly",
},
TaggingPriority = 20,
},
},
},
},
new AzureNative.DataProtection.Inputs.AzureRetentionRuleArgs
{
IsDefault = true,
Lifecycles = new[]
{
new AzureNative.DataProtection.Inputs.SourceLifeCycleArgs
{
DeleteAfter = new AzureNative.DataProtection.Inputs.AbsoluteDeleteOptionArgs
{
Duration = "P1W",
ObjectType = "AbsoluteDeleteOption",
},
SourceDataStore = new AzureNative.DataProtection.Inputs.DataStoreInfoBaseArgs
{
DataStoreType = "VaultStore",
ObjectType = "DataStoreInfoBase",
},
},
},
Name = "Default",
ObjectType = "AzureRetentionRule",
},
new AzureNative.DataProtection.Inputs.AzureRetentionRuleArgs
{
IsDefault = false,
Lifecycles = new[]
{
new AzureNative.DataProtection.Inputs.SourceLifeCycleArgs
{
DeleteAfter = new AzureNative.DataProtection.Inputs.AbsoluteDeleteOptionArgs
{
Duration = "P12W",
ObjectType = "AbsoluteDeleteOption",
},
SourceDataStore = new AzureNative.DataProtection.Inputs.DataStoreInfoBaseArgs
{
DataStoreType = "VaultStore",
ObjectType = "DataStoreInfoBase",
},
},
},
Name = "Weekly",
ObjectType = "AzureRetentionRule",
},
},
},
ResourceGroupName = "000pikumar",
VaultName = "PrivatePreviewVault",
});
});
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dataprotection.BackupPolicy;
import com.pulumi.azurenative.dataprotection.BackupPolicyArgs;
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 backupPolicy = new BackupPolicy("backupPolicy", BackupPolicyArgs.builder()
.backupPolicyName("OSSDBPolicy")
.properties(Map.ofEntries(
Map.entry("datasourceTypes", "OssDB"),
Map.entry("objectType", "BackupPolicy"),
Map.entry("policyRules",
Map.ofEntries(
Map.entry("backupParameters", Map.ofEntries(
Map.entry("backupType", "Full"),
Map.entry("objectType", "AzureBackupParams")
)),
Map.entry("dataStore", Map.ofEntries(
Map.entry("dataStoreType", "VaultStore"),
Map.entry("objectType", "DataStoreInfoBase")
)),
Map.entry("name", "BackupWeekly"),
Map.entry("objectType", "AzureBackupRule"),
Map.entry("trigger", Map.ofEntries(
Map.entry("objectType", "ScheduleBasedTriggerContext"),
Map.entry("schedule", Map.of("repeatingTimeIntervals", "R/2019-11-20T08:00:00-08:00/P1W")),
Map.entry("taggingCriteria",
Map.ofEntries(
Map.entry("isDefault", true),
Map.entry("tagInfo", Map.of("tagName", "Default")),
Map.entry("taggingPriority", 99)
),
Map.ofEntries(
Map.entry("criteria", Map.ofEntries(
Map.entry("daysOfTheWeek", "Sunday"),
Map.entry("objectType", "ScheduleBasedBackupCriteria"),
Map.entry("scheduleTimes", "2019-03-01T13:00:00Z")
)),
Map.entry("isDefault", false),
Map.entry("tagInfo", Map.of("tagName", "Weekly")),
Map.entry("taggingPriority", 20)
))
))
),
Map.ofEntries(
Map.entry("isDefault", true),
Map.entry("lifecycles", Map.ofEntries(
Map.entry("deleteAfter", Map.ofEntries(
Map.entry("duration", "P1W"),
Map.entry("objectType", "AbsoluteDeleteOption")
)),
Map.entry("sourceDataStore", Map.ofEntries(
Map.entry("dataStoreType", "VaultStore"),
Map.entry("objectType", "DataStoreInfoBase")
))
)),
Map.entry("name", "Default"),
Map.entry("objectType", "AzureRetentionRule")
),
Map.ofEntries(
Map.entry("isDefault", false),
Map.entry("lifecycles", Map.ofEntries(
Map.entry("deleteAfter", Map.ofEntries(
Map.entry("duration", "P12W"),
Map.entry("objectType", "AbsoluteDeleteOption")
)),
Map.entry("sourceDataStore", Map.ofEntries(
Map.entry("dataStoreType", "VaultStore"),
Map.entry("objectType", "DataStoreInfoBase")
))
)),
Map.entry("name", "Weekly"),
Map.entry("objectType", "AzureRetentionRule")
))
))
.resourceGroupName("000pikumar")
.vaultName("PrivatePreviewVault")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:dataprotection:BackupPolicy OSSDBPolicy /subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(backupPolicyName: Output<String>? = null, properties: Output<BackupPolicyArgs>? = null, resourceGroupName: Output<String>? = null, vaultName: Output<String>? = null)