UNPKG

@pulumi/gcp

Version:

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

94 lines 4.13 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.ProjectExclusion = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a project-level logging exclusion. For more information see: * * * [API documentation](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.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.ProjectSink` * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const my_exclusion = new gcp.logging.ProjectExclusion("my-exclusion", { * name: "my-instance-debug-exclusion", * description: "Exclude GCE instance debug logs", * filter: "resource.type = gce_instance AND severity <= DEBUG", * }); * ``` * * ## Import * * Project-level logging exclusions can be imported using their URI, e.g. * * * `projects/{{project_id}}/exclusions/{{name}}` * * When using the `pulumi import` command, project-level logging exclusions can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:logging/projectExclusion:ProjectExclusion default projects/{{project_id}}/exclusions/{{name}} * ``` */ class ProjectExclusion extends pulumi.CustomResource { /** * Get an existing ProjectExclusion 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 ProjectExclusion(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ProjectExclusion. 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'] === ProjectExclusion.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["filter"] = state ? state.filter : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; } else { const args = argsOrState; if ((!args || args.filter === undefined) && !opts.urn) { throw new Error("Missing required property 'filter'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["filter"] = args ? args.filter : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ProjectExclusion.__pulumiType, name, resourceInputs, opts); } } exports.ProjectExclusion = ProjectExclusion; /** @internal */ ProjectExclusion.__pulumiType = 'gcp:logging/projectExclusion:ProjectExclusion'; //# sourceMappingURL=projectExclusion.js.map