UNPKG

@pulumi/gcp

Version:

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

121 lines 5.21 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.OrganizationExclusion = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Manages an organization-level logging exclusion. For more information see: * * * [API documentation](https://cloud.google.com/logging/docs/reference/v2/rest/v2/organizations.exclusions) * * How-to Guides * * [Excluding Logs](https://cloud.google.com/logging/docs/exclusions) * * > You can specify exclusions for log sinks created by the provider by using the exclusions field of `gcp.logging.OrganizationSink` * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const my_exclusion = new gcp.logging.OrganizationExclusion("my-exclusion", { * name: "my-instance-debug-exclusion", * orgId: "123456789", * description: "Exclude GCE instance debug logs", * filter: "resource.type = gce_instance AND severity <= DEBUG", * }); * ``` * * ## Import * * Organization-level logging exclusions can be imported using their URI, e.g. * * * `organizations/{{organization}}/exclusions/{{name}}` * * When using the `pulumi import` command, organization-level logging exclusions can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:logging/organizationExclusion:OrganizationExclusion default organizations/{{organization}}/exclusions/{{name}} * ``` */ class OrganizationExclusion extends pulumi.CustomResource { /** * Get an existing OrganizationExclusion 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 OrganizationExclusion(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:logging/organizationExclusion:OrganizationExclusion'; /** * Returns true if the given object is an instance of OrganizationExclusion. 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'] === OrganizationExclusion.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state?.description; resourceInputs["disabled"] = state?.disabled; resourceInputs["filter"] = state?.filter; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; } else { const args = argsOrState; if (args?.filter === undefined && !opts.urn) { throw new Error("Missing required property 'filter'"); } if (args?.orgId === undefined && !opts.urn) { throw new Error("Missing required property 'orgId'"); } resourceInputs["description"] = args?.description; resourceInputs["disabled"] = args?.disabled; resourceInputs["filter"] = args?.filter; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(OrganizationExclusion.__pulumiType, name, resourceInputs, opts); } } exports.OrganizationExclusion = OrganizationExclusion; //# sourceMappingURL=organizationExclusion.js.map