This page documents the language specification for the gcp package. If you're looking for help working with the inputs, outputs, or functions of gcp resources in a Pulumi program, please see the resource documentation for examples and API reference.
logging¶
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.
- class
pulumi_gcp.logging.BillingAccountBucketConfig(resource_name, opts=None, billing_account=None, bucket_id=None, description=None, location=None, retention_days=None, __props__=None, __name__=None, __opts__=None)¶ Manages a billing account level logging bucket config. For more information see the official logging documentation and Storing Logs.
Note: Logging buckets are automatically created for a given folder, project, organization, billingAccount and cannot be deleted. Creating a resource of this type will acquire and update the resource that already exists at the desired location. These buckets cannot be removed so deleting this resource will remove the bucket config from your state but will leave the logging bucket unchanged. The buckets that are currently automatically created are “_Default” and “_Required”.
import pulumi import pulumi_gcp as gcp default = gcp.organizations.get_billing_account(billing_account="00AA00-000AAA-00AA0A") basic = gcp.logging.BillingAccountBucketConfig("basic", billing_account=default.billing_account, location="global", retention_days=30, bucket_id="_Default")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
billing_account (pulumi.Input[str]) – The parent resource that contains the logging bucket.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
billing_account: pulumi.Output[str] = None¶The parent resource that contains the logging bucket.
bucket_id: pulumi.Output[str] = None¶The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.
description: pulumi.Output[str] = None¶Describes this bucket.
lifecycle_state: pulumi.Output[str] = None¶The bucket’s lifecycle such as active or deleted. See LifecycleState.
location: pulumi.Output[str] = None¶The location of the bucket. The supported locations are: “global” “us-central1”
name: pulumi.Output[str] = None¶The resource name of the bucket. For example: “projects/my-project-id/locations/my-location/buckets/my-bucket-id”
retention_days: pulumi.Output[float] = None¶Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
- static
get(resource_name, id, opts=None, billing_account=None, bucket_id=None, description=None, lifecycle_state=None, location=None, name=None, retention_days=None)¶ Get an existing BillingAccountBucketConfig resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
billing_account (pulumi.Input[str]) – The parent resource that contains the logging bucket.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
lifecycle_state (pulumi.Input[str]) –
The bucket’s lifecycle such as active or deleted. See LifecycleState.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
name (pulumi.Input[str]) – The resource name of the bucket. For example: “projects/my-project-id/locations/my-location/buckets/my-bucket-id”
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.BillingAccountExclusion(resource_name, opts=None, billing_account=None, description=None, disabled=None, filter=None, name=None, __props__=None, __name__=None, __opts__=None)¶ Manages a billing account logging exclusion. For more information see the official documentation and Excluding Logs.
Note that you must have the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) granted to the credentials used with the provider.import pulumi import pulumi_gcp as gcp my_exclusion = gcp.logging.BillingAccountExclusion("my-exclusion", billing_account="ABCDEF-012345-GHIJKL", description="Exclude GCE instance debug logs", filter="resource.type = gce_instance AND severity <= DEBUG")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
billing_account (pulumi.Input[str]) – The billing account to create the exclusion for.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) – The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging exclusion.
billing_account: pulumi.Output[str] = None¶The billing account to create the exclusion for.
description: pulumi.Output[str] = None¶A human-readable description.
disabled: pulumi.Output[bool] = None¶Whether this exclusion rule should be disabled or not. This defaults to false.
filter: pulumi.Output[str] = None¶The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name: pulumi.Output[str] = None¶The name of the logging exclusion.
- static
get(resource_name, id, opts=None, billing_account=None, description=None, disabled=None, filter=None, name=None)¶ Get an existing BillingAccountExclusion resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
billing_account (pulumi.Input[str]) – The billing account to create the exclusion for.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) –
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging exclusion.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.BillingAccountSink(resource_name, opts=None, bigquery_options=None, billing_account=None, destination=None, filter=None, name=None, __props__=None, __name__=None, __opts__=None)¶ Manages a billing account logging sink. For more information see the official documentation and Exporting Logs in the API.
Note You must have the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) granted on the billing account to the credentials used with this provider. IAM roles granted on a billing account are separate from the typical IAM roles granted on a project.import pulumi import pulumi_gcp as gcp log_bucket = gcp.storage.Bucket("log-bucket") my_sink = gcp.logging.BillingAccountSink("my-sink", billing_account="ABCDEF-012345-GHIJKL", destination=log_bucket.name.apply(lambda name: f"storage.googleapis.com/{name}")) log_writer = gcp.projects.IAMBinding("log-writer", role="roles/storage.objectCreator", members=[my_sink.writer_identity])
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
billing_account (pulumi.Input[str]) – The billing account exported to the sink.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
```python import pulumi ``` The writer associated with the sink must have access to write to the above resource.
- Parameters
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging sink.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
bigquery_options: pulumi.Output[dict] = None¶Options that affect sinks exporting data to BigQuery. Structure documented below.
usePartitionedTables(bool) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
billing_account: pulumi.Output[str] = None¶The billing account exported to the sink.
destination: pulumi.Output[str] = None¶The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
import pulumi
The writer associated with the sink must have access to write to the above resource.
filter: pulumi.Output[str] = None¶The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
name: pulumi.Output[str] = None¶The name of the logging sink.
writer_identity: pulumi.Output[str] = None¶The identity associated with this sink. This identity must be granted write access to the configured
destination.
- static
get(resource_name, id, opts=None, bigquery_options=None, billing_account=None, destination=None, filter=None, name=None, writer_identity=None)¶ Get an existing BillingAccountSink resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
billing_account (pulumi.Input[str]) – The billing account exported to the sink.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
```python import pulumi ``` The writer associated with the sink must have access to write to the above resource.
- Parameters
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging sink.
writer_identity (pulumi.Input[str]) – The identity associated with this sink. This identity must be granted write access to the configured
destination.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.FolderBucketConfig(resource_name, opts=None, bucket_id=None, description=None, folder=None, location=None, retention_days=None, __props__=None, __name__=None, __opts__=None)¶ Manages a folder-level logging bucket config. For more information see the official logging documentation and Storing Logs.
Note: Logging buckets are automatically created for a given folder, project, organization, billingAccount and cannot be deleted. Creating a resource of this type will acquire and update the resource that already exists at the desired location. These buckets cannot be removed so deleting this resource will remove the bucket config from your state but will leave the logging bucket unchanged. The buckets that are currently automatically created are “_Default” and “_Required”.
import pulumi import pulumi_gcp as gcp default = gcp.organizations.Folder("default", display_name="some-folder-name", parent="organizations/123456789") basic = gcp.logging.FolderBucketConfig("basic", folder=default.name, location="global", retention_days=30, bucket_id="_Default")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
folder (pulumi.Input[str]) – The parent resource that contains the logging bucket.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
bucket_id: pulumi.Output[str] = None¶The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.
description: pulumi.Output[str] = None¶Describes this bucket.
folder: pulumi.Output[str] = None¶The parent resource that contains the logging bucket.
lifecycle_state: pulumi.Output[str] = None¶The bucket’s lifecycle such as active or deleted. See LifecycleState.
location: pulumi.Output[str] = None¶The location of the bucket. The supported locations are: “global” “us-central1”
name: pulumi.Output[str] = None¶The resource name of the bucket. For example: “folders/my-folder-id/locations/my-location/buckets/my-bucket-id”
retention_days: pulumi.Output[float] = None¶Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
- static
get(resource_name, id, opts=None, bucket_id=None, description=None, folder=None, lifecycle_state=None, location=None, name=None, retention_days=None)¶ Get an existing FolderBucketConfig resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
folder (pulumi.Input[str]) – The parent resource that contains the logging bucket.
lifecycle_state (pulumi.Input[str]) –
The bucket’s lifecycle such as active or deleted. See LifecycleState.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
name (pulumi.Input[str]) – The resource name of the bucket. For example: “folders/my-folder-id/locations/my-location/buckets/my-bucket-id”
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.FolderExclusion(resource_name, opts=None, description=None, disabled=None, filter=None, folder=None, name=None, __props__=None, __name__=None, __opts__=None)¶ Manages a folder-level logging exclusion. For more information see the official documentation and Excluding Logs.
Note that you must have the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) granted to the credentials used with this provider.import pulumi import pulumi_gcp as gcp my_folder = gcp.organizations.Folder("my-folder", display_name="My folder", parent="organizations/123456") my_exclusion = gcp.logging.FolderExclusion("my-exclusion", folder=my_folder.name, description="Exclude GCE instance debug logs", filter="resource.type = gce_instance AND severity <= DEBUG")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) –
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
folder (pulumi.Input[str]) – The folder to be exported to the sink. Note that either [FOLDER_ID] or “folders/[FOLDER_ID]” is accepted.
name (pulumi.Input[str]) – The name of the logging exclusion.
description: pulumi.Output[str] = None¶A human-readable description.
disabled: pulumi.Output[bool] = None¶Whether this exclusion rule should be disabled or not. This defaults to false.
filter: pulumi.Output[str] = None¶The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
folder: pulumi.Output[str] = None¶The folder to be exported to the sink. Note that either [FOLDER_ID] or “folders/[FOLDER_ID]” is accepted.
name: pulumi.Output[str] = None¶The name of the logging exclusion.
- static
get(resource_name, id, opts=None, description=None, disabled=None, filter=None, folder=None, name=None)¶ Get an existing FolderExclusion resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) –
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
folder (pulumi.Input[str]) – The folder to be exported to the sink. Note that either [FOLDER_ID] or “folders/[FOLDER_ID]” is accepted.
name (pulumi.Input[str]) – The name of the logging exclusion.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.FolderSink(resource_name, opts=None, bigquery_options=None, destination=None, filter=None, folder=None, include_children=None, name=None, __props__=None, __name__=None, __opts__=None)¶ Manages a folder-level logging sink. For more information see the official documentation and Exporting Logs in the API.
Note that you must have the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) granted to the credentials used with this provider.import pulumi import pulumi_gcp as gcp log_bucket = gcp.storage.Bucket("log-bucket") my_folder = gcp.organizations.Folder("my-folder", display_name="My folder", parent="organizations/123456") my_sink = gcp.logging.FolderSink("my-sink", folder=my_folder.name, destination=log_bucket.name.apply(lambda name: f"storage.googleapis.com/{name}"), filter="resource.type = gce_instance AND severity >= WARN") log_writer = gcp.projects.IAMBinding("log-writer", role="roles/storage.objectCreator", members=[my_sink.writer_identity])
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples: “storage.googleapis.com/[GCS_BUCKET]” “bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]” “pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]” The writer associated with the sink must have access to write to the above resource.
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
folder (pulumi.Input[str]) – The folder to be exported to the sink. Note that either [FOLDER_ID] or “folders/[FOLDER_ID]” is accepted.
include_children (pulumi.Input[bool]) – 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.
name (pulumi.Input[str]) – The name of the logging sink.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
bigquery_options: pulumi.Output[dict] = None¶Options that affect sinks exporting data to BigQuery. Structure documented below.
usePartitionedTables(bool) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
destination: pulumi.Output[str] = None¶The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples: “storage.googleapis.com/[GCS_BUCKET]” “bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]” “pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]” The writer associated with the sink must have access to write to the above resource.
filter: pulumi.Output[str] = None¶The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
folder: pulumi.Output[str] = None¶The folder to be exported to the sink. Note that either [FOLDER_ID] or “folders/[FOLDER_ID]” is accepted.
include_children: pulumi.Output[bool] = None¶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.
name: pulumi.Output[str] = None¶The name of the logging sink.
writer_identity: pulumi.Output[str] = None¶The identity associated with this sink. This identity must be granted write access to the configured
destination.
- static
get(resource_name, id, opts=None, bigquery_options=None, destination=None, filter=None, folder=None, include_children=None, name=None, writer_identity=None)¶ Get an existing FolderSink resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples: “storage.googleapis.com/[GCS_BUCKET]” “bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]” “pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]” The writer associated with the sink must have access to write to the above resource.
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
folder (pulumi.Input[str]) – The folder to be exported to the sink. Note that either [FOLDER_ID] or “folders/[FOLDER_ID]” is accepted.
include_children (pulumi.Input[bool]) – 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.
name (pulumi.Input[str]) – The name of the logging sink.
writer_identity (pulumi.Input[str]) – The identity associated with this sink. This identity must be granted write access to the configured
destination.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.Metric(resource_name, opts=None, bucket_options=None, description=None, filter=None, label_extractors=None, metric_descriptor=None, name=None, project=None, value_extractor=None, __props__=None, __name__=None, __opts__=None)¶ Logs-based metric can also be used to extract values from logs and create a a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options.
To get more information about Metric, see:
How-to Guides
import pulumi import pulumi_gcp as gcp logging_metric = gcp.logging.Metric("loggingMetric", bucket_options={ "linearBuckets": { "numFiniteBuckets": 3, "offset": 1, "width": 1, }, }, filter="resource.type=gae_app AND severity>=ERROR", label_extractors={ "mass": "EXTRACT(jsonPayload.request)", "sku": "EXTRACT(jsonPayload.id)", }, metric_descriptor={ "display_name": "My metric", "labels": [ { "description": "amount of matter", "key": "mass", "valueType": "STRING", }, { "description": "Identifying number for item", "key": "sku", "valueType": "INT64", }, ], "metricKind": "DELTA", "unit": "1", "valueType": "DISTRIBUTION", }, value_extractor="EXTRACT(jsonPayload.request)")
import pulumi import pulumi_gcp as gcp logging_metric = gcp.logging.Metric("loggingMetric", filter="resource.type=gae_app AND severity>=ERROR", metric_descriptor={ "metricKind": "DELTA", "valueType": "INT64", })
import pulumi import pulumi_gcp as gcp logging_metric = gcp.logging.Metric("loggingMetric", filter="resource.type=gae_app AND severity>=ERROR", label_extractors={ "mass": "EXTRACT(jsonPayload.request)", }, metric_descriptor={ "labels": [{ "description": "amount of matter", "key": "mass", "valueType": "STRING", }], "metricKind": "DELTA", "valueType": "INT64", })
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_options (pulumi.Input[dict]) – The bucketOptions are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values. Structure is documented below.
description (pulumi.Input[str]) – A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.
filter (pulumi.Input[str]) – An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-filters) which is used to match log entries.
label_extractors (pulumi.Input[dict]) – A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the valueExtractor field.
metric_descriptor (pulumi.Input[dict]) – The metric descriptor associated with the logs-based metric. Structure is documented below.
name (pulumi.Input[str]) – The client-assigned metric identifier. Examples - “errorcount”, “nginx/requests”. Metric identifiers are limited to 100 characters and can include only the following characters A-Z, a-z, 0-9, and the special characters *-.,+!’,()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.
project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
value_extractor (pulumi.Input[str]) – A valueExtractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction - EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are 1. field - The name of the log entry field from which the value is to be extracted. 2. regex - A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.
The bucket_options object supports the following:
explicitBuckets(pulumi.Input[dict]) - Specifies a set of buckets with arbitrary widths. Structure is documented below.bounds(pulumi.Input[list]) - The values must be monotonically increasing.
exponentialBuckets(pulumi.Input[dict]) - Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket. Structure is documented below.growthFactor(pulumi.Input[float]) - Must be greater than 1.numFiniteBuckets(pulumi.Input[float]) - Must be greater than 0.scale(pulumi.Input[float]) - Must be greater than 0.
linearBuckets(pulumi.Input[dict]) - Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket. Structure is documented below.numFiniteBuckets(pulumi.Input[float]) - Must be greater than 0.offset(pulumi.Input[float]) - Lower bound of the first bucket.width(pulumi.Input[float]) - Must be greater than 0.
The metric_descriptor object supports the following:
display_name(pulumi.Input[str]) - A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example “Request count”. This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.labels(pulumi.Input[list]) - The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. Structure is documented below.description(pulumi.Input[str]) - A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.key(pulumi.Input[str]) - The label key.valueType(pulumi.Input[str]) - The type of data that can be assigned to the label.
metricKind(pulumi.Input[str]) - Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metricKind and valueType might not be supported. For counter metrics, set this to DELTA.unit(pulumi.Input[str]) - The unit in which the metric value is reported. It is only applicable if the valueType isINT64,DOUBLE, orDISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure standardvalueType(pulumi.Input[str]) - The type of data that can be assigned to the label.
bucket_options: pulumi.Output[dict] = None¶The bucketOptions are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values. Structure is documented below.
explicitBuckets(dict) - Specifies a set of buckets with arbitrary widths. Structure is documented below.bounds(list) - The values must be monotonically increasing.
exponentialBuckets(dict) - Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket. Structure is documented below.growthFactor(float) - Must be greater than 1.numFiniteBuckets(float) - Must be greater than 0.scale(float) - Must be greater than 0.
linearBuckets(dict) - Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket. Structure is documented below.numFiniteBuckets(float) - Must be greater than 0.offset(float) - Lower bound of the first bucket.width(float) - Must be greater than 0.
description: pulumi.Output[str] = None¶A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.
filter: pulumi.Output[str] = None¶An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-filters) which is used to match log entries.
label_extractors: pulumi.Output[dict] = None¶A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the valueExtractor field.
metric_descriptor: pulumi.Output[dict] = None¶The metric descriptor associated with the logs-based metric. Structure is documented below.
display_name(str) - A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example “Request count”. This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.labels(list) - The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. Structure is documented below.description(str) - A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.key(str) - The label key.valueType(str) - The type of data that can be assigned to the label.
metricKind(str) - Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metricKind and valueType might not be supported. For counter metrics, set this to DELTA.unit(str) - The unit in which the metric value is reported. It is only applicable if the valueType isINT64,DOUBLE, orDISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure standardvalueType(str) - The type of data that can be assigned to the label.
name: pulumi.Output[str] = None¶The client-assigned metric identifier. Examples - “errorcount”, “nginx/requests”. Metric identifiers are limited to 100 characters and can include only the following characters A-Z, a-z, 0-9, and the special characters *-.,+!’,()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.
project: pulumi.Output[str] = None¶The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
value_extractor: pulumi.Output[str] = None¶A valueExtractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction - EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are 1. field - The name of the log entry field from which the value is to be extracted. 2. regex - A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.
- static
get(resource_name, id, opts=None, bucket_options=None, description=None, filter=None, label_extractors=None, metric_descriptor=None, name=None, project=None, value_extractor=None)¶ Get an existing Metric resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_options (pulumi.Input[dict]) – The bucketOptions are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values. Structure is documented below.
description (pulumi.Input[str]) – A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.
filter (pulumi.Input[str]) – An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-filters) which is used to match log entries.
label_extractors (pulumi.Input[dict]) – A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the valueExtractor field.
metric_descriptor (pulumi.Input[dict]) – The metric descriptor associated with the logs-based metric. Structure is documented below.
name (pulumi.Input[str]) – The client-assigned metric identifier. Examples - “errorcount”, “nginx/requests”. Metric identifiers are limited to 100 characters and can include only the following characters A-Z, a-z, 0-9, and the special characters *-.,+!’,()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.
project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
value_extractor (pulumi.Input[str]) – A valueExtractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction - EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are 1. field - The name of the log entry field from which the value is to be extracted. 2. regex - A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.
The bucket_options object supports the following:
explicitBuckets(pulumi.Input[dict]) - Specifies a set of buckets with arbitrary widths. Structure is documented below.bounds(pulumi.Input[list]) - The values must be monotonically increasing.
exponentialBuckets(pulumi.Input[dict]) - Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket. Structure is documented below.growthFactor(pulumi.Input[float]) - Must be greater than 1.numFiniteBuckets(pulumi.Input[float]) - Must be greater than 0.scale(pulumi.Input[float]) - Must be greater than 0.
linearBuckets(pulumi.Input[dict]) - Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket. Structure is documented below.numFiniteBuckets(pulumi.Input[float]) - Must be greater than 0.offset(pulumi.Input[float]) - Lower bound of the first bucket.width(pulumi.Input[float]) - Must be greater than 0.
The metric_descriptor object supports the following:
display_name(pulumi.Input[str]) - A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example “Request count”. This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.labels(pulumi.Input[list]) - The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. Structure is documented below.description(pulumi.Input[str]) - A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.key(pulumi.Input[str]) - The label key.valueType(pulumi.Input[str]) - The type of data that can be assigned to the label.
metricKind(pulumi.Input[str]) - Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metricKind and valueType might not be supported. For counter metrics, set this to DELTA.unit(pulumi.Input[str]) - The unit in which the metric value is reported. It is only applicable if the valueType isINT64,DOUBLE, orDISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure standardvalueType(pulumi.Input[str]) - The type of data that can be assigned to the label.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.OrganizationBucketConfig(resource_name, opts=None, bucket_id=None, description=None, location=None, organization=None, retention_days=None, __props__=None, __name__=None, __opts__=None)¶ Manages a organization-level logging bucket config. For more information see the official logging documentation and Storing Logs.
Note: Logging buckets are automatically created for a given folder, project, organization, billingAccount and cannot be deleted. Creating a resource of this type will acquire and update the resource that already exists at the desired location. These buckets cannot be removed so deleting this resource will remove the bucket config from your state but will leave the logging bucket unchanged. The buckets that are currently automatically created are “_Default” and “_Required”.
import pulumi import pulumi_gcp as gcp default = gcp.organizations.get_organization(organization="123456789") basic = gcp.logging.OrganizationBucketConfig("basic", organization=default.organization, location="global", retention_days=30, bucket_id="_Default")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
organization (pulumi.Input[str]) – The parent resource that contains the logging bucket.
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
bucket_id: pulumi.Output[str] = None¶The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.
description: pulumi.Output[str] = None¶Describes this bucket.
lifecycle_state: pulumi.Output[str] = None¶The bucket’s lifecycle such as active or deleted. See LifecycleState.
location: pulumi.Output[str] = None¶The location of the bucket. The supported locations are: “global” “us-central1”
name: pulumi.Output[str] = None¶The resource name of the bucket. For example: “organizations/my-organization-id/locations/my-location/buckets/my-bucket-id”
organization: pulumi.Output[str] = None¶The parent resource that contains the logging bucket.
retention_days: pulumi.Output[float] = None¶Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
- static
get(resource_name, id, opts=None, bucket_id=None, description=None, lifecycle_state=None, location=None, name=None, organization=None, retention_days=None)¶ Get an existing OrganizationBucketConfig resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
lifecycle_state (pulumi.Input[str]) –
The bucket’s lifecycle such as active or deleted. See LifecycleState.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
name (pulumi.Input[str]) – The resource name of the bucket. For example: “organizations/my-organization-id/locations/my-location/buckets/my-bucket-id”
organization (pulumi.Input[str]) – The parent resource that contains the logging bucket.
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.OrganizationExclusion(resource_name, opts=None, description=None, disabled=None, filter=None, name=None, org_id=None, __props__=None, __name__=None, __opts__=None)¶ Manages an organization-level logging exclusion. For more information see the official documentation and Excluding Logs.
Note that you must have the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) granted to the credentials used with this provider.import pulumi import pulumi_gcp as gcp my_exclusion = gcp.logging.OrganizationExclusion("my-exclusion", description="Exclude GCE instance debug logs", filter="resource.type = gce_instance AND severity <= DEBUG", org_id="123456789")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) –
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging exclusion.
org_id (pulumi.Input[str]) – The organization to create the exclusion in.
description: pulumi.Output[str] = None¶A human-readable description.
disabled: pulumi.Output[bool] = None¶Whether this exclusion rule should be disabled or not. This defaults to false.
filter: pulumi.Output[str] = None¶The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name: pulumi.Output[str] = None¶The name of the logging exclusion.
org_id: pulumi.Output[str] = None¶The organization to create the exclusion in.
- static
get(resource_name, id, opts=None, description=None, disabled=None, filter=None, name=None, org_id=None)¶ Get an existing OrganizationExclusion resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) –
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging exclusion.
org_id (pulumi.Input[str]) – The organization to create the exclusion in.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.OrganizationSink(resource_name, opts=None, bigquery_options=None, destination=None, filter=None, include_children=None, name=None, org_id=None, __props__=None, __name__=None, __opts__=None)¶ Manages a organization-level logging sink. For more information see the official documentation and Exporting Logs in the API.
Note that you must have the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) granted to the credentials used with this provider.import pulumi import pulumi_gcp as gcp log_bucket = gcp.storage.Bucket("log-bucket") my_sink = gcp.logging.OrganizationSink("my-sink", org_id="123456789", destination=log_bucket.name.apply(lambda name: f"storage.googleapis.com/{name}"), filter="resource.type = gce_instance AND severity >= WARN") log_writer = gcp.projects.IAMMember("log-writer", role="roles/storage.objectCreator", member=my_sink.writer_identity)
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
include_children (pulumi.Input[bool]) – Whether or not to include children organizations in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization are included.
name (pulumi.Input[str]) – The name of the logging sink.
org_id (pulumi.Input[str]) – The numeric ID of the organization to be exported to the sink.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
bigquery_options: pulumi.Output[dict] = None¶Options that affect sinks exporting data to BigQuery. Structure documented below.
usePartitionedTables(bool) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
destination: pulumi.Output[str] = None¶The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
filter: pulumi.Output[str] = None¶The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
include_children: pulumi.Output[bool] = None¶Whether or not to include children organizations in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization are included.
name: pulumi.Output[str] = None¶The name of the logging sink.
org_id: pulumi.Output[str] = None¶The numeric ID of the organization to be exported to the sink.
writer_identity: pulumi.Output[str] = None¶The identity associated with this sink. This identity must be granted write access to the configured
destination.
- static
get(resource_name, id, opts=None, bigquery_options=None, destination=None, filter=None, include_children=None, name=None, org_id=None, writer_identity=None)¶ Get an existing OrganizationSink resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
include_children (pulumi.Input[bool]) – Whether or not to include children organizations in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization are included.
name (pulumi.Input[str]) – The name of the logging sink.
org_id (pulumi.Input[str]) – The numeric ID of the organization to be exported to the sink.
writer_identity (pulumi.Input[str]) – The identity associated with this sink. This identity must be granted write access to the configured
destination.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.ProjectBucketConfig(resource_name, opts=None, bucket_id=None, description=None, location=None, project=None, retention_days=None, __props__=None, __name__=None, __opts__=None)¶ Manages a project-level logging bucket config. For more information see the official logging documentation and Storing Logs.
Note: Logging buckets are automatically created for a given folder, project, organization, billingAccount and cannot be deleted. Creating a resource of this type will acquire and update the resource that already exists at the desired location. These buckets cannot be removed so deleting this resource will remove the bucket config from your state but will leave the logging bucket unchanged. The buckets that are currently automatically created are “_Default” and “_Required”.
import pulumi import pulumi_gcp as gcp default = gcp.organizations.Project("default", project_id="your-project-id", org_id="123456789") basic = gcp.logging.ProjectBucketConfig("basic", project=default.name, location="global", retention_days=30, bucket_id="_Default")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
project (pulumi.Input[str]) – The parent resource that contains the logging bucket.
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
bucket_id: pulumi.Output[str] = None¶The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.
description: pulumi.Output[str] = None¶Describes this bucket.
lifecycle_state: pulumi.Output[str] = None¶The bucket’s lifecycle such as active or deleted. See LifecycleState.
location: pulumi.Output[str] = None¶The location of the bucket. The supported locations are: “global” “us-central1”
name: pulumi.Output[str] = None¶The resource name of the bucket. For example: “projects/my-project-id/locations/my-location/buckets/my-bucket-id”
project: pulumi.Output[str] = None¶The parent resource that contains the logging bucket.
retention_days: pulumi.Output[float] = None¶Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
- static
get(resource_name, id, opts=None, bucket_id=None, description=None, lifecycle_state=None, location=None, name=None, project=None, retention_days=None)¶ Get an existing ProjectBucketConfig resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bucket_id (pulumi.Input[str]) – The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.description (pulumi.Input[str]) – Describes this bucket.
lifecycle_state (pulumi.Input[str]) –
The bucket’s lifecycle such as active or deleted. See LifecycleState.
location (pulumi.Input[str]) – The location of the bucket. The supported locations are: “global” “us-central1”
name (pulumi.Input[str]) – The resource name of the bucket. For example: “projects/my-project-id/locations/my-location/buckets/my-bucket-id”
project (pulumi.Input[str]) – The parent resource that contains the logging bucket.
retention_days (pulumi.Input[float]) – Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.ProjectExclusion(resource_name, opts=None, description=None, disabled=None, filter=None, name=None, project=None, __props__=None, __name__=None, __opts__=None)¶ Manages a project-level logging exclusion. For more information see the official documentation and Excluding Logs.
Note that you must have the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) granted to the credentials used with this provider.import pulumi import pulumi_gcp as gcp my_exclusion = gcp.logging.ProjectExclusion("my-exclusion", description="Exclude GCE instance debug logs", filter="resource.type = gce_instance AND severity <= DEBUG")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) –
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging exclusion.
project (pulumi.Input[str]) – The project to create the exclusion in. If omitted, the project associated with the provider is used.
description: pulumi.Output[str] = None¶A human-readable description.
disabled: pulumi.Output[bool] = None¶Whether this exclusion rule should be disabled or not. This defaults to false.
filter: pulumi.Output[str] = None¶The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name: pulumi.Output[str] = None¶The name of the logging exclusion.
project: pulumi.Output[str] = None¶The project to create the exclusion in. If omitted, the project associated with the provider is used.
- static
get(resource_name, id, opts=None, description=None, disabled=None, filter=None, name=None, project=None)¶ Get an existing ProjectExclusion resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – A human-readable description.
disabled (pulumi.Input[bool]) – Whether this exclusion rule should be disabled or not. This defaults to false.
filter (pulumi.Input[str]) –
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging exclusion.
project (pulumi.Input[str]) – The project to create the exclusion in. If omitted, the project associated with the provider is used.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.logging.ProjectSink(resource_name, opts=None, bigquery_options=None, destination=None, filter=None, name=None, project=None, unique_writer_identity=None, __props__=None, __name__=None, __opts__=None)¶ Manages a project-level logging sink. For more information see the official documentation, Exporting Logs in the API and API.
Note: You must have granted the “Logs Configuration Writer” IAM role (
roles/logging.configWriter) to the credentials used with this provider.Note You must enable the Cloud Resource Manager API
import pulumi import pulumi_gcp as gcp my_sink = gcp.logging.ProjectSink("my-sink", destination="pubsub.googleapis.com/projects/my-project/topics/instance-activity", filter="resource.type = gce_instance AND severity >= WARN", unique_writer_identity=True)
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
```python import pulumi ``` The writer associated with the sink must have access to write to the above resource.
- Parameters
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging sink.
project (pulumi.Input[str]) – The ID of the project to create the sink in. If omitted, the project associated with the provider is used.
unique_writer_identity (pulumi.Input[bool]) – Whether or not to create a unique identity associated with this sink. If
false(the default), then thewriter_identityused isserviceAccount:cloud-logs@system.gserviceaccount.com. Iftrue, then a unique service account is created and used for this sink. If you wish to publish logs across projects, you must setunique_writer_identityto true.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
bigquery_options: pulumi.Output[dict] = None¶Options that affect sinks exporting data to BigQuery. Structure documented below.
usePartitionedTables(bool) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
destination: pulumi.Output[str] = None¶The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
import pulumi
The writer associated with the sink must have access to write to the above resource.
filter: pulumi.Output[str] = None¶The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
name: pulumi.Output[str] = None¶The name of the logging sink.
project: pulumi.Output[str] = None¶The ID of the project to create the sink in. If omitted, the project associated with the provider is used.
unique_writer_identity: pulumi.Output[bool] = None¶Whether or not to create a unique identity associated with this sink. If
false(the default), then thewriter_identityused isserviceAccount:cloud-logs@system.gserviceaccount.com. Iftrue, then a unique service account is created and used for this sink. If you wish to publish logs across projects, you must setunique_writer_identityto true.
writer_identity: pulumi.Output[str] = None¶The identity associated with this sink. This identity must be granted write access to the configured
destination.
- static
get(resource_name, id, opts=None, bigquery_options=None, destination=None, filter=None, name=None, project=None, unique_writer_identity=None, writer_identity=None)¶ Get an existing ProjectSink resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
bigquery_options (pulumi.Input[dict]) – Options that affect sinks exporting data to BigQuery. Structure documented below.
destination (pulumi.Input[str]) – The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
```python import pulumi ``` The writer associated with the sink must have access to write to the above resource.
- Parameters
filter (pulumi.Input[str]) –
The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
name (pulumi.Input[str]) – The name of the logging sink.
project (pulumi.Input[str]) – The ID of the project to create the sink in. If omitted, the project associated with the provider is used.
unique_writer_identity (pulumi.Input[bool]) – Whether or not to create a unique identity associated with this sink. If
false(the default), then thewriter_identityused isserviceAccount:cloud-logs@system.gserviceaccount.com. Iftrue, then a unique service account is created and used for this sink. If you wish to publish logs across projects, you must setunique_writer_identityto true.writer_identity (pulumi.Input[str]) – The identity associated with this sink. This identity must be granted write access to the configured
destination.
The bigquery_options object supports the following:
usePartitionedTables(pulumi.Input[bool]) - Whether to use BigQuery’s partition tables. By default, Logging creates dated tables based on the log entries’ timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str