import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a folder-level logging sink. For more information see: * * [API documentation](https://cloud.google.com/logging/docs/reference/v2/rest/v2/folders.sinks) * * How-to Guides * * [Exporting Logs](https://cloud.google.com/logging/docs/export) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const log_bucket = new gcp.storage.Bucket("log-bucket", { * name: "folder-logging-bucket", * location: "US", * }); * const my_folder = new gcp.organizations.Folder("my-folder", { * displayName: "My folder", * parent: "organizations/123456", * }); * const my_sink = new gcp.logging.FolderSink("my-sink", { * name: "my-sink", * description: "some explanation on what this is", * folder: my_folder.name, * destination: pulumi.interpolate`storage.googleapis.com/${log_bucket.name}`, * filter: "resource.type = gce_instance AND severity >= WARNING", * }); * const log_writer = new gcp.projects.IAMBinding("log-writer", { * project: "your-project-id", * role: "roles/storage.objectCreator", * members: [my_sink.writerIdentity], * }); * ``` * * ## Import * * Folder-level logging sinks can be imported using this format: * * * `folders/{{folder_id}}/sinks/{{name}}` * * When using the `pulumi import` command, folder-level logging sinks can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:logging/folderSink:FolderSink default folders/{{folder_id}}/sinks/{{name}} * ``` */ export declare class FolderSink extends pulumi.CustomResource { /** * Get an existing FolderSink 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: string, id: pulumi.Input, state?: FolderSinkState, opts?: pulumi.CustomResourceOptions): FolderSink; /** * Returns true if the given object is an instance of FolderSink. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is FolderSink; /** * Options that affect sinks exporting data to BigQuery. Structure documented below. */ readonly bigqueryOptions: pulumi.Output; /** * A description of this sink. The maximum length of the description is 8000 characters. */ readonly description: pulumi.Output; /** * The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples: * * - `storage.googleapis.com/[GCS_BUCKET]` * - `bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]` * - `pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]` * - `logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]` * - `logging.googleapis.com/projects/[PROJECT_ID]` * * The writer associated with the sink must have access to write to the above resource. */ readonly destination: pulumi.Output; /** * If set to True, then this sink is disabled and it does not export any log entries. */ readonly disabled: pulumi.Output; /** * Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. */ readonly exclusions: pulumi.Output; /** * The filter to apply when exporting logs. Only log entries that match the filter are exported. * See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced_filters) for information on how to * write a filter. */ readonly filter: pulumi.Output; /** * The folder to be exported to the sink. Note that either `[FOLDER_ID]` or `folders/[FOLDER_ID]` is * accepted. */ readonly folder: pulumi.Output; /** * Whether or not to include children folders in the sink export. If true, logs * associated with child projects are also exported; otherwise only logs relating to the provided folder are included. */ readonly includeChildren: pulumi.Output; /** * Whether or not to intercept logs from child projects. If true, matching logs will not * match with sinks in child resources, except _Required sinks. This sink will be visible to child resources when listing sinks. */ readonly interceptChildren: pulumi.Output; /** * The name of the logging sink. */ readonly name: pulumi.Output; /** * The identity associated with this sink. This identity must be granted write access to the * configured `destination`. */ readonly writerIdentity: pulumi.Output; /** * Create a FolderSink resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: FolderSinkArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FolderSink resources. */ export interface FolderSinkState { /** * Options that affect sinks exporting data to BigQuery. Structure documented below. */ bigqueryOptions?: pulumi.Input; /** * A description of this sink. The maximum length of the description is 8000 characters. */ description?: pulumi.Input; /** * The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples: * * - `storage.googleapis.com/[GCS_BUCKET]` * - `bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]` * - `pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]` * - `logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]` * - `logging.googleapis.com/projects/[PROJECT_ID]` * * The writer associated with the sink must have access to write to the above resource. */ destination?: pulumi.Input; /** * If set to True, then this sink is disabled and it does not export any log entries. */ disabled?: pulumi.Input; /** * Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. */ exclusions?: pulumi.Input[]>; /** * The filter to apply when exporting logs. Only log entries that match the filter are exported. * See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced_filters) for information on how to * write a filter. */ filter?: pulumi.Input; /** * The folder to be exported to the sink. Note that either `[FOLDER_ID]` or `folders/[FOLDER_ID]` is * accepted. */ folder?: pulumi.Input; /** * Whether or not to include children folders in the sink export. If true, logs * associated with child projects are also exported; otherwise only logs relating to the provided folder are included. */ includeChildren?: pulumi.Input; /** * Whether or not to intercept logs from child projects. If true, matching logs will not * match with sinks in child resources, except _Required sinks. This sink will be visible to child resources when listing sinks. */ interceptChildren?: pulumi.Input; /** * The name of the logging sink. */ name?: pulumi.Input; /** * The identity associated with this sink. This identity must be granted write access to the * configured `destination`. */ writerIdentity?: pulumi.Input; } /** * The set of arguments for constructing a FolderSink resource. */ export interface FolderSinkArgs { /** * Options that affect sinks exporting data to BigQuery. Structure documented below. */ bigqueryOptions?: pulumi.Input; /** * A description of this sink. The maximum length of the description is 8000 characters. */ description?: pulumi.Input; /** * The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples: * * - `storage.googleapis.com/[GCS_BUCKET]` * - `bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]` * - `pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]` * - `logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]` * - `logging.googleapis.com/projects/[PROJECT_ID]` * * The writer associated with the sink must have access to write to the above resource. */ destination: pulumi.Input; /** * If set to True, then this sink is disabled and it does not export any log entries. */ disabled?: pulumi.Input; /** * Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. */ exclusions?: pulumi.Input[]>; /** * The filter to apply when exporting logs. Only log entries that match the filter are exported. * See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced_filters) for information on how to * write a filter. */ filter?: pulumi.Input; /** * The folder to be exported to the sink. Note that either `[FOLDER_ID]` or `folders/[FOLDER_ID]` is * accepted. */ folder: pulumi.Input; /** * Whether or not to include children folders in the sink export. If true, logs * associated with child projects are also exported; otherwise only logs relating to the provided folder are included. */ includeChildren?: pulumi.Input; /** * Whether or not to intercept logs from child projects. If true, matching logs will not * match with sinks in child resources, except _Required sinks. This sink will be visible to child resources when listing sinks. */ interceptChildren?: pulumi.Input; /** * The name of the logging sink. */ name?: pulumi.Input; }