UNPKG

@pulumi/gcp

Version:

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

148 lines 6.88 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! *** 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.V2FolderNotificationConfig = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * This is a continuous export that exports findings to a Pub/Sub topic. * * To get more information about FolderNotificationConfig, see: * * * [API documentation](https://cloud.google.com/security-command-center/docs/reference/rest/v2/folders.locations.notificationConfigs) * * How-to Guides * * [Official Documentation](https://cloud.google.com/security-command-center/docs) * * ## Example Usage * * ### Scc V2 Folder Notification Config Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const folder = new gcp.organizations.Folder("folder", { * parent: "organizations/123456789", * displayName: "folder-name", * }); * const sccV2FolderNotificationConfig = new gcp.pubsub.Topic("scc_v2_folder_notification_config", {name: "my-topic"}); * const customNotificationConfig = new gcp.securitycenter.V2FolderNotificationConfig("custom_notification_config", { * configId: "my-config", * folder: folder.folderId, * location: "global", * description: "My custom Cloud Security Command Center Finding Notification Configuration", * pubsubTopic: sccV2FolderNotificationConfig.id, * streamingConfig: { * filter: "category = \"OPEN_FIREWALL\" AND state = \"ACTIVE\"", * }, * }); * ``` * * ## Import * * FolderNotificationConfig can be imported using any of these accepted formats: * * * `folders/{{folder}}/locations/{{location}}/notificationConfigs/{{config_id}}` * * `{{folder}}/{{location}}/{{config_id}}` * * When using the `pulumi import` command, FolderNotificationConfig can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:securitycenter/v2FolderNotificationConfig:V2FolderNotificationConfig default folders/{{folder}}/locations/{{location}}/notificationConfigs/{{config_id}} * $ pulumi import gcp:securitycenter/v2FolderNotificationConfig:V2FolderNotificationConfig default {{folder}}/{{location}}/{{config_id}} * ``` */ class V2FolderNotificationConfig extends pulumi.CustomResource { /** * Get an existing V2FolderNotificationConfig 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 V2FolderNotificationConfig(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:securitycenter/v2FolderNotificationConfig:V2FolderNotificationConfig'; /** * Returns true if the given object is an instance of V2FolderNotificationConfig. 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'] === V2FolderNotificationConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["configId"] = state?.configId; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["folder"] = state?.folder; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["pubsubTopic"] = state?.pubsubTopic; resourceInputs["serviceAccount"] = state?.serviceAccount; resourceInputs["streamingConfig"] = state?.streamingConfig; } else { const args = argsOrState; if (args?.configId === undefined && !opts.urn) { throw new Error("Missing required property 'configId'"); } if (args?.folder === undefined && !opts.urn) { throw new Error("Missing required property 'folder'"); } if (args?.pubsubTopic === undefined && !opts.urn) { throw new Error("Missing required property 'pubsubTopic'"); } if (args?.streamingConfig === undefined && !opts.urn) { throw new Error("Missing required property 'streamingConfig'"); } resourceInputs["configId"] = args?.configId; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["folder"] = args?.folder; resourceInputs["location"] = args?.location; resourceInputs["pubsubTopic"] = args?.pubsubTopic; resourceInputs["streamingConfig"] = args?.streamingConfig; resourceInputs["name"] = undefined /*out*/; resourceInputs["serviceAccount"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(V2FolderNotificationConfig.__pulumiType, name, resourceInputs, opts); } } exports.V2FolderNotificationConfig = V2FolderNotificationConfig; //# sourceMappingURL=v2folderNotificationConfig.js.map