import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * A Backup and DR BackupPlanAssociation. * * To get more information about BackupPlanAssociation, 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 Bpa * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const mySA = new gcp.serviceaccount.Account("mySA", { * accountId: "my-custom", * displayName: "Custom SA for VM Instance", * }); * const myinstance = new gcp.compute.Instance("myinstance", { * networkInterfaces: [{ * accessConfigs: [{}], * network: "default", * }], * name: "test-instance", * machineType: "n2-standard-2", * zone: "us-central1-a", * bootDisk: { * initializeParams: { * image: "debian-cloud/debian-11", * labels: { * my_label: "value", * }, * }, * }, * scratchDisks: [{ * "interface": "NVME", * }], * serviceAccount: { * email: mySA.email, * scopes: ["cloud-platform"], * }, * }); * const bv1 = new gcp.backupdisasterrecovery.BackupVault("bv1", { * location: "us-central1", * backupVaultId: "bv-bpa", * backupMinimumEnforcedRetentionDuration: "100000s", * forceDelete: true, * }); * const bp1 = new gcp.backupdisasterrecovery.BackupPlan("bp1", { * location: "us-central1", * backupPlanId: "bp-bpa-test", * resourceType: "compute.googleapis.com/Instance", * backupVault: bv1.id, * backupRules: [{ * ruleId: "rule-1", * backupRetentionDays: 2, * standardSchedule: { * recurrenceType: "HOURLY", * hourlyFrequency: 6, * timeZone: "UTC", * backupWindow: { * startHourOfDay: 12, * endHourOfDay: 18, * }, * }, * }], * }); * const my_backup_plan_association = new gcp.backupdisasterrecovery.BackupPlanAssociation("my-backup-plan-association", { * location: "us-central1", * resourceType: "compute.googleapis.com/Instance", * backupPlanAssociationId: "my-bpa", * resource: myinstance.id, * backupPlan: bp1.name, * }); * ``` * * ## Import * * BackupPlanAssociation can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/backupPlanAssociations/{{backup_plan_association_id}}` * * * `{{project}}/{{location}}/{{backup_plan_association_id}}` * * * `{{location}}/{{backup_plan_association_id}}` * * When using the `pulumi import` command, BackupPlanAssociation can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupPlanAssociation:BackupPlanAssociation default projects/{{project}}/locations/{{location}}/backupPlanAssociations/{{backup_plan_association_id}} * ``` * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupPlanAssociation:BackupPlanAssociation default {{project}}/{{location}}/{{backup_plan_association_id}} * ``` * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupPlanAssociation:BackupPlanAssociation default {{location}}/{{backup_plan_association_id}} * ``` */ export declare class BackupPlanAssociation extends pulumi.CustomResource { /** * Get an existing BackupPlanAssociation 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, state?: BackupPlanAssociationState, opts?: pulumi.CustomResourceOptions): BackupPlanAssociation; /** * Returns true if the given object is an instance of BackupPlanAssociation. 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 BackupPlanAssociation; /** * The BP with which resource needs to be created * Note: * - A Backup Plan configured for 'compute.googleapis.com/Instance', can only protect instance type resources. * - A Backup Plan configured for 'compute.googleapis.com/Disk' can be used to protect both standard Disks and Regional Disks resources. */ readonly backupPlan: pulumi.Output; /** * The id of backupplan association */ readonly backupPlanAssociationId: pulumi.Output; /** * The time when the instance was created */ readonly createTime: pulumi.Output; /** * Resource name of data source which will be used as storage location for backups taken */ readonly dataSource: pulumi.Output; /** * The point in time when the last successful backup was captured from the source */ readonly lastSuccessfulBackupConsistencyTime: pulumi.Output; /** * The location for the backupplan association */ readonly location: pulumi.Output; /** * The name of backup plan association resource created */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The resource for which BPA needs to be created */ readonly resource: pulumi.Output; /** * The resource type of workload on which backupplan is applied. * Examples include, "compute.googleapis.com/Instance", "compute.googleapis.com/Disk", and "compute.googleapis.com/RegionDisk" */ readonly resourceType: pulumi.Output; /** * Message for rules config info * Structure is documented below. */ readonly rulesConfigInfos: pulumi.Output; /** * The time when the instance was updated. */ readonly updateTime: pulumi.Output; /** * Create a BackupPlanAssociation 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: BackupPlanAssociationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering BackupPlanAssociation resources. */ export interface BackupPlanAssociationState { /** * The BP with which resource needs to be created * Note: * - A Backup Plan configured for 'compute.googleapis.com/Instance', can only protect instance type resources. * - A Backup Plan configured for 'compute.googleapis.com/Disk' can be used to protect both standard Disks and Regional Disks resources. */ backupPlan?: pulumi.Input; /** * The id of backupplan association */ backupPlanAssociationId?: pulumi.Input; /** * The time when the instance was created */ createTime?: pulumi.Input; /** * Resource name of data source which will be used as storage location for backups taken */ dataSource?: pulumi.Input; /** * The point in time when the last successful backup was captured from the source */ lastSuccessfulBackupConsistencyTime?: pulumi.Input; /** * The location for the backupplan association */ location?: pulumi.Input; /** * The name of backup plan association resource created */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The resource for which BPA needs to be created */ resource?: pulumi.Input; /** * The resource type of workload on which backupplan is applied. * Examples include, "compute.googleapis.com/Instance", "compute.googleapis.com/Disk", and "compute.googleapis.com/RegionDisk" */ resourceType?: pulumi.Input; /** * Message for rules config info * Structure is documented below. */ rulesConfigInfos?: pulumi.Input[]>; /** * The time when the instance was updated. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a BackupPlanAssociation resource. */ export interface BackupPlanAssociationArgs { /** * The BP with which resource needs to be created * Note: * - A Backup Plan configured for 'compute.googleapis.com/Instance', can only protect instance type resources. * - A Backup Plan configured for 'compute.googleapis.com/Disk' can be used to protect both standard Disks and Regional Disks resources. */ backupPlan: pulumi.Input; /** * The id of backupplan association */ backupPlanAssociationId: pulumi.Input; /** * The location for the backupplan association */ location: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The resource for which BPA needs to be created */ resource: pulumi.Input; /** * The resource type of workload on which backupplan is applied. * Examples include, "compute.googleapis.com/Instance", "compute.googleapis.com/Disk", and "compute.googleapis.com/RegionDisk" */ resourceType: pulumi.Input; }