UNPKG

@pulumi/gcp

Version:

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

127 lines 6.06 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.V2FolderNotificationConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.configId : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["folder"] = state ? state.folder : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["pubsubTopic"] = state ? state.pubsubTopic : undefined; resourceInputs["serviceAccount"] = state ? state.serviceAccount : undefined; resourceInputs["streamingConfig"] = state ? state.streamingConfig : undefined; } else { const args = argsOrState; if ((!args || args.configId === undefined) && !opts.urn) { throw new Error("Missing required property 'configId'"); } if ((!args || args.folder === undefined) && !opts.urn) { throw new Error("Missing required property 'folder'"); } if ((!args || args.pubsubTopic === undefined) && !opts.urn) { throw new Error("Missing required property 'pubsubTopic'"); } if ((!args || args.streamingConfig === undefined) && !opts.urn) { throw new Error("Missing required property 'streamingConfig'"); } resourceInputs["configId"] = args ? args.configId : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["folder"] = args ? args.folder : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["pubsubTopic"] = args ? args.pubsubTopic : undefined; resourceInputs["streamingConfig"] = args ? args.streamingConfig : undefined; resourceInputs["name"] = undefined /*out*/; resourceInputs["serviceAccount"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(V2FolderNotificationConfig.__pulumiType, name, resourceInputs, opts); } } exports.V2FolderNotificationConfig = V2FolderNotificationConfig; /** @internal */ V2FolderNotificationConfig.__pulumiType = 'gcp:securitycenter/v2FolderNotificationConfig:V2FolderNotificationConfig'; //# sourceMappingURL=v2folderNotificationConfig.js.map