import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * * [API documentation](https://cloud.google.com/logging/docs/reference/v2/rest/v2/billingAccounts.sinks) * * How-to Guides * * [Exporting Logs](https://cloud.google.com/logging/docs/export) * * > **Note** You must have the "Logs Configuration Writer" IAM role (`roles/logging.configWriter`) * [granted on the billing account](https://cloud.google.com/billing/reference/rest/v1/billingAccounts/getIamPolicy) to * the credentials used with this provider. [IAM roles granted on a billing account](https://cloud.google.com/billing/docs/how-to/billing-access) are separate from the * typical IAM roles granted on a project. * * ## 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: "billing-logging-bucket", * location: "US", * }); * const my_sink = new gcp.logging.BillingAccountSink("my-sink", { * name: "my-sink", * description: "some explanation on what this is", * billingAccount: "ABCDEF-012345-GHIJKL", * destination: pulumi.interpolate`storage.googleapis.com/${log_bucket.name}`, * }); * const log_writer = new gcp.projects.IAMBinding("log-writer", { * project: "your-project-id", * role: "roles/storage.objectCreator", * members: [my_sink.writerIdentity], * }); * ``` * * ## Import * * Billing account logging sinks can be imported using this format: * * * `billingAccounts/{{billing_account_id}}/sinks/{{sink_id}}` * * When using the `pulumi import` command, billing account logging sinks can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:logging/billingAccountSink:BillingAccountSink default billingAccounts/{{billing_account_id}}/sinks/{{sink_id}} * ``` */ export declare class BillingAccountSink extends pulumi.CustomResource { /** * Get an existing BillingAccountSink 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?: BillingAccountSinkState, opts?: pulumi.CustomResourceOptions): BillingAccountSink; /** * Returns true if the given object is an instance of BillingAccountSink. 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 BillingAccountSink; /** * Options that affect sinks exporting data to BigQuery. Structure documented below. */ readonly bigqueryOptions: pulumi.Output; /** * The billing account exported to the sink. */ readonly billingAccount: 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 or a Cloud Logging bucket. 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]` * * 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 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 BillingAccountSink 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: BillingAccountSinkArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering BillingAccountSink resources. */ export interface BillingAccountSinkState { /** * Options that affect sinks exporting data to BigQuery. Structure documented below. */ bigqueryOptions?: pulumi.Input; /** * The billing account exported to the sink. */ billingAccount?: 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 or a Cloud Logging bucket. 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]` * * 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 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 BillingAccountSink resource. */ export interface BillingAccountSinkArgs { /** * Options that affect sinks exporting data to BigQuery. Structure documented below. */ bigqueryOptions?: pulumi.Input; /** * The billing account exported to the sink. */ billingAccount: 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 or a Cloud Logging bucket. 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]` * * 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 name of the logging sink. */ name?: pulumi.Input; }