All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.logging.kotlin.LogViewArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.logging.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.logging.LogViewArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Describes a view over log entries in a bucket.
 * To get more information about LogView, see:
 * * [API documentation](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.locations.buckets.views)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/logging/docs/apis)
 * ## Example Usage
 * ### Logging Log View Basic
 * 
 * ```typescript
 * 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\")",
 * });
 * ```
 * ```python
 * 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\")")
 * ```
 * ```csharp
 * 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\")",
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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:
 * ```sh
 * $ pulumi import gcp:logging/logView:LogView default {{parent}}/locations/{{location}}/buckets/{{bucket}}/views/{{name}}
 * ```
 * @property bucket The bucket of the resource
 * - - -
 * @property description Describes this view.
 * @property filter 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")
 * @property location The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
 * @property name The resource name of the view. For example: \`projects/my-project/locations/global/buckets/my-bucket/views/my-view\`
 * @property parent The parent of the resource.
 */
public data class LogViewArgs(
    public val bucket: Output? = null,
    public val description: Output? = null,
    public val filter: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val parent: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.logging.LogViewArgs =
        com.pulumi.gcp.logging.LogViewArgs.builder()
            .bucket(bucket?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .filter(filter?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parent(parent?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LogViewArgs].
 */
@PulumiTagMarker
public class LogViewArgsBuilder internal constructor() {
    private var bucket: Output? = null

    private var description: Output? = null

    private var filter: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var parent: Output? = null

    /**
     * @param value The bucket of the resource
     * - - -
     */
    @JvmName("rnjeikupqcorjkqj")
    public suspend fun bucket(`value`: Output) {
        this.bucket = value
    }

    /**
     * @param value Describes this view.
     */
    @JvmName("iwubebdsvicjgira")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value 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")
     */
    @JvmName("ykvmefbhjipdsatr")
    public suspend fun filter(`value`: Output) {
        this.filter = value
    }

    /**
     * @param value The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
     */
    @JvmName("cprlebxuxsugngij")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The resource name of the view. For example: \`projects/my-project/locations/global/buckets/my-bucket/views/my-view\`
     */
    @JvmName("fnimmhgvggyyalnx")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The parent of the resource.
     */
    @JvmName("obpiejcpertnkxxv")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value The bucket of the resource
     * - - -
     */
    @JvmName("mnejguhiwbhtufww")
    public suspend fun bucket(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bucket = mapped
    }

    /**
     * @param value Describes this view.
     */
    @JvmName("bvjkjamkkxjfhgib")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value 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")
     */
    @JvmName("fmrgwkrfdrqyyxsu")
    public suspend fun filter(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filter = mapped
    }

    /**
     * @param value The location of the resource. The supported locations are: global, us-central1, us-east1, us-west1, asia-east1, europe-west1.
     */
    @JvmName("umbbbclntqnwhiuu")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The resource name of the view. For example: \`projects/my-project/locations/global/buckets/my-bucket/views/my-view\`
     */
    @JvmName("kiybhowxkwdwjndi")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The parent of the resource.
     */
    @JvmName("jcmgbhnngwiqdkjt")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    internal fun build(): LogViewArgs = LogViewArgs(
        bucket = bucket,
        description = description,
        filter = filter,
        location = location,
        name = name,
        parent = parent,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy