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

com.pulumi.gcp.logging.kotlin.ProjectSinkArgs.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.ProjectSinkArgs.builder
import com.pulumi.gcp.logging.kotlin.inputs.ProjectSinkBigqueryOptionsArgs
import com.pulumi.gcp.logging.kotlin.inputs.ProjectSinkBigqueryOptionsArgsBuilder
import com.pulumi.gcp.logging.kotlin.inputs.ProjectSinkExclusionArgs
import com.pulumi.gcp.logging.kotlin.inputs.ProjectSinkExclusionArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * ## Import
 * Project-level logging sinks can be imported using their URI, e.g.
 * * `projects/{{project_id}}/sinks/{{name}}`
 * When using the `pulumi import` command, project-level logging sinks can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:logging/projectSink:ProjectSink default projects/{{project_id}}/sinks/{{name}}
 * ```
 * @property bigqueryOptions Options that affect sinks exporting data to BigQuery. Structure documented below.
 * @property customWriterIdentity A user managed service account that will be used to write
 * the log entries. The format must be `serviceAccount:some@email`. This field can only be specified if you are
 * routing logs to a destination outside this sink's project. If not specified, a Logging service account
 * will automatically be generated.
 * @property description A description of this sink. The maximum length of the description is 8000 characters.
 * @property destination The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:
 * - `storage.googleapis.com/[GCS_BUCKET]`
 * - `bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]`
 * - `pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]`
 * - `logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]`
 * - `logging.googleapis.com/projects/[PROJECT_ID]`
 * The writer associated with the sink must have access to write to the above resource.
 * @property disabled If set to True, then this sink is disabled and it does not export any log entries.
 * @property exclusions Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
 * @property filter The filter to apply when exporting logs. Only log entries that match the filter are exported.
 * See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced_filters) for information on how to
 * write a filter.
 * @property name The name of the logging sink. Logging automatically creates two sinks: `_Required` and `_Default`.
 * @property project The ID of the project to create the sink in. If omitted, the project associated with the provider is
 * used.
 * @property uniqueWriterIdentity Whether or not to create a unique identity associated with this sink. If `false`, then the `writer_identity` used is `serviceAccount:[email protected]`. If `true` (the default),
 * then a unique service account is created and used for this sink. If you wish to publish logs across projects or utilize
 * `bigquery_options`, you must set `unique_writer_identity` to true.
 */
public data class ProjectSinkArgs(
    public val bigqueryOptions: Output? = null,
    public val customWriterIdentity: Output? = null,
    public val description: Output? = null,
    public val destination: Output? = null,
    public val disabled: Output? = null,
    public val exclusions: Output>? = null,
    public val filter: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val uniqueWriterIdentity: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.logging.ProjectSinkArgs =
        com.pulumi.gcp.logging.ProjectSinkArgs.builder()
            .bigqueryOptions(bigqueryOptions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .customWriterIdentity(customWriterIdentity?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .destination(destination?.applyValue({ args0 -> args0 }))
            .disabled(disabled?.applyValue({ args0 -> args0 }))
            .exclusions(
                exclusions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .filter(filter?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .uniqueWriterIdentity(uniqueWriterIdentity?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ProjectSinkArgs].
 */
@PulumiTagMarker
public class ProjectSinkArgsBuilder internal constructor() {
    private var bigqueryOptions: Output? = null

    private var customWriterIdentity: Output? = null

    private var description: Output? = null

    private var destination: Output? = null

    private var disabled: Output? = null

    private var exclusions: Output>? = null

    private var filter: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var uniqueWriterIdentity: Output? = null

    /**
     * @param value Options that affect sinks exporting data to BigQuery. Structure documented below.
     */
    @JvmName("mxlhvimdidrxcijq")
    public suspend fun bigqueryOptions(`value`: Output) {
        this.bigqueryOptions = value
    }

    /**
     * @param value A user managed service account that will be used to write
     * the log entries. The format must be `serviceAccount:some@email`. This field can only be specified if you are
     * routing logs to a destination outside this sink's project. If not specified, a Logging service account
     * will automatically be generated.
     */
    @JvmName("wsppsulhpdkcfbnj")
    public suspend fun customWriterIdentity(`value`: Output) {
        this.customWriterIdentity = value
    }

    /**
     * @param value A description of this sink. The maximum length of the description is 8000 characters.
     */
    @JvmName("skmgwucnodvrpokt")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:
     * - `storage.googleapis.com/[GCS_BUCKET]`
     * - `bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]`
     * - `pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]`
     * - `logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]`
     * - `logging.googleapis.com/projects/[PROJECT_ID]`
     * The writer associated with the sink must have access to write to the above resource.
     */
    @JvmName("kpnixmqfsljcngft")
    public suspend fun destination(`value`: Output) {
        this.destination = value
    }

    /**
     * @param value If set to True, then this sink is disabled and it does not export any log entries.
     */
    @JvmName("rcjlstlbopmergxj")
    public suspend fun disabled(`value`: Output) {
        this.disabled = value
    }

    /**
     * @param value Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
     */
    @JvmName("xkbmwutpfnhqppls")
    public suspend fun exclusions(`value`: Output>) {
        this.exclusions = value
    }

    @JvmName("acpgqnplmfsonigp")
    public suspend fun exclusions(vararg values: Output) {
        this.exclusions = Output.all(values.asList())
    }

    /**
     * @param values Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
     */
    @JvmName("ikvqneigmldjwves")
    public suspend fun exclusions(values: List>) {
        this.exclusions = Output.all(values)
    }

    /**
     * @param value The filter to apply when exporting logs. Only log entries that match the filter are exported.
     * See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced_filters) for information on how to
     * write a filter.
     */
    @JvmName("twktefbebmookwlt")
    public suspend fun filter(`value`: Output) {
        this.filter = value
    }

    /**
     * @param value The name of the logging sink. Logging automatically creates two sinks: `_Required` and `_Default`.
     */
    @JvmName("ernrybesbvwwlmjy")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project to create the sink in. If omitted, the project associated with the provider is
     * used.
     */
    @JvmName("pmvryftadlhauffc")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Whether or not to create a unique identity associated with this sink. If `false`, then the `writer_identity` used is `serviceAccount:[email protected]`. If `true` (the default),
     * then a unique service account is created and used for this sink. If you wish to publish logs across projects or utilize
     * `bigquery_options`, you must set `unique_writer_identity` to true.
     */
    @JvmName("mpnwofayplrxhxaf")
    public suspend fun uniqueWriterIdentity(`value`: Output) {
        this.uniqueWriterIdentity = value
    }

    /**
     * @param value Options that affect sinks exporting data to BigQuery. Structure documented below.
     */
    @JvmName("imgkyqpyytqomncw")
    public suspend fun bigqueryOptions(`value`: ProjectSinkBigqueryOptionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bigqueryOptions = mapped
    }

    /**
     * @param argument Options that affect sinks exporting data to BigQuery. Structure documented below.
     */
    @JvmName("fjaxadyntnfydjce")
    public suspend fun bigqueryOptions(argument: suspend ProjectSinkBigqueryOptionsArgsBuilder.() -> Unit) {
        val toBeMapped = ProjectSinkBigqueryOptionsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.bigqueryOptions = mapped
    }

    /**
     * @param value A user managed service account that will be used to write
     * the log entries. The format must be `serviceAccount:some@email`. This field can only be specified if you are
     * routing logs to a destination outside this sink's project. If not specified, a Logging service account
     * will automatically be generated.
     */
    @JvmName("jhujgclcnlmwungy")
    public suspend fun customWriterIdentity(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customWriterIdentity = mapped
    }

    /**
     * @param value A description of this sink. The maximum length of the description is 8000 characters.
     */
    @JvmName("kgcnfelaycuhmafj")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:
     * - `storage.googleapis.com/[GCS_BUCKET]`
     * - `bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]`
     * - `pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]`
     * - `logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]`
     * - `logging.googleapis.com/projects/[PROJECT_ID]`
     * The writer associated with the sink must have access to write to the above resource.
     */
    @JvmName("fivrdicrluclcgta")
    public suspend fun destination(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destination = mapped
    }

    /**
     * @param value If set to True, then this sink is disabled and it does not export any log entries.
     */
    @JvmName("bnxvnlxtubnfssvi")
    public suspend fun disabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disabled = mapped
    }

    /**
     * @param value Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
     */
    @JvmName("wvpvghitisdtmnwk")
    public suspend fun exclusions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.exclusions = mapped
    }

    /**
     * @param argument Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
     */
    @JvmName("bninxoyvsdvydbaf")
    public suspend fun exclusions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ProjectSinkExclusionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.exclusions = mapped
    }

    /**
     * @param argument Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
     */
    @JvmName("hhlodfpdamditnqt")
    public suspend fun exclusions(vararg argument: suspend ProjectSinkExclusionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ProjectSinkExclusionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.exclusions = mapped
    }

    /**
     * @param argument Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
     */
    @JvmName("uefhbhvudodntvmg")
    public suspend fun exclusions(argument: suspend ProjectSinkExclusionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ProjectSinkExclusionArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.exclusions = mapped
    }

    /**
     * @param values Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported.  Can be repeated multiple times for multiple exclusions. Structure is documented below.
     */
    @JvmName("sdwgmkhgitgqkqnb")
    public suspend fun exclusions(vararg values: ProjectSinkExclusionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.exclusions = mapped
    }

    /**
     * @param value The filter to apply when exporting logs. Only log entries that match the filter are exported.
     * See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced_filters) for information on how to
     * write a filter.
     */
    @JvmName("uobvayqpsucfaeoy")
    public suspend fun filter(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filter = mapped
    }

    /**
     * @param value The name of the logging sink. Logging automatically creates two sinks: `_Required` and `_Default`.
     */
    @JvmName("iyaldkaispvpwgai")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project to create the sink in. If omitted, the project associated with the provider is
     * used.
     */
    @JvmName("ksibvpqgnwymspib")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Whether or not to create a unique identity associated with this sink. If `false`, then the `writer_identity` used is `serviceAccount:[email protected]`. If `true` (the default),
     * then a unique service account is created and used for this sink. If you wish to publish logs across projects or utilize
     * `bigquery_options`, you must set `unique_writer_identity` to true.
     */
    @JvmName("qdqlhkfgiyfcqsou")
    public suspend fun uniqueWriterIdentity(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.uniqueWriterIdentity = mapped
    }

    internal fun build(): ProjectSinkArgs = ProjectSinkArgs(
        bigqueryOptions = bigqueryOptions,
        customWriterIdentity = customWriterIdentity,
        description = description,
        destination = destination,
        disabled = disabled,
        exclusions = exclusions,
        filter = filter,
        name = name,
        project = project,
        uniqueWriterIdentity = uniqueWriterIdentity,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy