UNPKG

@pulumi/gcp

Version:

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

168 lines • 8.78 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.BackupVault = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Container to store and organize immutable and indelible backups. * * ## Example Usage * * ### Backup Dr Backup Vault Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const backup_vault_test = new gcp.backupdisasterrecovery.BackupVault("backup-vault-test", { * location: "us-central1", * backupVaultId: "backup-vault-test", * description: "This is a second backup vault built by Terraform.", * backupMinimumEnforcedRetentionDuration: "100000s", * annotations: { * annotations1: "bar1", * annotations2: "baz1", * }, * labels: { * foo: "bar1", * bar: "baz1", * }, * forceUpdate: true, * accessRestriction: "WITHIN_ORGANIZATION", * ignoreInactiveDatasources: true, * ignoreBackupPlanReferences: true, * allowMissing: true, * }); * ``` * * ## Import * * BackupVault can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/backupVaults/{{backup_vault_id}}` * * * `{{project}}/{{location}}/{{backup_vault_id}}` * * * `{{location}}/{{backup_vault_id}}` * * When using the `pulumi import` command, BackupVault can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupVault:BackupVault default projects/{{project}}/locations/{{location}}/backupVaults/{{backup_vault_id}} * ``` * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupVault:BackupVault default {{project}}/{{location}}/{{backup_vault_id}} * ``` * * ```sh * $ pulumi import gcp:backupdisasterrecovery/backupVault:BackupVault default {{location}}/{{backup_vault_id}} * ``` */ class BackupVault extends pulumi.CustomResource { /** * Get an existing BackupVault 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 BackupVault(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of BackupVault. 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'] === BackupVault.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessRestriction"] = state ? state.accessRestriction : undefined; resourceInputs["allowMissing"] = state ? state.allowMissing : undefined; resourceInputs["annotations"] = state ? state.annotations : undefined; resourceInputs["backupCount"] = state ? state.backupCount : undefined; resourceInputs["backupMinimumEnforcedRetentionDuration"] = state ? state.backupMinimumEnforcedRetentionDuration : undefined; resourceInputs["backupVaultId"] = state ? state.backupVaultId : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["deletable"] = state ? state.deletable : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["effectiveAnnotations"] = state ? state.effectiveAnnotations : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["effectiveTime"] = state ? state.effectiveTime : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["forceDelete"] = state ? state.forceDelete : undefined; resourceInputs["forceUpdate"] = state ? state.forceUpdate : undefined; resourceInputs["ignoreBackupPlanReferences"] = state ? state.ignoreBackupPlanReferences : undefined; resourceInputs["ignoreInactiveDatasources"] = state ? state.ignoreInactiveDatasources : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["serviceAccount"] = state ? state.serviceAccount : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["totalStoredBytes"] = state ? state.totalStoredBytes : undefined; resourceInputs["uid"] = state ? state.uid : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.backupMinimumEnforcedRetentionDuration === undefined) && !opts.urn) { throw new Error("Missing required property 'backupMinimumEnforcedRetentionDuration'"); } if ((!args || args.backupVaultId === undefined) && !opts.urn) { throw new Error("Missing required property 'backupVaultId'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["accessRestriction"] = args ? args.accessRestriction : undefined; resourceInputs["allowMissing"] = args ? args.allowMissing : undefined; resourceInputs["annotations"] = args ? args.annotations : undefined; resourceInputs["backupMinimumEnforcedRetentionDuration"] = args ? args.backupMinimumEnforcedRetentionDuration : undefined; resourceInputs["backupVaultId"] = args ? args.backupVaultId : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["effectiveTime"] = args ? args.effectiveTime : undefined; resourceInputs["forceDelete"] = args ? args.forceDelete : undefined; resourceInputs["forceUpdate"] = args ? args.forceUpdate : undefined; resourceInputs["ignoreBackupPlanReferences"] = args ? args.ignoreBackupPlanReferences : undefined; resourceInputs["ignoreInactiveDatasources"] = args ? args.ignoreInactiveDatasources : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["backupCount"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["deletable"] = undefined /*out*/; resourceInputs["effectiveAnnotations"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["serviceAccount"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["totalStoredBytes"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(BackupVault.__pulumiType, name, resourceInputs, opts); } } exports.BackupVault = BackupVault; /** @internal */ BackupVault.__pulumiType = 'gcp:backupdisasterrecovery/backupVault:BackupVault'; //# sourceMappingURL=backupVault.js.map