@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
140 lines • 5.94 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProjectSettings = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Manages Cloud Observability settings for a project.
*
* > **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
* See Provider Versions for more details on beta resources.
*
* ## Example Usage
*
* ### Observability Project Settings Basic Global
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as time from "@pulumiverse/time";
*
* const project = new gcp.organizations.Project("project", {
* projectId: "tf-test_41898",
* name: "tf-test_63399",
* orgId: "123456789",
* deletionPolicy: "DELETE",
* });
* const observabilityApi = new gcp.projects.Service("observability_api", {
* project: project.projectId,
* service: "observability.googleapis.com",
* disableOnDestroy: false,
* });
* // Wait for the project to be created and recognized by the Observability API
* const waitForSettingsPropagation = new time.Sleep("wait_for_settings_propagation", {createDuration: "90s"}, {
* dependsOn: [observabilityApi],
* });
* const primaryGlobal = new gcp.observability.ProjectSettings("primary_global", {
* location: "global",
* project: project.projectId,
* defaultStorageLocation: "eu",
* }, {
* dependsOn: [waitForSettingsPropagation],
* });
* ```
*
* ## Import
*
* ProjectSettings can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/settings`
* * `{{project}}/{{location}}`
* * `{{location}}`
*
* When using the `pulumi import` command, ProjectSettings can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:observability/projectSettings:ProjectSettings default projects/{{project}}/locations/{{location}}/settings
* $ pulumi import gcp:observability/projectSettings:ProjectSettings default {{project}}/{{location}}
* $ pulumi import gcp:observability/projectSettings:ProjectSettings default {{location}}
* ```
*/
class ProjectSettings extends pulumi.CustomResource {
/**
* Get an existing ProjectSettings 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 ProjectSettings(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:observability/projectSettings:ProjectSettings';
/**
* Returns true if the given object is an instance of ProjectSettings. 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'] === ProjectSettings.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["defaultStorageLocation"] = state?.defaultStorageLocation;
resourceInputs["kmsKeyName"] = state?.kmsKeyName;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["serviceAccountId"] = state?.serviceAccountId;
}
else {
const args = argsOrState;
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["defaultStorageLocation"] = args?.defaultStorageLocation;
resourceInputs["kmsKeyName"] = args?.kmsKeyName;
resourceInputs["location"] = args?.location;
resourceInputs["project"] = args?.project;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["serviceAccountId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ProjectSettings.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProjectSettings = ProjectSettings;
//# sourceMappingURL=projectSettings.js.map