All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.dataprotection.kotlin.BackupPolicyPostgresqlFlexibleServerArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.dataprotection.kotlin

import com.pulumi.azure.dataprotection.BackupPolicyPostgresqlFlexibleServerArgs.builder
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgs
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgsBuilder
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Backup Policy to back up PostgreSQL Flexible Server.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleBackupVault = new azure.dataprotection.BackupVault("example", {
 *     name: "example-backup-vault",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     datastoreType: "VaultStore",
 *     redundancy: "LocallyRedundant",
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * const exampleBackupPolicyPostgresqlFlexibleServer = new azure.dataprotection.BackupPolicyPostgresqlFlexibleServer("example", {
 *     name: "example-backup-policy",
 *     vaultId: exampleBackupVault.id,
 *     backupRepeatingTimeIntervals: ["R/2021-05-23T02:30:00+00:00/P1W"],
 *     timeZone: "India Standard Time",
 *     defaultRetentionRule: {
 *         lifeCycles: [{
 *             duration: "P4M",
 *             dataStoreType: "VaultStore",
 *         }],
 *     },
 *     retentionRules: [
 *         {
 *             name: "weekly",
 *             lifeCycles: [{
 *                 duration: "P6M",
 *                 dataStoreType: "VaultStore",
 *             }],
 *             priority: 20,
 *             criteria: {
 *                 absoluteCriteria: "FirstOfWeek",
 *             },
 *         },
 *         {
 *             name: "thursday",
 *             lifeCycles: [{
 *                 duration: "P1W",
 *                 dataStoreType: "VaultStore",
 *             }],
 *             priority: 25,
 *             criteria: {
 *                 daysOfWeeks: ["Thursday"],
 *                 scheduledBackupTimes: ["2021-05-23T02:30:00Z"],
 *             },
 *         },
 *         {
 *             name: "monthly",
 *             lifeCycles: [{
 *                 duration: "P1D",
 *                 dataStoreType: "VaultStore",
 *             }],
 *             priority: 15,
 *             criteria: {
 *                 weeksOfMonths: [
 *                     "First",
 *                     "Last",
 *                 ],
 *                 daysOfWeeks: ["Tuesday"],
 *                 scheduledBackupTimes: ["2021-05-23T02:30:00Z"],
 *             },
 *         },
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_backup_vault = azure.dataprotection.BackupVault("example",
 *     name="example-backup-vault",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     datastore_type="VaultStore",
 *     redundancy="LocallyRedundant",
 *     identity={
 *         "type": "SystemAssigned",
 *     })
 * example_backup_policy_postgresql_flexible_server = azure.dataprotection.BackupPolicyPostgresqlFlexibleServer("example",
 *     name="example-backup-policy",
 *     vault_id=example_backup_vault.id,
 *     backup_repeating_time_intervals=["R/2021-05-23T02:30:00+00:00/P1W"],
 *     time_zone="India Standard Time",
 *     default_retention_rule={
 *         "life_cycles": [{
 *             "duration": "P4M",
 *             "data_store_type": "VaultStore",
 *         }],
 *     },
 *     retention_rules=[
 *         {
 *             "name": "weekly",
 *             "life_cycles": [{
 *                 "duration": "P6M",
 *                 "data_store_type": "VaultStore",
 *             }],
 *             "priority": 20,
 *             "criteria": {
 *                 "absolute_criteria": "FirstOfWeek",
 *             },
 *         },
 *         {
 *             "name": "thursday",
 *             "life_cycles": [{
 *                 "duration": "P1W",
 *                 "data_store_type": "VaultStore",
 *             }],
 *             "priority": 25,
 *             "criteria": {
 *                 "days_of_weeks": ["Thursday"],
 *                 "scheduled_backup_times": ["2021-05-23T02:30:00Z"],
 *             },
 *         },
 *         {
 *             "name": "monthly",
 *             "life_cycles": [{
 *                 "duration": "P1D",
 *                 "data_store_type": "VaultStore",
 *             }],
 *             "priority": 15,
 *             "criteria": {
 *                 "weeks_of_months": [
 *                     "First",
 *                     "Last",
 *                 ],
 *                 "days_of_weeks": ["Tuesday"],
 *                 "scheduled_backup_times": ["2021-05-23T02:30:00Z"],
 *             },
 *         },
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleBackupVault = new Azure.DataProtection.BackupVault("example", new()
 *     {
 *         Name = "example-backup-vault",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         DatastoreType = "VaultStore",
 *         Redundancy = "LocallyRedundant",
 *         Identity = new Azure.DataProtection.Inputs.BackupVaultIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 *     var exampleBackupPolicyPostgresqlFlexibleServer = new Azure.DataProtection.BackupPolicyPostgresqlFlexibleServer("example", new()
 *     {
 *         Name = "example-backup-policy",
 *         VaultId = exampleBackupVault.Id,
 *         BackupRepeatingTimeIntervals = new[]
 *         {
 *             "R/2021-05-23T02:30:00+00:00/P1W",
 *         },
 *         TimeZone = "India Standard Time",
 *         DefaultRetentionRule = new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgs
 *         {
 *             LifeCycles = new[]
 *             {
 *                 new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleLifeCycleArgs
 *                 {
 *                     Duration = "P4M",
 *                     DataStoreType = "VaultStore",
 *                 },
 *             },
 *         },
 *         RetentionRules = new[]
 *         {
 *             new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs
 *             {
 *                 Name = "weekly",
 *                 LifeCycles = new[]
 *                 {
 *                     new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs
 *                     {
 *                         Duration = "P6M",
 *                         DataStoreType = "VaultStore",
 *                     },
 *                 },
 *                 Priority = 20,
 *                 Criteria = new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs
 *                 {
 *                     AbsoluteCriteria = "FirstOfWeek",
 *                 },
 *             },
 *             new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs
 *             {
 *                 Name = "thursday",
 *                 LifeCycles = new[]
 *                 {
 *                     new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs
 *                     {
 *                         Duration = "P1W",
 *                         DataStoreType = "VaultStore",
 *                     },
 *                 },
 *                 Priority = 25,
 *                 Criteria = new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs
 *                 {
 *                     DaysOfWeeks = new[]
 *                     {
 *                         "Thursday",
 *                     },
 *                     ScheduledBackupTimes = new[]
 *                     {
 *                         "2021-05-23T02:30:00Z",
 *                     },
 *                 },
 *             },
 *             new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs
 *             {
 *                 Name = "monthly",
 *                 LifeCycles = new[]
 *                 {
 *                     new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs
 *                     {
 *                         Duration = "P1D",
 *                         DataStoreType = "VaultStore",
 *                     },
 *                 },
 *                 Priority = 15,
 *                 Criteria = new Azure.DataProtection.Inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs
 *                 {
 *                     WeeksOfMonths = new[]
 *                     {
 *                         "First",
 *                         "Last",
 *                     },
 *                     DaysOfWeeks = new[]
 *                     {
 *                         "Tuesday",
 *                     },
 *                     ScheduledBackupTimes = new[]
 *                     {
 *                         "2021-05-23T02:30:00Z",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "example", &dataprotection.BackupVaultArgs{
 * 			Name:              pulumi.String("example-backup-vault"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			DatastoreType:     pulumi.String("VaultStore"),
 * 			Redundancy:        pulumi.String("LocallyRedundant"),
 * 			Identity: &dataprotection.BackupVaultIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = dataprotection.NewBackupPolicyPostgresqlFlexibleServer(ctx, "example", &dataprotection.BackupPolicyPostgresqlFlexibleServerArgs{
 * 			Name:    pulumi.String("example-backup-policy"),
 * 			VaultId: exampleBackupVault.ID(),
 * 			BackupRepeatingTimeIntervals: pulumi.StringArray{
 * 				pulumi.String("R/2021-05-23T02:30:00+00:00/P1W"),
 * 			},
 * 			TimeZone: pulumi.String("India Standard Time"),
 * 			DefaultRetentionRule: &dataprotection.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgs{
 * 				LifeCycles: dataprotection.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleLifeCycleArray{
 * 					&dataprotection.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleLifeCycleArgs{
 * 						Duration:      pulumi.String("P4M"),
 * 						DataStoreType: pulumi.String("VaultStore"),
 * 					},
 * 				},
 * 			},
 * 			RetentionRules: dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleArray{
 * 				&dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs{
 * 					Name: pulumi.String("weekly"),
 * 					LifeCycles: dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArray{
 * 						&dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs{
 * 							Duration:      pulumi.String("P6M"),
 * 							DataStoreType: pulumi.String("VaultStore"),
 * 						},
 * 					},
 * 					Priority: pulumi.Int(20),
 * 					Criteria: &dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs{
 * 						AbsoluteCriteria: pulumi.String("FirstOfWeek"),
 * 					},
 * 				},
 * 				&dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs{
 * 					Name: pulumi.String("thursday"),
 * 					LifeCycles: dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArray{
 * 						&dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs{
 * 							Duration:      pulumi.String("P1W"),
 * 							DataStoreType: pulumi.String("VaultStore"),
 * 						},
 * 					},
 * 					Priority: pulumi.Int(25),
 * 					Criteria: &dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs{
 * 						DaysOfWeeks: pulumi.StringArray{
 * 							pulumi.String("Thursday"),
 * 						},
 * 						ScheduledBackupTimes: pulumi.StringArray{
 * 							pulumi.String("2021-05-23T02:30:00Z"),
 * 						},
 * 					},
 * 				},
 * 				&dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs{
 * 					Name: pulumi.String("monthly"),
 * 					LifeCycles: dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArray{
 * 						&dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs{
 * 							Duration:      pulumi.String("P1D"),
 * 							DataStoreType: pulumi.String("VaultStore"),
 * 						},
 * 					},
 * 					Priority: pulumi.Int(15),
 * 					Criteria: &dataprotection.BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs{
 * 						WeeksOfMonths: pulumi.StringArray{
 * 							pulumi.String("First"),
 * 							pulumi.String("Last"),
 * 						},
 * 						DaysOfWeeks: pulumi.StringArray{
 * 							pulumi.String("Tuesday"),
 * 						},
 * 						ScheduledBackupTimes: pulumi.StringArray{
 * 							pulumi.String("2021-05-23T02:30:00Z"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.dataprotection.BackupVault;
 * import com.pulumi.azure.dataprotection.BackupVaultArgs;
 * import com.pulumi.azure.dataprotection.inputs.BackupVaultIdentityArgs;
 * import com.pulumi.azure.dataprotection.BackupPolicyPostgresqlFlexibleServer;
 * import com.pulumi.azure.dataprotection.BackupPolicyPostgresqlFlexibleServerArgs;
 * import com.pulumi.azure.dataprotection.inputs.BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgs;
 * import com.pulumi.azure.dataprotection.inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs;
 * import com.pulumi.azure.dataprotection.inputs.BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleBackupVault = new BackupVault("exampleBackupVault", BackupVaultArgs.builder()
 *             .name("example-backup-vault")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .datastoreType("VaultStore")
 *             .redundancy("LocallyRedundant")
 *             .identity(BackupVaultIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleBackupPolicyPostgresqlFlexibleServer = new BackupPolicyPostgresqlFlexibleServer("exampleBackupPolicyPostgresqlFlexibleServer", BackupPolicyPostgresqlFlexibleServerArgs.builder()
 *             .name("example-backup-policy")
 *             .vaultId(exampleBackupVault.id())
 *             .backupRepeatingTimeIntervals("R/2021-05-23T02:30:00+00:00/P1W")
 *             .timeZone("India Standard Time")
 *             .defaultRetentionRule(BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgs.builder()
 *                 .lifeCycles(BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleLifeCycleArgs.builder()
 *                     .duration("P4M")
 *                     .dataStoreType("VaultStore")
 *                     .build())
 *                 .build())
 *             .retentionRules(
 *                 BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs.builder()
 *                     .name("weekly")
 *                     .lifeCycles(BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs.builder()
 *                         .duration("P6M")
 *                         .dataStoreType("VaultStore")
 *                         .build())
 *                     .priority(20)
 *                     .criteria(BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs.builder()
 *                         .absoluteCriteria("FirstOfWeek")
 *                         .build())
 *                     .build(),
 *                 BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs.builder()
 *                     .name("thursday")
 *                     .lifeCycles(BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs.builder()
 *                         .duration("P1W")
 *                         .dataStoreType("VaultStore")
 *                         .build())
 *                     .priority(25)
 *                     .criteria(BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs.builder()
 *                         .daysOfWeeks("Thursday")
 *                         .scheduledBackupTimes("2021-05-23T02:30:00Z")
 *                         .build())
 *                     .build(),
 *                 BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs.builder()
 *                     .name("monthly")
 *                     .lifeCycles(BackupPolicyPostgresqlFlexibleServerRetentionRuleLifeCycleArgs.builder()
 *                         .duration("P1D")
 *                         .dataStoreType("VaultStore")
 *                         .build())
 *                     .priority(15)
 *                     .criteria(BackupPolicyPostgresqlFlexibleServerRetentionRuleCriteriaArgs.builder()
 *                         .weeksOfMonths(
 *                             "First",
 *                             "Last")
 *                         .daysOfWeeks("Tuesday")
 *                         .scheduledBackupTimes("2021-05-23T02:30:00Z")
 *                         .build())
 *                     .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleBackupVault:
 *     type: azure:dataprotection:BackupVault
 *     name: example
 *     properties:
 *       name: example-backup-vault
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       datastoreType: VaultStore
 *       redundancy: LocallyRedundant
 *       identity:
 *         type: SystemAssigned
 *   exampleBackupPolicyPostgresqlFlexibleServer:
 *     type: azure:dataprotection:BackupPolicyPostgresqlFlexibleServer
 *     name: example
 *     properties:
 *       name: example-backup-policy
 *       vaultId: ${exampleBackupVault.id}
 *       backupRepeatingTimeIntervals:
 *         - R/2021-05-23T02:30:00+00:00/P1W
 *       timeZone: India Standard Time
 *       defaultRetentionRule:
 *         lifeCycles:
 *           - duration: P4M
 *             dataStoreType: VaultStore
 *       retentionRules:
 *         - name: weekly
 *           lifeCycles:
 *             - duration: P6M
 *               dataStoreType: VaultStore
 *           priority: 20
 *           criteria:
 *             absoluteCriteria: FirstOfWeek
 *         - name: thursday
 *           lifeCycles:
 *             - duration: P1W
 *               dataStoreType: VaultStore
 *           priority: 25
 *           criteria:
 *             daysOfWeeks:
 *               - Thursday
 *             scheduledBackupTimes:
 *               - 2021-05-23T02:30:00Z
 *         - name: monthly
 *           lifeCycles:
 *             - duration: P1D
 *               dataStoreType: VaultStore
 *           priority: 15
 *           criteria:
 *             weeksOfMonths:
 *               - First
 *               - Last
 *             daysOfWeeks:
 *               - Tuesday
 *             scheduledBackupTimes:
 *               - 2021-05-23T02:30:00Z
 * ```
 * 
 * ## Import
 * Backup Policy PostgreSQL Flexible Server's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:dataprotection/backupPolicyPostgresqlFlexibleServer:BackupPolicyPostgresqlFlexibleServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataProtection/backupVaults/vault1/backupPolicies/backupPolicy1
 * ```
 * @property backupRepeatingTimeIntervals Specifies a list of repeating time interval. It supports weekly back. It should follow `ISO 8601` repeating time interval format. Changing this forces a new resource to be created.
 * @property defaultRetentionRule A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Backup Policy for the PostgreSQL Flexible Server. Changing this forces a new resource to be created.
 * @property retentionRules One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
 * @property timeZone Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new resource to be created.
 * @property vaultId The ID of the Backup Vault where the Backup Policy PostgreSQL Flexible Server should exist. Changing this forces a new resource to be created.
 */
public data class BackupPolicyPostgresqlFlexibleServerArgs(
    public val backupRepeatingTimeIntervals: Output>? = null,
    public val defaultRetentionRule: Output? = null,
    public val name: Output? = null,
    public val retentionRules: Output>? =
        null,
    public val timeZone: Output? = null,
    public val vaultId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.dataprotection.BackupPolicyPostgresqlFlexibleServerArgs =
        com.pulumi.azure.dataprotection.BackupPolicyPostgresqlFlexibleServerArgs.builder()
            .backupRepeatingTimeIntervals(
                backupRepeatingTimeIntervals?.applyValue({ args0 ->
                    args0.map({ args0 -> args0 })
                }),
            )
            .defaultRetentionRule(
                defaultRetentionRule?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .retentionRules(
                retentionRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .timeZone(timeZone?.applyValue({ args0 -> args0 }))
            .vaultId(vaultId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [BackupPolicyPostgresqlFlexibleServerArgs].
 */
@PulumiTagMarker
public class BackupPolicyPostgresqlFlexibleServerArgsBuilder internal constructor() {
    private var backupRepeatingTimeIntervals: Output>? = null

    private var defaultRetentionRule:
        Output? = null

    private var name: Output? = null

    private var retentionRules: Output>? =
        null

    private var timeZone: Output? = null

    private var vaultId: Output? = null

    /**
     * @param value Specifies a list of repeating time interval. It supports weekly back. It should follow `ISO 8601` repeating time interval format. Changing this forces a new resource to be created.
     */
    @JvmName("sxwcwmclhlmcovja")
    public suspend fun backupRepeatingTimeIntervals(`value`: Output>) {
        this.backupRepeatingTimeIntervals = value
    }

    @JvmName("hynssvurvgwhiuev")
    public suspend fun backupRepeatingTimeIntervals(vararg values: Output) {
        this.backupRepeatingTimeIntervals = Output.all(values.asList())
    }

    /**
     * @param values Specifies a list of repeating time interval. It supports weekly back. It should follow `ISO 8601` repeating time interval format. Changing this forces a new resource to be created.
     */
    @JvmName("hvvafisjiuykxpkl")
    public suspend fun backupRepeatingTimeIntervals(values: List>) {
        this.backupRepeatingTimeIntervals = Output.all(values)
    }

    /**
     * @param value A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("bwfxhbuxglqylnjf")
    public suspend fun defaultRetentionRule(`value`: Output) {
        this.defaultRetentionRule = value
    }

    /**
     * @param value Specifies the name of the Backup Policy for the PostgreSQL Flexible Server. Changing this forces a new resource to be created.
     */
    @JvmName("yiapjqwcaaffvsvi")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("kcajdihwhmmehrhx")
    public suspend fun retentionRules(`value`: Output>) {
        this.retentionRules = value
    }

    @JvmName("daswqvpjpnocfvgs")
    public suspend fun retentionRules(vararg values: Output) {
        this.retentionRules = Output.all(values.asList())
    }

    /**
     * @param values One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("kacnyolxfugipdwx")
    public suspend fun retentionRules(values: List>) {
        this.retentionRules = Output.all(values)
    }

    /**
     * @param value Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new resource to be created.
     */
    @JvmName("sfyatbiawttxmuas")
    public suspend fun timeZone(`value`: Output) {
        this.timeZone = value
    }

    /**
     * @param value The ID of the Backup Vault where the Backup Policy PostgreSQL Flexible Server should exist. Changing this forces a new resource to be created.
     */
    @JvmName("adtrpcyfishrurmm")
    public suspend fun vaultId(`value`: Output) {
        this.vaultId = value
    }

    /**
     * @param value Specifies a list of repeating time interval. It supports weekly back. It should follow `ISO 8601` repeating time interval format. Changing this forces a new resource to be created.
     */
    @JvmName("xoftaakfbcpnsmnv")
    public suspend fun backupRepeatingTimeIntervals(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backupRepeatingTimeIntervals = mapped
    }

    /**
     * @param values Specifies a list of repeating time interval. It supports weekly back. It should follow `ISO 8601` repeating time interval format. Changing this forces a new resource to be created.
     */
    @JvmName("erabneulbryahtyc")
    public suspend fun backupRepeatingTimeIntervals(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.backupRepeatingTimeIntervals = mapped
    }

    /**
     * @param value A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("ffxukfsratkinaad")
    public suspend fun defaultRetentionRule(`value`: BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultRetentionRule = mapped
    }

    /**
     * @param argument A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("ujtehbryygexwgvg")
    public suspend fun defaultRetentionRule(argument: suspend BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped =
            BackupPolicyPostgresqlFlexibleServerDefaultRetentionRuleArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.defaultRetentionRule = mapped
    }

    /**
     * @param value Specifies the name of the Backup Policy for the PostgreSQL Flexible Server. Changing this forces a new resource to be created.
     */
    @JvmName("wdimlouyjgtsxnmx")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("qgpxotdpvlgshnmx")
    public suspend fun retentionRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retentionRules = mapped
    }

    /**
     * @param argument One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("hacwlrlkqetrkwst")
    public suspend fun retentionRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            BackupPolicyPostgresqlFlexibleServerRetentionRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.retentionRules = mapped
    }

    /**
     * @param argument One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("lbkivwsvhtakyhrg")
    public suspend fun retentionRules(vararg argument: suspend BackupPolicyPostgresqlFlexibleServerRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            BackupPolicyPostgresqlFlexibleServerRetentionRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.retentionRules = mapped
    }

    /**
     * @param argument One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("gdyhsiumlpkparkt")
    public suspend fun retentionRules(argument: suspend BackupPolicyPostgresqlFlexibleServerRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                BackupPolicyPostgresqlFlexibleServerRetentionRuleArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.retentionRules = mapped
    }

    /**
     * @param values One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("epoufqpaufulqtij")
    public suspend fun retentionRules(vararg values: BackupPolicyPostgresqlFlexibleServerRetentionRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.retentionRules = mapped
    }

    /**
     * @param value Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new resource to be created.
     */
    @JvmName("nuwypvdaauwfxind")
    public suspend fun timeZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeZone = mapped
    }

    /**
     * @param value The ID of the Backup Vault where the Backup Policy PostgreSQL Flexible Server should exist. Changing this forces a new resource to be created.
     */
    @JvmName("kmcqnsxcmshxtgac")
    public suspend fun vaultId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vaultId = mapped
    }

    internal fun build(): BackupPolicyPostgresqlFlexibleServerArgs =
        BackupPolicyPostgresqlFlexibleServerArgs(
            backupRepeatingTimeIntervals = backupRepeatingTimeIntervals,
            defaultRetentionRule = defaultRetentionRule,
            name = name,
            retentionRules = retentionRules,
            timeZone = timeZone,
            vaultId = vaultId,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy