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

com.pulumi.googlenative.logging.v2.kotlin.Bucket.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.logging.v2.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.logging.v2.kotlin.outputs.CmekSettingsResponse
import com.pulumi.googlenative.logging.v2.kotlin.outputs.IndexConfigResponse
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.googlenative.logging.v2.kotlin.outputs.CmekSettingsResponse.Companion.toKotlin as cmekSettingsResponseToKotlin
import com.pulumi.googlenative.logging.v2.kotlin.outputs.IndexConfigResponse.Companion.toKotlin as indexConfigResponseToKotlin

/**
 * Builder for [Bucket].
 */
@PulumiTagMarker
public class BucketResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: BucketArgs = BucketArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend BucketArgsBuilder.() -> Unit) {
        val builder = BucketArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Bucket {
        val builtJavaResource = com.pulumi.googlenative.logging.v2.Bucket(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Bucket(builtJavaResource)
    }
}

/**
 * Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.
 * Auto-naming is currently not supported for this resource.
 */
public class Bucket internal constructor(
    override val javaResource: com.pulumi.googlenative.logging.v2.Bucket,
) : KotlinCustomResource(javaResource, BucketMapper) {
    /**
     * Whether log analytics is enabled for this bucket.Once enabled, log analytics features cannot be disabled.
     */
    public val analyticsEnabled: Output
        get() = javaResource.analyticsEnabled().applyValue({ args0 -> args0 })

    /**
     * Required. A client-assigned identifier such as "my-bucket". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.
     */
    public val bucketId: Output
        get() = javaResource.bucketId().applyValue({ args0 -> args0 })

    /**
     * The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed.
     */
    public val cmekSettings: Output
        get() = javaResource.cmekSettings().applyValue({ args0 ->
            args0.let({ args0 ->
                cmekSettingsResponseToKotlin(args0)
            })
        })

    /**
     * The creation timestamp of the bucket. This is not set for any of the default buckets.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Describes this bucket.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * A list of indexed fields and related configuration data.
     */
    public val indexConfigs: Output>
        get() = javaResource.indexConfigs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    indexConfigResponseToKotlin(args0)
                })
            })
        })

    /**
     * The bucket lifecycle state.
     */
    public val lifecycleState: Output
        get() = javaResource.lifecycleState().applyValue({ args0 -> args0 })

    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Whether the bucket is locked.The retention period on a locked bucket cannot be changed. Locked buckets may only be deleted if they are empty.
     */
    public val locked: Output
        get() = javaResource.locked().applyValue({ args0 -> args0 })

    /**
     * The resource name of the bucket.For example:projects/my-project/locations/global/buckets/my-bucketFor a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support)For the location of global it is unspecified where log entries are actually stored.After a bucket has been created, the location cannot be changed.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Log entry field paths that are denied access in this bucket.The following fields and their children are eligible: textPayload, jsonPayload, protoPayload, httpRequest, labels, sourceLocation.Restricting a repeated field will restrict all values. Adding a parent will block all child fields. (e.g. foo.bar will block foo.bar.baz)
     */
    public val restrictedFields: Output>
        get() = javaResource.restrictedFields().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
     */
    public val retentionDays: Output
        get() = javaResource.retentionDays().applyValue({ args0 -> args0 })

    /**
     * The last update timestamp of the bucket.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object BucketMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.logging.v2.Bucket::class == javaResource::class

    override fun map(javaResource: Resource): Bucket = Bucket(
        javaResource as
            com.pulumi.googlenative.logging.v2.Bucket,
    )
}

/**
 * @see [Bucket].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Bucket].
 */
public suspend fun bucket(name: String, block: suspend BucketResourceBuilder.() -> Unit): Bucket {
    val builder = BucketResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Bucket].
 * @param name The _unique_ name of the resulting resource.
 */
public fun bucket(name: String): Bucket {
    val builder = BucketResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy