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

com.pulumi.aws.cloudfront.kotlin.FunctionArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.cloudfront.kotlin

import com.pulumi.aws.cloudfront.FunctionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a CloudFront Function resource. With CloudFront Functions in Amazon CloudFront, you can write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations.
 * See [CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-functions.html)
 * > **NOTE:** You cannot delete a function if it’s associated with a cache behavior. First, update your distributions to remove the function association from all cache behaviors, then delete the function.
 * ## Example Usage
 * ## Import
 * Using `pulumi import`, import CloudFront Functions using the `name`. For example:
 * ```sh
 * $ pulumi import aws:cloudfront/function:Function test my_test_function
 * ```
 * @property code Source code of the function
 * @property comment Comment.
 * @property keyValueStoreAssociations List of `aws.cloudfront.KeyValueStore` ARNs to be associated to the function. AWS limits associations to on key value store per function.
 * @property name Unique name for your CloudFront Function.
 * @property publish Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
 * @property runtime Identifier of the function's runtime. Valid values are `cloudfront-js-1.0` and `cloudfront-js-2.0`.
 * The following arguments are optional:
 */
public data class FunctionArgs(
    public val code: Output? = null,
    public val comment: Output? = null,
    public val keyValueStoreAssociations: Output>? = null,
    public val name: Output? = null,
    public val publish: Output? = null,
    public val runtime: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.cloudfront.FunctionArgs =
        com.pulumi.aws.cloudfront.FunctionArgs.builder()
            .code(code?.applyValue({ args0 -> args0 }))
            .comment(comment?.applyValue({ args0 -> args0 }))
            .keyValueStoreAssociations(
                keyValueStoreAssociations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .publish(publish?.applyValue({ args0 -> args0 }))
            .runtime(runtime?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [FunctionArgs].
 */
@PulumiTagMarker
public class FunctionArgsBuilder internal constructor() {
    private var code: Output? = null

    private var comment: Output? = null

    private var keyValueStoreAssociations: Output>? = null

    private var name: Output? = null

    private var publish: Output? = null

    private var runtime: Output? = null

    /**
     * @param value Source code of the function
     */
    @JvmName("elgxowkcjnyyllsc")
    public suspend fun code(`value`: Output) {
        this.code = value
    }

    /**
     * @param value Comment.
     */
    @JvmName("okuguxvftjogokay")
    public suspend fun comment(`value`: Output) {
        this.comment = value
    }

    /**
     * @param value List of `aws.cloudfront.KeyValueStore` ARNs to be associated to the function. AWS limits associations to on key value store per function.
     */
    @JvmName("ykjtykqnlubtagpl")
    public suspend fun keyValueStoreAssociations(`value`: Output>) {
        this.keyValueStoreAssociations = value
    }

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

    /**
     * @param values List of `aws.cloudfront.KeyValueStore` ARNs to be associated to the function. AWS limits associations to on key value store per function.
     */
    @JvmName("hjlojilbducplpga")
    public suspend fun keyValueStoreAssociations(values: List>) {
        this.keyValueStoreAssociations = Output.all(values)
    }

    /**
     * @param value Unique name for your CloudFront Function.
     */
    @JvmName("sjonjnnxyaqgtaxu")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
     */
    @JvmName("deqqjvtwejalixtn")
    public suspend fun publish(`value`: Output) {
        this.publish = value
    }

    /**
     * @param value Identifier of the function's runtime. Valid values are `cloudfront-js-1.0` and `cloudfront-js-2.0`.
     * The following arguments are optional:
     */
    @JvmName("llsfaufaiuowgqwn")
    public suspend fun runtime(`value`: Output) {
        this.runtime = value
    }

    /**
     * @param value Source code of the function
     */
    @JvmName("hdlmlmraynxnopyo")
    public suspend fun code(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.code = mapped
    }

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

    /**
     * @param value List of `aws.cloudfront.KeyValueStore` ARNs to be associated to the function. AWS limits associations to on key value store per function.
     */
    @JvmName("fvlivrvltolyffgq")
    public suspend fun keyValueStoreAssociations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyValueStoreAssociations = mapped
    }

    /**
     * @param values List of `aws.cloudfront.KeyValueStore` ARNs to be associated to the function. AWS limits associations to on key value store per function.
     */
    @JvmName("aymmrmnkiccsfbob")
    public suspend fun keyValueStoreAssociations(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.keyValueStoreAssociations = mapped
    }

    /**
     * @param value Unique name for your CloudFront Function.
     */
    @JvmName("ihhinmqeflvbwfmw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
     */
    @JvmName("puliadaiwpeaqmhl")
    public suspend fun publish(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publish = mapped
    }

    /**
     * @param value Identifier of the function's runtime. Valid values are `cloudfront-js-1.0` and `cloudfront-js-2.0`.
     * The following arguments are optional:
     */
    @JvmName("pcajsqxyjatwocma")
    public suspend fun runtime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runtime = mapped
    }

    internal fun build(): FunctionArgs = FunctionArgs(
        code = code,
        comment = comment,
        keyValueStoreAssociations = keyValueStoreAssociations,
        name = name,
        publish = publish,
        runtime = runtime,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy