"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackupPlanAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * 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}}
 * ```
 */
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, id, state, opts) {
        return new BackupPlanAssociation(name, state, { ...opts, id: id });
    }
    /**
     * 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) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === BackupPlanAssociation.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["backupPlan"] = state?.backupPlan;
            resourceInputs["backupPlanAssociationId"] = state?.backupPlanAssociationId;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["dataSource"] = state?.dataSource;
            resourceInputs["lastSuccessfulBackupConsistencyTime"] = state?.lastSuccessfulBackupConsistencyTime;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["resource"] = state?.resource;
            resourceInputs["resourceType"] = state?.resourceType;
            resourceInputs["rulesConfigInfos"] = state?.rulesConfigInfos;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.backupPlan === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupPlan'");
            }
            if (args?.backupPlanAssociationId === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupPlanAssociationId'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.resource === undefined && !opts.urn) {
                throw new Error("Missing required property 'resource'");
            }
            if (args?.resourceType === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceType'");
            }
            resourceInputs["backupPlan"] = args?.backupPlan;
            resourceInputs["backupPlanAssociationId"] = args?.backupPlanAssociationId;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["resource"] = args?.resource;
            resourceInputs["resourceType"] = args?.resourceType;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["dataSource"] = undefined /*out*/;
            resourceInputs["lastSuccessfulBackupConsistencyTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["rulesConfigInfos"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(BackupPlanAssociation.__pulumiType, name, resourceInputs, opts);
    }
}
exports.BackupPlanAssociation = BackupPlanAssociation;
/** @internal */
BackupPlanAssociation.__pulumiType = 'gcp:backupdisasterrecovery/backupPlanAssociation:BackupPlanAssociation';
//# sourceMappingURL=backupPlanAssociation.js.map