com.pulumi.gcp.logging.kotlin.FolderExclusionArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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.FolderExclusionArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages a folder-level logging exclusion. For more information see:
* * [API documentation](https://cloud.google.com/logging/docs/reference/v2/rest/v2/folders.exclusions)
* * How-to Guides
* * [Excluding Logs](https://cloud.google.com/logging/docs/exclusions)
* > You can specify exclusions for log sinks created by the provider by using the exclusions field of `gcp.logging.FolderSink`
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const my_folder = new gcp.organizations.Folder("my-folder", {
* displayName: "My folder",
* parent: "organizations/123456",
* });
* const my_exclusion = new gcp.logging.FolderExclusion("my-exclusion", {
* name: "my-instance-debug-exclusion",
* folder: my_folder.name,
* description: "Exclude GCE instance debug logs",
* filter: "resource.type = gce_instance AND severity <= DEBUG",
* });
* ```
* ```python
* 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",
* name="my-instance-debug-exclusion",
* folder=my_folder.name,
* description="Exclude GCE instance debug logs",
* filter="resource.type = gce_instance AND severity <= DEBUG")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var my_folder = new Gcp.Organizations.Folder("my-folder", new()
* {
* DisplayName = "My folder",
* Parent = "organizations/123456",
* });
* var my_exclusion = new Gcp.Logging.FolderExclusion("my-exclusion", new()
* {
* Name = "my-instance-debug-exclusion",
* Folder = my_folder.Name,
* Description = "Exclude GCE instance debug logs",
* Filter = "resource.type = gce_instance AND severity <= DEBUG",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/logging"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := organizations.NewFolder(ctx, "my-folder", &organizations.FolderArgs{
* DisplayName: pulumi.String("My folder"),
* Parent: pulumi.String("organizations/123456"),
* })
* if err != nil {
* return err
* }
* _, err = logging.NewFolderExclusion(ctx, "my-exclusion", &logging.FolderExclusionArgs{
* Name: pulumi.String("my-instance-debug-exclusion"),
* Folder: my_folder.Name,
* Description: pulumi.String("Exclude GCE instance debug logs"),
* Filter: pulumi.String("resource.type = gce_instance AND severity <= DEBUG"),
* })
* 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.organizations.Folder;
* import com.pulumi.gcp.organizations.FolderArgs;
* import com.pulumi.gcp.logging.FolderExclusion;
* import com.pulumi.gcp.logging.FolderExclusionArgs;
* 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 my_folder = new Folder("my-folder", FolderArgs.builder()
* .displayName("My folder")
* .parent("organizations/123456")
* .build());
* var my_exclusion = new FolderExclusion("my-exclusion", FolderExclusionArgs.builder()
* .name("my-instance-debug-exclusion")
* .folder(my_folder.name())
* .description("Exclude GCE instance debug logs")
* .filter("resource.type = gce_instance AND severity <= DEBUG")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* my-exclusion:
* type: gcp:logging:FolderExclusion
* properties:
* name: my-instance-debug-exclusion
* folder: ${["my-folder"].name}
* description: Exclude GCE instance debug logs
* filter: resource.type = gce_instance AND severity <= DEBUG
* my-folder:
* type: gcp:organizations:Folder
* properties:
* displayName: My folder
* parent: organizations/123456
* ```
*
* ## Import
* Folder-level logging exclusions can be imported using their URI, e.g.
* * `folders/{{folder}}/exclusions/{{name}}`
* When using the `pulumi import` command, folder-level logging exclusions can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:logging/folderExclusion:FolderExclusion default folders/{{folder}}/exclusions/{{name}}
* ```
* @property description A human-readable description.
* @property disabled Whether this exclusion rule should be disabled or not. This defaults to
* false.
* @property filter The filter to apply when excluding logs. Only log entries that match the filter are excluded.
* See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
* write a filter.
* @property folder The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is
* accepted.
* @property name The name of the logging exclusion.
*/
public data class FolderExclusionArgs(
public val description: Output? = null,
public val disabled: Output? = null,
public val filter: Output? = null,
public val folder: Output? = null,
public val name: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.logging.FolderExclusionArgs =
com.pulumi.gcp.logging.FolderExclusionArgs.builder()
.description(description?.applyValue({ args0 -> args0 }))
.disabled(disabled?.applyValue({ args0 -> args0 }))
.filter(filter?.applyValue({ args0 -> args0 }))
.folder(folder?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [FolderExclusionArgs].
*/
@PulumiTagMarker
public class FolderExclusionArgsBuilder internal constructor() {
private var description: Output? = null
private var disabled: Output? = null
private var filter: Output? = null
private var folder: Output? = null
private var name: Output? = null
/**
* @param value A human-readable description.
*/
@JvmName("qcwhsjuchfaocmrp")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Whether this exclusion rule should be disabled or not. This defaults to
* false.
*/
@JvmName("sormsfipkkpgmvqo")
public suspend fun disabled(`value`: Output) {
this.disabled = value
}
/**
* @param value The filter to apply when excluding logs. Only log entries that match the filter are excluded.
* See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
* write a filter.
*/
@JvmName("hssdqnxrseilnttw")
public suspend fun filter(`value`: Output) {
this.filter = value
}
/**
* @param value The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is
* accepted.
*/
@JvmName("pxfytlghojfnvjvw")
public suspend fun folder(`value`: Output) {
this.folder = value
}
/**
* @param value The name of the logging exclusion.
*/
@JvmName("jmlattwgwvbwkcry")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value A human-readable description.
*/
@JvmName("mbkifxtxyanjswqv")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value Whether this exclusion rule should be disabled or not. This defaults to
* false.
*/
@JvmName("psieikawbigrjkxh")
public suspend fun disabled(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.disabled = mapped
}
/**
* @param value The filter to apply when excluding logs. Only log entries that match the filter are excluded.
* See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
* write a filter.
*/
@JvmName("sowheoretxffyvjc")
public suspend fun filter(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.filter = mapped
}
/**
* @param value The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is
* accepted.
*/
@JvmName("rwwkpxdxdulgfqpt")
public suspend fun folder(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.folder = mapped
}
/**
* @param value The name of the logging exclusion.
*/
@JvmName("slipxqecqkbtvkwf")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
internal fun build(): FolderExclusionArgs = FolderExclusionArgs(
description = description,
disabled = disabled,
filter = filter,
folder = folder,
name = name,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy