@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
146 lines • 5.64 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProjectFeed = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Describes a Cloud Asset Inventory feed used to to listen to asset updates.
*
* To get more information about ProjectFeed, see:
*
* * [API documentation](https://cloud.google.com/asset-inventory/docs/reference/rest/)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/asset-inventory/docs)
*
* ## Example Usage
*
* ### Cloud Asset Project Feed
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* // The topic where the resource change notifications will be sent.
* const feedOutput = new gcp.pubsub.Topic("feed_output", {
* project: "my-project-name",
* name: "network-updates",
* });
* // Create a feed that sends notifications about network resource updates.
* const projectFeed = new gcp.cloudasset.ProjectFeed("project_feed", {
* project: "my-project-name",
* feedId: "network-updates",
* contentType: "RESOURCE",
* assetTypes: [
* "compute.googleapis.com/Subnetwork",
* "compute.googleapis.com/Network",
* ],
* feedOutputConfig: {
* pubsubDestination: {
* topic: feedOutput.id,
* },
* },
* condition: {
* expression: `!temporal_asset.deleted &&
* temporal_asset.prior_asset_state == google.cloud.asset.v1.TemporalAsset.PriorAssetState.DOES_NOT_EXIST
* `,
* title: "created",
* description: "Send notifications on creation events",
* },
* });
* // Find the project number of the project whose identity will be used for sending
* // the asset change notifications.
* const project = gcp.organizations.getProject({
* projectId: "my-project-name",
* });
* ```
*
* ## Import
*
* ProjectFeed can be imported using any of these accepted formats:
*
* * `projects/{{project}}/feeds/{{name}}`
*
* * `{{project}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, ProjectFeed can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:cloudasset/projectFeed:ProjectFeed default projects/{{project}}/feeds/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:cloudasset/projectFeed:ProjectFeed default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:cloudasset/projectFeed:ProjectFeed default {{name}}
* ```
*/
class ProjectFeed extends pulumi.CustomResource {
/**
* Get an existing ProjectFeed 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 ProjectFeed(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ProjectFeed. 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'] === ProjectFeed.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["assetNames"] = state?.assetNames;
resourceInputs["assetTypes"] = state?.assetTypes;
resourceInputs["billingProject"] = state?.billingProject;
resourceInputs["condition"] = state?.condition;
resourceInputs["contentType"] = state?.contentType;
resourceInputs["feedId"] = state?.feedId;
resourceInputs["feedOutputConfig"] = state?.feedOutputConfig;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
}
else {
const args = argsOrState;
if (args?.feedId === undefined && !opts.urn) {
throw new Error("Missing required property 'feedId'");
}
if (args?.feedOutputConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'feedOutputConfig'");
}
resourceInputs["assetNames"] = args?.assetNames;
resourceInputs["assetTypes"] = args?.assetTypes;
resourceInputs["billingProject"] = args?.billingProject;
resourceInputs["condition"] = args?.condition;
resourceInputs["contentType"] = args?.contentType;
resourceInputs["feedId"] = args?.feedId;
resourceInputs["feedOutputConfig"] = args?.feedOutputConfig;
resourceInputs["project"] = args?.project;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ProjectFeed.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProjectFeed = ProjectFeed;
/** @internal */
ProjectFeed.__pulumiType = 'gcp:cloudasset/projectFeed:ProjectFeed';
//# sourceMappingURL=projectFeed.js.map
;