LogViewArgs

data class LogViewArgs(val bucket: Output<String>? = null, val description: Output<String>? = null, val filter: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val parent: Output<String>? = null) : ConvertibleToJava<LogViewArgs>

Describes a view over log entries in a bucket. To get more information about LogView, see:

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\")")
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 main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/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
})
}
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")

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}}

Constructors

Link copied to clipboard
constructor(bucket: Output<String>? = null, description: Output<String>? = null, filter: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, parent: Output<String>? = null)

Properties

Link copied to clipboard
val bucket: Output<String>? = null

The bucket of the resource

Link copied to clipboard
val description: Output<String>? = null

Describes this view.

Link copied to clipboard
val filter: Output<String>? = null

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")

Link copied to clipboard
val location: Output<String>? = null

The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.

Link copied to clipboard
val name: Output<String>? = null

The resource name of the view. For example: \`projects/my-project/locations/global/buckets/my-bucket/views/my-view\`

Link copied to clipboard
val parent: Output<String>? = null

The parent of the resource.

Functions

Link copied to clipboard
open override fun toJava(): LogViewArgs