gcp.logging.LogView
Explore with Pulumi AI
Describes a view over log entries in a bucket.
To get more information about LogView, see:
- API documentation
- How-to Guides
Example Usage
Logging Log View Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const loggingLogView = new gcp.logging.ProjectBucketConfig("logging_log_view", {
project: "my-project-name",
location: "global",
retentionDays: 30,
bucketId: "_Default",
});
const loggingLogViewLogView = new gcp.logging.LogView("logging_log_view", {
name: "my-view",
bucket: loggingLogView.id,
description: "A logging view configured with Terraform",
filter: "SOURCE(\"projects/myproject\") AND resource.type = \"gce_instance\" AND LOG_ID(\"stdout\")",
});
import pulumi
import pulumi_gcp as gcp
logging_log_view = gcp.logging.ProjectBucketConfig("logging_log_view",
project="my-project-name",
location="global",
retention_days=30,
bucket_id="_Default")
logging_log_view_log_view = gcp.logging.LogView("logging_log_view",
name="my-view",
bucket=logging_log_view.id,
description="A logging view configured with Terraform",
filter="SOURCE(\"projects/myproject\") AND resource.type = \"gce_instance\" AND LOG_ID(\"stdout\")")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/logging"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
loggingLogView, err := logging.NewProjectBucketConfig(ctx, "logging_log_view", &logging.ProjectBucketConfigArgs{
Project: pulumi.String("my-project-name"),
Location: pulumi.String("global"),
RetentionDays: pulumi.Int(30),
BucketId: pulumi.String("_Default"),
})
if err != nil {
return err
}
_, err = logging.NewLogView(ctx, "logging_log_view", &logging.LogViewArgs{
Name: pulumi.String("my-view"),
Bucket: loggingLogView.ID(),
Description: pulumi.String("A logging view configured with Terraform"),
Filter: pulumi.String("SOURCE(\"projects/myproject\") AND resource.type = \"gce_instance\" AND LOG_ID(\"stdout\")"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var loggingLogView = new Gcp.Logging.ProjectBucketConfig("logging_log_view", new()
{
Project = "my-project-name",
Location = "global",
RetentionDays = 30,
BucketId = "_Default",
});
var loggingLogViewLogView = new Gcp.Logging.LogView("logging_log_view", new()
{
Name = "my-view",
Bucket = loggingLogView.Id,
Description = "A logging view configured with Terraform",
Filter = "SOURCE(\"projects/myproject\") AND resource.type = \"gce_instance\" AND LOG_ID(\"stdout\")",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.logging.ProjectBucketConfig;
import com.pulumi.gcp.logging.ProjectBucketConfigArgs;
import com.pulumi.gcp.logging.LogView;
import com.pulumi.gcp.logging.LogViewArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var loggingLogView = new ProjectBucketConfig("loggingLogView", ProjectBucketConfigArgs.builder()
.project("my-project-name")
.location("global")
.retentionDays(30)
.bucketId("_Default")
.build());
var loggingLogViewLogView = new LogView("loggingLogViewLogView", LogViewArgs.builder()
.name("my-view")
.bucket(loggingLogView.id())
.description("A logging view configured with Terraform")
.filter("SOURCE(\"projects/myproject\") AND resource.type = \"gce_instance\" AND LOG_ID(\"stdout\")")
.build());
}
}
resources:
loggingLogView:
type: gcp:logging:ProjectBucketConfig
name: logging_log_view
properties:
project: my-project-name
location: global
retentionDays: 30
bucketId: _Default
loggingLogViewLogView:
type: gcp:logging:LogView
name: logging_log_view
properties:
name: my-view
bucket: ${loggingLogView.id}
description: A logging view configured with Terraform
filter: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
Create LogView Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LogView(name: string, args: LogViewArgs, opts?: CustomResourceOptions);
@overload
def LogView(resource_name: str,
args: LogViewArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LogView(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
description: Optional[str] = None,
filter: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
parent: Optional[str] = None)
func NewLogView(ctx *Context, name string, args LogViewArgs, opts ...ResourceOption) (*LogView, error)
public LogView(string name, LogViewArgs args, CustomResourceOptions? opts = null)
public LogView(String name, LogViewArgs args)
public LogView(String name, LogViewArgs args, CustomResourceOptions options)
type: gcp:logging:LogView
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LogViewArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LogViewArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LogViewArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LogViewArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LogViewArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var logViewResource = new Gcp.Logging.LogView("logViewResource", new()
{
Bucket = "string",
Description = "string",
Filter = "string",
Location = "string",
Name = "string",
Parent = "string",
});
example, err := logging.NewLogView(ctx, "logViewResource", &logging.LogViewArgs{
Bucket: pulumi.String("string"),
Description: pulumi.String("string"),
Filter: pulumi.String("string"),
Location: pulumi.String("string"),
Name: pulumi.String("string"),
Parent: pulumi.String("string"),
})
var logViewResource = new LogView("logViewResource", LogViewArgs.builder()
.bucket("string")
.description("string")
.filter("string")
.location("string")
.name("string")
.parent("string")
.build());
log_view_resource = gcp.logging.LogView("logViewResource",
bucket="string",
description="string",
filter="string",
location="string",
name="string",
parent="string")
const logViewResource = new gcp.logging.LogView("logViewResource", {
bucket: "string",
description: "string",
filter: "string",
location: "string",
name: "string",
parent: "string",
});
type: gcp:logging:LogView
properties:
bucket: string
description: string
filter: string
location: string
name: string
parent: string
LogView Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The LogView resource accepts the following input properties:
- Bucket string
- The bucket of the resource
- Description string
- Describes this view.
- Filter string
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- Location string
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- Name string
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- Parent string
- The parent of the resource.
- Bucket string
- The bucket of the resource
- Description string
- Describes this view.
- Filter string
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- Location string
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- Name string
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- Parent string
- The parent of the resource.
- bucket String
- The bucket of the resource
- description String
- Describes this view.
- filter String
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location String
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name String
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent String
- The parent of the resource.
- bucket string
- The bucket of the resource
- description string
- Describes this view.
- filter string
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location string
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name string
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent string
- The parent of the resource.
- bucket str
- The bucket of the resource
- description str
- Describes this view.
- filter str
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location str
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name str
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent str
- The parent of the resource.
- bucket String
- The bucket of the resource
- description String
- Describes this view.
- filter String
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location String
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name String
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent String
- The parent of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the LogView resource produces the following output properties:
- Create
Time string - Output only. The creation timestamp of the view.
- Id string
- The provider-assigned unique ID for this managed resource.
- Update
Time string - Output only. The last update timestamp of the view.
- Create
Time string - Output only. The creation timestamp of the view.
- Id string
- The provider-assigned unique ID for this managed resource.
- Update
Time string - Output only. The last update timestamp of the view.
- create
Time String - Output only. The creation timestamp of the view.
- id String
- The provider-assigned unique ID for this managed resource.
- update
Time String - Output only. The last update timestamp of the view.
- create
Time string - Output only. The creation timestamp of the view.
- id string
- The provider-assigned unique ID for this managed resource.
- update
Time string - Output only. The last update timestamp of the view.
- create_
time str - Output only. The creation timestamp of the view.
- id str
- The provider-assigned unique ID for this managed resource.
- update_
time str - Output only. The last update timestamp of the view.
- create
Time String - Output only. The creation timestamp of the view.
- id String
- The provider-assigned unique ID for this managed resource.
- update
Time String - Output only. The last update timestamp of the view.
Look up Existing LogView Resource
Get an existing LogView resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LogViewState, opts?: CustomResourceOptions): LogView
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
filter: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
parent: Optional[str] = None,
update_time: Optional[str] = None) -> LogView
func GetLogView(ctx *Context, name string, id IDInput, state *LogViewState, opts ...ResourceOption) (*LogView, error)
public static LogView Get(string name, Input<string> id, LogViewState? state, CustomResourceOptions? opts = null)
public static LogView get(String name, Output<String> id, LogViewState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Bucket string
- The bucket of the resource
- Create
Time string - Output only. The creation timestamp of the view.
- Description string
- Describes this view.
- Filter string
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- Location string
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- Name string
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- Parent string
- The parent of the resource.
- Update
Time string - Output only. The last update timestamp of the view.
- Bucket string
- The bucket of the resource
- Create
Time string - Output only. The creation timestamp of the view.
- Description string
- Describes this view.
- Filter string
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- Location string
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- Name string
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- Parent string
- The parent of the resource.
- Update
Time string - Output only. The last update timestamp of the view.
- bucket String
- The bucket of the resource
- create
Time String - Output only. The creation timestamp of the view.
- description String
- Describes this view.
- filter String
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location String
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name String
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent String
- The parent of the resource.
- update
Time String - Output only. The last update timestamp of the view.
- bucket string
- The bucket of the resource
- create
Time string - Output only. The creation timestamp of the view.
- description string
- Describes this view.
- filter string
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location string
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name string
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent string
- The parent of the resource.
- update
Time string - Output only. The last update timestamp of the view.
- bucket str
- The bucket of the resource
- create_
time str - Output only. The creation timestamp of the view.
- description str
- Describes this view.
- filter str
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location str
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name str
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent str
- The parent of the resource.
- update_
time str - Output only. The last update timestamp of the view.
- bucket String
- The bucket of the resource
- create
Time String - Output only. The creation timestamp of the view.
- description String
- Describes this view.
- filter String
- Filter that restricts which log entries in a bucket are visible in this view. Filters are restricted to be a logical AND of ==/!= of any of the following: - originating project/folder/organization/billing account. - resource type - log id For example: SOURCE("projects/myproject") AND resource.type = "gce_instance" AND LOG_ID("stdout")
- location String
- The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
- name String
- The resource name of the view. For example: `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
- parent String
- The parent of the resource.
- update
Time String - Output only. The last update timestamp of the view.
Import
LogView can be imported using any of these accepted formats:
{{parent}}/locations/{{location}}/buckets/{{bucket}}/views/{{name}}
When using the pulumi import
command, LogView can be imported using one of the formats above. For example:
$ pulumi import gcp:logging/logView:LogView default {{parent}}/locations/{{location}}/buckets/{{bucket}}/views/{{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.