UNPKG

@pulumi/gcp

Version:

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

84 lines 3.52 kB
"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.ServiceConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Initializes a Project-level default Backupdr config. It creates default Backupvault and default Backup Plan in same project for customers to protect instances. * * To get more information about ServiceConfig, see: * * * [API documentation](https://cloud.google.com/backup-disaster-recovery/docs/reference/rest/v1/projects.locations.serviceConfig) * * ## Example Usage * * ### Backup Dr Service Config * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const bpa1 = new gcp.backupdisasterrecovery.ServiceConfig("bpa1", { * location: "us-central1", * resourceType: "compute.googleapis.com/Instance", * }); * ``` * * ## Import * * This resource does not support import. */ class ServiceConfig extends pulumi.CustomResource { /** * Get an existing ServiceConfig 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 ServiceConfig(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ServiceConfig. 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'] === ServiceConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["resourceType"] = state ? state.resourceType : undefined; } else { const args = argsOrState; if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.resourceType === undefined) && !opts.urn) { throw new Error("Missing required property 'resourceType'"); } resourceInputs["location"] = args ? args.location : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["resourceType"] = args ? args.resourceType : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ServiceConfig.__pulumiType, name, resourceInputs, opts); } } exports.ServiceConfig = ServiceConfig; /** @internal */ ServiceConfig.__pulumiType = 'gcp:backupdisasterrecovery/serviceConfig:ServiceConfig'; //# sourceMappingURL=serviceConfig.js.map