UNPKG

@pulumi/gcp

Version:

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

177 lines • 7.42 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.FolderFeed = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Describes a Cloud Asset Inventory feed used to to listen to asset updates. * * To get more information about FolderFeed, 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 Folder 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", * }); * // The folder that will be monitored for resource updates. * const myFolder = new gcp.organizations.Folder("my_folder", { * displayName: "Networking", * parent: "organizations/123456789", * deletionProtection: false, * }); * // Create a feed that sends notifications about network resource updates under a * // particular folder. * const folderFeed = new gcp.cloudasset.FolderFeed("folder_feed", { * billingProject: "my-project-name", * folder: myFolder.folderId, * 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 * * FolderFeed can be imported using any of these accepted formats: * * * `folders/{{folder_id}}/feeds/{{name}}` * * `{{folder_id}}/{{name}}` * * When using the `pulumi import` command, FolderFeed can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudasset/folderFeed:FolderFeed default folders/{{folder_id}}/feeds/{{name}} * $ pulumi import gcp:cloudasset/folderFeed:FolderFeed default {{folder_id}}/{{name}} * ``` */ class FolderFeed extends pulumi.CustomResource { /** * Get an existing FolderFeed 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 FolderFeed(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:cloudasset/folderFeed:FolderFeed'; /** * Returns true if the given object is an instance of FolderFeed. 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'] === FolderFeed.__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["deletionPolicy"] = state?.deletionPolicy; resourceInputs["feedId"] = state?.feedId; resourceInputs["feedOutputConfig"] = state?.feedOutputConfig; resourceInputs["folder"] = state?.folder; resourceInputs["folderId"] = state?.folderId; resourceInputs["name"] = state?.name; } else { const args = argsOrState; if (args?.billingProject === undefined && !opts.urn) { throw new Error("Missing required property 'billingProject'"); } 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'"); } if (args?.folder === undefined && !opts.urn) { throw new Error("Missing required property 'folder'"); } resourceInputs["assetNames"] = args?.assetNames; resourceInputs["assetTypes"] = args?.assetTypes; resourceInputs["billingProject"] = args?.billingProject; resourceInputs["condition"] = args?.condition; resourceInputs["contentType"] = args?.contentType; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["feedId"] = args?.feedId; resourceInputs["feedOutputConfig"] = args?.feedOutputConfig; resourceInputs["folder"] = args?.folder; resourceInputs["folderId"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FolderFeed.__pulumiType, name, resourceInputs, opts); } } exports.FolderFeed = FolderFeed; //# sourceMappingURL=folderFeed.js.map