@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
123 lines • 5.81 kB
JavaScript
;
// *** 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.V2ProjectNotificationConfig = 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 ProjectNotificationConfig, see:
*
* * [API documentation](https://cloud.google.com/security-command-center/docs/reference/rest/v2/projects.locations.notificationConfigs)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/security-command-center/docs)
*
* ## Example Usage
*
* ### Scc V2 Project Notification Config Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const sccV2ProjectNotification = new gcp.pubsub.Topic("scc_v2_project_notification", {name: "my-topic"});
* const customNotificationConfig = new gcp.securitycenter.V2ProjectNotificationConfig("custom_notification_config", {
* configId: "my-config",
* project: "my-project-name",
* location: "global",
* description: "My custom Cloud Security Command Center Finding Notification Configuration",
* pubsubTopic: sccV2ProjectNotification.id,
* streamingConfig: {
* filter: "category = \"OPEN_FIREWALL\" AND state = \"ACTIVE\"",
* },
* });
* ```
*
* ## Import
*
* ProjectNotificationConfig can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/notificationConfigs/{{config_id}}`
*
* * `{{project}}/{{location}}/{{config_id}}`
*
* * `{{location}}/{{config_id}}`
*
* When using the `pulumi import` command, ProjectNotificationConfig can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:securitycenter/v2ProjectNotificationConfig:V2ProjectNotificationConfig default projects/{{project}}/locations/{{location}}/notificationConfigs/{{config_id}}
* ```
*
* ```sh
* $ pulumi import gcp:securitycenter/v2ProjectNotificationConfig:V2ProjectNotificationConfig default {{project}}/{{location}}/{{config_id}}
* ```
*
* ```sh
* $ pulumi import gcp:securitycenter/v2ProjectNotificationConfig:V2ProjectNotificationConfig default {{location}}/{{config_id}}
* ```
*/
class V2ProjectNotificationConfig extends pulumi.CustomResource {
/**
* Get an existing V2ProjectNotificationConfig 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 V2ProjectNotificationConfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of V2ProjectNotificationConfig. 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'] === V2ProjectNotificationConfig.__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["location"] = state ? state.location : 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.streamingConfig === undefined) && !opts.urn) {
throw new Error("Missing required property 'streamingConfig'");
}
resourceInputs["configId"] = args ? args.configId : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["location"] = args ? args.location : 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(V2ProjectNotificationConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.V2ProjectNotificationConfig = V2ProjectNotificationConfig;
/** @internal */
V2ProjectNotificationConfig.__pulumiType = 'gcp:securitycenter/v2ProjectNotificationConfig:V2ProjectNotificationConfig';
//# sourceMappingURL=v2projectNotificationConfig.js.map