com.pulumi.aws.cloudfront.kotlin.FunctionArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.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
© 2015 - 2024 Weber Informatics LLC | Privacy Policy