UNPKG

@pulumi/gcp

Version:

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

117 lines 5.65 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.ProjectNotificationConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A Cloud Security Command Center (Cloud SCC) notification configs. A * notification config is a Cloud SCC resource that contains the * configuration to send notifications for create/update events of * findings, assets and etc. * > **Note:** In order to use Cloud SCC resources, your organization must be enrolled * in [SCC Standard/Premium](https://cloud.google.com/security-command-center/docs/quickstart-security-command-center). * Without doing so, you may run into errors during resource creation. * * To get more information about ProjectNotificationConfig, see: * * * [API documentation](https://cloud.google.com/security-command-center/docs/reference/rest/v1/projects.notificationConfigs) * * How-to Guides * * [Official Documentation](https://cloud.google.com/security-command-center/docs) * * ## Example Usage * * ### Scc Project Notification Config Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const sccProjectNotification = new gcp.pubsub.Topic("scc_project_notification", {name: "my-topic"}); * const customNotificationConfig = new gcp.securitycenter.ProjectNotificationConfig("custom_notification_config", { * configId: "my-config", * project: "my-project-name", * description: "My custom Cloud Security Command Center Finding Notification Configuration", * pubsubTopic: sccProjectNotification.id, * streamingConfig: { * filter: "category = \"OPEN_FIREWALL\" AND state = \"ACTIVE\"", * }, * }); * ``` * * ## Import * * ProjectNotificationConfig can be imported using any of these accepted formats: * * * `{{name}}` * * When using the `pulumi import` command, ProjectNotificationConfig can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:securitycenter/projectNotificationConfig:ProjectNotificationConfig default {{name}} * ``` */ class ProjectNotificationConfig extends pulumi.CustomResource { /** * Get an existing ProjectNotificationConfig 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 ProjectNotificationConfig(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ProjectNotificationConfig. 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'] === ProjectNotificationConfig.__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["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : 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.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["project"] = args ? args.project : 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(ProjectNotificationConfig.__pulumiType, name, resourceInputs, opts); } } exports.ProjectNotificationConfig = ProjectNotificationConfig; /** @internal */ ProjectNotificationConfig.__pulumiType = 'gcp:securitycenter/projectNotificationConfig:ProjectNotificationConfig'; //# sourceMappingURL=projectNotificationConfig.js.map