@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
276 lines (275 loc) • 9.24 kB
TypeScript
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<pulumi.ID>, 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
*/
readonly backupPlan: pulumi.Output<string>;
/**
* The id of backupplan association
*
*
* - - -
*/
readonly backupPlanAssociationId: pulumi.Output<string>;
/**
* The time when the instance was created
*/
readonly createTime: pulumi.Output<string>;
/**
* Resource name of data source which will be used as storage location for backups taken
*/
readonly dataSource: pulumi.Output<string>;
/**
* The point in time when the last successful backup was captured from the source
*/
readonly lastSuccessfulBackupConsistencyTime: pulumi.Output<string>;
/**
* The location for the backupplan association
*/
readonly location: pulumi.Output<string>;
/**
* The name of backup plan association resource created
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The resource for which BPA needs to be created
*/
readonly resource: pulumi.Output<string>;
/**
* The resource type of workload on which backupplan is applied
*/
readonly resourceType: pulumi.Output<string>;
/**
* Message for rules config info
* Structure is documented below.
*/
readonly rulesConfigInfos: pulumi.Output<outputs.backupdisasterrecovery.BackupPlanAssociationRulesConfigInfo[]>;
/**
* The time when the instance was updated.
*/
readonly updateTime: pulumi.Output<string>;
/**
* 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
*/
backupPlan?: pulumi.Input<string>;
/**
* The id of backupplan association
*
*
* - - -
*/
backupPlanAssociationId?: pulumi.Input<string>;
/**
* The time when the instance was created
*/
createTime?: pulumi.Input<string>;
/**
* Resource name of data source which will be used as storage location for backups taken
*/
dataSource?: pulumi.Input<string>;
/**
* The point in time when the last successful backup was captured from the source
*/
lastSuccessfulBackupConsistencyTime?: pulumi.Input<string>;
/**
* The location for the backupplan association
*/
location?: pulumi.Input<string>;
/**
* The name of backup plan association resource created
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The resource for which BPA needs to be created
*/
resource?: pulumi.Input<string>;
/**
* The resource type of workload on which backupplan is applied
*/
resourceType?: pulumi.Input<string>;
/**
* Message for rules config info
* Structure is documented below.
*/
rulesConfigInfos?: pulumi.Input<pulumi.Input<inputs.backupdisasterrecovery.BackupPlanAssociationRulesConfigInfo>[]>;
/**
* The time when the instance was updated.
*/
updateTime?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a BackupPlanAssociation resource.
*/
export interface BackupPlanAssociationArgs {
/**
* The BP with which resource needs to be created
*/
backupPlan: pulumi.Input<string>;
/**
* The id of backupplan association
*
*
* - - -
*/
backupPlanAssociationId: pulumi.Input<string>;
/**
* The location for the backupplan association
*/
location: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The resource for which BPA needs to be created
*/
resource: pulumi.Input<string>;
/**
* The resource type of workload on which backupplan is applied
*/
resourceType: pulumi.Input<string>;
}