UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

216 lines (215 loc) 7.88 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * A backup plan defines when and how to back up a resource, including the backup's schedule, retention, and location. * * To get more information about BackupPlan, see: * * * [API documentation](https://cloud.google.com/backup-disaster-recovery/docs/reference/rest) * * How-to Guides * * [Official Documentation](https://cloud.google.com/backup-disaster-recovery/docs) * * ## Example Usage * * ### Backup Dr Backup Plan Simple * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myBackupVault = new gcp.backupdisasterrecovery.BackupVault("my_backup_vault", { * location: "us-central1", * backupVaultId: "backup-vault-simple-test", * backupMinimumEnforcedRetentionDuration: "100000s", * }); * const my_backup_plan_1 = new gcp.backupdisasterrecovery.BackupPlan("my-backup-plan-1", { * location: "us-central1", * backupPlanId: "backup-plan-simple-test", * resourceType: "compute.googleapis.com/Instance", * backupVault: myBackupVault.id, * backupRules: [{ * ruleId: "rule-1", * backupRetentionDays: 5, * standardSchedule: { * recurrenceType: "HOURLY", * hourlyFrequency: 6, * timeZone: "UTC", * backupWindow: { * startHourOfDay: 0, * endHourOfDay: 24, * }, * }, * }], * }); * ``` * * ## Import * * BackupPlan can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/backupPlans/{{backup_plan_id}}` * * * `{{project}}/{{location}}/{{backup_plan_id}}` * * * `{{location}}/{{backup_plan_id}}` * * When using the `pulumi import` command, BackupPlan can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupPlan:BackupPlan default projects/{{project}}/locations/{{location}}/backupPlans/{{backup_plan_id}} * ``` * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupPlan:BackupPlan default {{project}}/{{location}}/{{backup_plan_id}} * ``` * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupPlan:BackupPlan default {{location}}/{{backup_plan_id}} * ``` */ export declare class BackupPlan extends pulumi.CustomResource { /** * Get an existing BackupPlan resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BackupPlanState, opts?: pulumi.CustomResourceOptions): BackupPlan; /** * Returns true if the given object is an instance of BackupPlan. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is BackupPlan; /** * The ID of the backup plan */ readonly backupPlanId: pulumi.Output<string>; /** * The backup rules for this `BackupPlan`. There must be at least one `BackupRule` message. * Structure is documented below. */ readonly backupRules: pulumi.Output<outputs.backupdisasterrecovery.BackupPlanBackupRule[]>; /** * Backup vault where the backups gets stored using this Backup plan. */ readonly backupVault: pulumi.Output<string>; /** * The Google Cloud Platform Service Account to be used by the BackupVault for taking backups. */ readonly backupVaultServiceAccount: pulumi.Output<string>; /** * When the `BackupPlan` was created. */ readonly createTime: pulumi.Output<string>; /** * The description allows for additional details about 'BackupPlan' and its use cases to be provided. */ readonly description: pulumi.Output<string | undefined>; /** * The location for the backup plan */ readonly location: pulumi.Output<string>; /** * The name of backup plan resource created */ readonly name: pulumi.Output<string>; readonly project: pulumi.Output<string>; /** * The resource type to which the `BackupPlan` will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket". */ readonly resourceType: pulumi.Output<string>; /** * When the `BackupPlan` was last updated. */ readonly updateTime: pulumi.Output<string>; /** * Create a BackupPlan resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: BackupPlanArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering BackupPlan resources. */ export interface BackupPlanState { /** * The ID of the backup plan */ backupPlanId?: pulumi.Input<string>; /** * The backup rules for this `BackupPlan`. There must be at least one `BackupRule` message. * Structure is documented below. */ backupRules?: pulumi.Input<pulumi.Input<inputs.backupdisasterrecovery.BackupPlanBackupRule>[]>; /** * Backup vault where the backups gets stored using this Backup plan. */ backupVault?: pulumi.Input<string>; /** * The Google Cloud Platform Service Account to be used by the BackupVault for taking backups. */ backupVaultServiceAccount?: pulumi.Input<string>; /** * When the `BackupPlan` was created. */ createTime?: pulumi.Input<string>; /** * The description allows for additional details about 'BackupPlan' and its use cases to be provided. */ description?: pulumi.Input<string>; /** * The location for the backup plan */ location?: pulumi.Input<string>; /** * The name of backup plan resource created */ name?: pulumi.Input<string>; project?: pulumi.Input<string>; /** * The resource type to which the `BackupPlan` will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket". */ resourceType?: pulumi.Input<string>; /** * When the `BackupPlan` was last updated. */ updateTime?: pulumi.Input<string>; } /** * The set of arguments for constructing a BackupPlan resource. */ export interface BackupPlanArgs { /** * The ID of the backup plan */ backupPlanId: pulumi.Input<string>; /** * The backup rules for this `BackupPlan`. There must be at least one `BackupRule` message. * Structure is documented below. */ backupRules: pulumi.Input<pulumi.Input<inputs.backupdisasterrecovery.BackupPlanBackupRule>[]>; /** * Backup vault where the backups gets stored using this Backup plan. */ backupVault: pulumi.Input<string>; /** * The description allows for additional details about 'BackupPlan' and its use cases to be provided. */ description?: pulumi.Input<string>; /** * The location for the backup plan */ location: pulumi.Input<string>; project?: pulumi.Input<string>; /** * The resource type to which the `BackupPlan` will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket". */ resourceType: pulumi.Input<string>; }