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

com.pulumi.gcp.compute.kotlin.inputs.BackendBucketCdnPolicyArgs.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.13.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.inputs.BackendBucketCdnPolicyArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property bypassCacheOnRequestHeaders Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
 * Structure is documented below.
 * @property cacheKeyPolicy The CacheKeyPolicy for this CdnPolicy.
 * Structure is documented below.
 * @property cacheMode Specifies the cache setting for all responses from this backend.
 * The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC
 * Possible values are: `USE_ORIGIN_HEADERS`, `FORCE_CACHE_ALL`, `CACHE_ALL_STATIC`.
 * @property clientTtl Specifies the maximum allowed TTL for cached content served by this origin.
 * @property defaultTtl Specifies the default TTL for cached content served by this origin for responses
 * that do not have an existing valid TTL (max-age or s-max-age).
 * @property maxTtl Specifies the maximum allowed TTL for cached content served by this origin.
 * @property negativeCaching Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects.
 * @property negativeCachingPolicies Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
 * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
 * Structure is documented below.
 * @property requestCoalescing If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin.
 * @property serveWhileStale Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache.
 * @property signedUrlCacheMaxAgeSec Maximum number of seconds the response to a signed URL request will
 * be considered fresh. After this time period,
 * the response will be revalidated before being served.
 * When serving responses to signed URL requests,
 * Cloud CDN will internally behave as though
 * all responses from this backend had a "Cache-Control: public,
 * max-age=[TTL]" header, regardless of any existing Cache-Control
 * header. The actual headers served in responses will not be altered.
 */
public data class BackendBucketCdnPolicyArgs(
    public val bypassCacheOnRequestHeaders: Output>? = null,
    public val cacheKeyPolicy: Output? = null,
    public val cacheMode: Output? = null,
    public val clientTtl: Output? = null,
    public val defaultTtl: Output? = null,
    public val maxTtl: Output? = null,
    public val negativeCaching: Output? = null,
    public val negativeCachingPolicies: Output>? =
        null,
    public val requestCoalescing: Output? = null,
    public val serveWhileStale: Output? = null,
    public val signedUrlCacheMaxAgeSec: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.inputs.BackendBucketCdnPolicyArgs =
        com.pulumi.gcp.compute.inputs.BackendBucketCdnPolicyArgs.builder()
            .bypassCacheOnRequestHeaders(
                bypassCacheOnRequestHeaders?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .cacheKeyPolicy(cacheKeyPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .cacheMode(cacheMode?.applyValue({ args0 -> args0 }))
            .clientTtl(clientTtl?.applyValue({ args0 -> args0 }))
            .defaultTtl(defaultTtl?.applyValue({ args0 -> args0 }))
            .maxTtl(maxTtl?.applyValue({ args0 -> args0 }))
            .negativeCaching(negativeCaching?.applyValue({ args0 -> args0 }))
            .negativeCachingPolicies(
                negativeCachingPolicies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .requestCoalescing(requestCoalescing?.applyValue({ args0 -> args0 }))
            .serveWhileStale(serveWhileStale?.applyValue({ args0 -> args0 }))
            .signedUrlCacheMaxAgeSec(signedUrlCacheMaxAgeSec?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [BackendBucketCdnPolicyArgs].
 */
@PulumiTagMarker
public class BackendBucketCdnPolicyArgsBuilder internal constructor() {
    private var bypassCacheOnRequestHeaders:
        Output>? = null

    private var cacheKeyPolicy: Output? = null

    private var cacheMode: Output? = null

    private var clientTtl: Output? = null

    private var defaultTtl: Output? = null

    private var maxTtl: Output? = null

    private var negativeCaching: Output? = null

    private var negativeCachingPolicies:
        Output>? = null

    private var requestCoalescing: Output? = null

    private var serveWhileStale: Output? = null

    private var signedUrlCacheMaxAgeSec: Output? = null

    /**
     * @param value Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
     * Structure is documented below.
     */
    @JvmName("vbxhmtvykswyrrdf")
    public suspend fun bypassCacheOnRequestHeaders(`value`: Output>) {
        this.bypassCacheOnRequestHeaders = value
    }

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

    /**
     * @param values Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
     * Structure is documented below.
     */
    @JvmName("cbhpypjglgxqypco")
    public suspend fun bypassCacheOnRequestHeaders(values: List>) {
        this.bypassCacheOnRequestHeaders = Output.all(values)
    }

    /**
     * @param value The CacheKeyPolicy for this CdnPolicy.
     * Structure is documented below.
     */
    @JvmName("klaniiynahouoakr")
    public suspend fun cacheKeyPolicy(`value`: Output) {
        this.cacheKeyPolicy = value
    }

    /**
     * @param value Specifies the cache setting for all responses from this backend.
     * The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC
     * Possible values are: `USE_ORIGIN_HEADERS`, `FORCE_CACHE_ALL`, `CACHE_ALL_STATIC`.
     */
    @JvmName("nimqcdemnhnpaxls")
    public suspend fun cacheMode(`value`: Output) {
        this.cacheMode = value
    }

    /**
     * @param value Specifies the maximum allowed TTL for cached content served by this origin.
     */
    @JvmName("qekcjiqlcuxfhnpn")
    public suspend fun clientTtl(`value`: Output) {
        this.clientTtl = value
    }

    /**
     * @param value Specifies the default TTL for cached content served by this origin for responses
     * that do not have an existing valid TTL (max-age or s-max-age).
     */
    @JvmName("wgcnhplsuofcyeda")
    public suspend fun defaultTtl(`value`: Output) {
        this.defaultTtl = value
    }

    /**
     * @param value Specifies the maximum allowed TTL for cached content served by this origin.
     */
    @JvmName("hrcpuifswxswqopg")
    public suspend fun maxTtl(`value`: Output) {
        this.maxTtl = value
    }

    /**
     * @param value Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects.
     */
    @JvmName("nsnpjntephjchgin")
    public suspend fun negativeCaching(`value`: Output) {
        this.negativeCaching = value
    }

    /**
     * @param value Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
     * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
     * Structure is documented below.
     */
    @JvmName("pxvcmcvyjyajddmx")
    public suspend fun negativeCachingPolicies(`value`: Output>) {
        this.negativeCachingPolicies = value
    }

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

    /**
     * @param values Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
     * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
     * Structure is documented below.
     */
    @JvmName("tiuqlvmrpgydxeoq")
    public suspend fun negativeCachingPolicies(values: List>) {
        this.negativeCachingPolicies = Output.all(values)
    }

    /**
     * @param value If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin.
     */
    @JvmName("ttwhnkaunmrfmhqf")
    public suspend fun requestCoalescing(`value`: Output) {
        this.requestCoalescing = value
    }

    /**
     * @param value Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache.
     */
    @JvmName("ypedwuavtwhakawn")
    public suspend fun serveWhileStale(`value`: Output) {
        this.serveWhileStale = value
    }

    /**
     * @param value Maximum number of seconds the response to a signed URL request will
     * be considered fresh. After this time period,
     * the response will be revalidated before being served.
     * When serving responses to signed URL requests,
     * Cloud CDN will internally behave as though
     * all responses from this backend had a "Cache-Control: public,
     * max-age=[TTL]" header, regardless of any existing Cache-Control
     * header. The actual headers served in responses will not be altered.
     */
    @JvmName("atqgikdbjvtanuqj")
    public suspend fun signedUrlCacheMaxAgeSec(`value`: Output) {
        this.signedUrlCacheMaxAgeSec = value
    }

    /**
     * @param value Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
     * Structure is documented below.
     */
    @JvmName("kcwpobvoselgcdhq")
    public suspend fun bypassCacheOnRequestHeaders(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bypassCacheOnRequestHeaders = mapped
    }

    /**
     * @param argument Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
     * Structure is documented below.
     */
    @JvmName("aelmldslykhmgayr")
    public suspend fun bypassCacheOnRequestHeaders(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            BackendBucketCdnPolicyBypassCacheOnRequestHeaderArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.bypassCacheOnRequestHeaders = mapped
    }

    /**
     * @param argument Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
     * Structure is documented below.
     */
    @JvmName("fvicxiamatjlgtlh")
    public suspend fun bypassCacheOnRequestHeaders(vararg argument: suspend BackendBucketCdnPolicyBypassCacheOnRequestHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            BackendBucketCdnPolicyBypassCacheOnRequestHeaderArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.bypassCacheOnRequestHeaders = mapped
    }

    /**
     * @param argument Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
     * Structure is documented below.
     */
    @JvmName("ygtcsomuvkqshxqb")
    public suspend fun bypassCacheOnRequestHeaders(argument: suspend BackendBucketCdnPolicyBypassCacheOnRequestHeaderArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                BackendBucketCdnPolicyBypassCacheOnRequestHeaderArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.bypassCacheOnRequestHeaders = mapped
    }

    /**
     * @param values Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings.
     * Structure is documented below.
     */
    @JvmName("nfjpokxyjspjwykb")
    public suspend fun bypassCacheOnRequestHeaders(vararg values: BackendBucketCdnPolicyBypassCacheOnRequestHeaderArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.bypassCacheOnRequestHeaders = mapped
    }

    /**
     * @param value The CacheKeyPolicy for this CdnPolicy.
     * Structure is documented below.
     */
    @JvmName("ubdtycnkstsevahq")
    public suspend fun cacheKeyPolicy(`value`: BackendBucketCdnPolicyCacheKeyPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cacheKeyPolicy = mapped
    }

    /**
     * @param argument The CacheKeyPolicy for this CdnPolicy.
     * Structure is documented below.
     */
    @JvmName("ngkioxvnvorrsmeh")
    public suspend fun cacheKeyPolicy(argument: suspend BackendBucketCdnPolicyCacheKeyPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = BackendBucketCdnPolicyCacheKeyPolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.cacheKeyPolicy = mapped
    }

    /**
     * @param value Specifies the cache setting for all responses from this backend.
     * The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC
     * Possible values are: `USE_ORIGIN_HEADERS`, `FORCE_CACHE_ALL`, `CACHE_ALL_STATIC`.
     */
    @JvmName("klsqgoffdpqgamuu")
    public suspend fun cacheMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cacheMode = mapped
    }

    /**
     * @param value Specifies the maximum allowed TTL for cached content served by this origin.
     */
    @JvmName("abkbxntloeysxtdy")
    public suspend fun clientTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientTtl = mapped
    }

    /**
     * @param value Specifies the default TTL for cached content served by this origin for responses
     * that do not have an existing valid TTL (max-age or s-max-age).
     */
    @JvmName("jdombpedggwiwkyw")
    public suspend fun defaultTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultTtl = mapped
    }

    /**
     * @param value Specifies the maximum allowed TTL for cached content served by this origin.
     */
    @JvmName("fuqkcnpbyuorboil")
    public suspend fun maxTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxTtl = mapped
    }

    /**
     * @param value Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects.
     */
    @JvmName("pcbadmkjcpujaoxn")
    public suspend fun negativeCaching(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.negativeCaching = mapped
    }

    /**
     * @param value Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
     * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
     * Structure is documented below.
     */
    @JvmName("jgxsfobeaxelbhpx")
    public suspend fun negativeCachingPolicies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.negativeCachingPolicies = mapped
    }

    /**
     * @param argument Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
     * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
     * Structure is documented below.
     */
    @JvmName("ddgiuiexubhpbnst")
    public suspend fun negativeCachingPolicies(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            BackendBucketCdnPolicyNegativeCachingPolicyArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.negativeCachingPolicies = mapped
    }

    /**
     * @param argument Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
     * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
     * Structure is documented below.
     */
    @JvmName("rgvubicrfdfrdvko")
    public suspend fun negativeCachingPolicies(vararg argument: suspend BackendBucketCdnPolicyNegativeCachingPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            BackendBucketCdnPolicyNegativeCachingPolicyArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.negativeCachingPolicies = mapped
    }

    /**
     * @param argument Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
     * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
     * Structure is documented below.
     */
    @JvmName("xytjgnynhundxkok")
    public suspend fun negativeCachingPolicies(argument: suspend BackendBucketCdnPolicyNegativeCachingPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            BackendBucketCdnPolicyNegativeCachingPolicyArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.negativeCachingPolicies = mapped
    }

    /**
     * @param values Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
     * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
     * Structure is documented below.
     */
    @JvmName("rtqrehwwbdrhwbhv")
    public suspend fun negativeCachingPolicies(vararg values: BackendBucketCdnPolicyNegativeCachingPolicyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.negativeCachingPolicies = mapped
    }

    /**
     * @param value If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin.
     */
    @JvmName("rrunlkjchxcawurt")
    public suspend fun requestCoalescing(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestCoalescing = mapped
    }

    /**
     * @param value Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache.
     */
    @JvmName("bdqnjcnbiykblbum")
    public suspend fun serveWhileStale(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serveWhileStale = mapped
    }

    /**
     * @param value Maximum number of seconds the response to a signed URL request will
     * be considered fresh. After this time period,
     * the response will be revalidated before being served.
     * When serving responses to signed URL requests,
     * Cloud CDN will internally behave as though
     * all responses from this backend had a "Cache-Control: public,
     * max-age=[TTL]" header, regardless of any existing Cache-Control
     * header. The actual headers served in responses will not be altered.
     */
    @JvmName("xehukonpiaushvdk")
    public suspend fun signedUrlCacheMaxAgeSec(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.signedUrlCacheMaxAgeSec = mapped
    }

    internal fun build(): BackendBucketCdnPolicyArgs = BackendBucketCdnPolicyArgs(
        bypassCacheOnRequestHeaders = bypassCacheOnRequestHeaders,
        cacheKeyPolicy = cacheKeyPolicy,
        cacheMode = cacheMode,
        clientTtl = clientTtl,
        defaultTtl = defaultTtl,
        maxTtl = maxTtl,
        negativeCaching = negativeCaching,
        negativeCachingPolicies = negativeCachingPolicies,
        requestCoalescing = requestCoalescing,
        serveWhileStale = serveWhileStale,
        signedUrlCacheMaxAgeSec = signedUrlCacheMaxAgeSec,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy