Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.cloudrunv2.kotlin.inputs.ServiceTemplateArgs.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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.cloudrunv2.kotlin.inputs
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
*
* @property annotations Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
* Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system annotations in v1 now have a corresponding field in v2 RevisionTemplate.
* This field follows Kubernetes annotations' namespacing, limits, and rules.
* @property containers Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
* @property encryptionKey A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek
* @property executionEnvironment The sandbox environment to host this Revision.
* Possible values are: `EXECUTION_ENVIRONMENT_GEN1`, `EXECUTION_ENVIRONMENT_GEN2`.
* @property labels Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc.
* For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.
* Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system labels in v1 now have a corresponding field in v2 RevisionTemplate.
* @property maxInstanceRequestConcurrency Sets the maximum number of requests that each serving instance can receive.
* @property revision The unique name for the revision. If this field is omitted, it will be automatically generated based on the Service name.
* @property scaling Scaling settings for this Revision.
* Structure is documented below.
* @property serviceAccount Email address of the IAM service account associated with the revision of the service. The service account represents the identity of the running revision, and determines what permissions the revision has. If not provided, the revision will use the project's default service account.
* @property sessionAffinity Enables session affinity. For more information, go to https://cloud.google.com/run/docs/configuring/session-affinity
* @property timeout Max allowed time for an instance to respond to a request.
* A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
* @property volumes A list of Volumes to make available to containers.
* Structure is documented below.
* @property vpcAccess VPC Access configuration to use for this Task. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
* Structure is documented below.
*/
public data class ServiceTemplateArgs(
public val annotations: Output>? = null,
public val containers: Output>? = null,
public val encryptionKey: Output? = null,
public val executionEnvironment: Output? = null,
public val labels: Output>? = null,
public val maxInstanceRequestConcurrency: Output? = null,
public val revision: Output? = null,
public val scaling: Output? = null,
public val serviceAccount: Output? = null,
public val sessionAffinity: Output? = null,
public val timeout: Output? = null,
public val volumes: Output>? = null,
public val vpcAccess: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateArgs =
com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateArgs.builder()
.annotations(
annotations?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
)
.containers(
containers?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.encryptionKey(encryptionKey?.applyValue({ args0 -> args0 }))
.executionEnvironment(executionEnvironment?.applyValue({ args0 -> args0 }))
.labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.maxInstanceRequestConcurrency(maxInstanceRequestConcurrency?.applyValue({ args0 -> args0 }))
.revision(revision?.applyValue({ args0 -> args0 }))
.scaling(scaling?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.serviceAccount(serviceAccount?.applyValue({ args0 -> args0 }))
.sessionAffinity(sessionAffinity?.applyValue({ args0 -> args0 }))
.timeout(timeout?.applyValue({ args0 -> args0 }))
.volumes(
volumes?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.vpcAccess(vpcAccess?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}
/**
* Builder for [ServiceTemplateArgs].
*/
@PulumiTagMarker
public class ServiceTemplateArgsBuilder internal constructor() {
private var annotations: Output>? = null
private var containers: Output>? = null
private var encryptionKey: Output? = null
private var executionEnvironment: Output? = null
private var labels: Output>? = null
private var maxInstanceRequestConcurrency: Output? = null
private var revision: Output? = null
private var scaling: Output? = null
private var serviceAccount: Output? = null
private var sessionAffinity: Output? = null
private var timeout: Output? = null
private var volumes: Output>? = null
private var vpcAccess: Output? = null
/**
* @param value Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
* Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system annotations in v1 now have a corresponding field in v2 RevisionTemplate.
* This field follows Kubernetes annotations' namespacing, limits, and rules.
*/
@JvmName("gtruqacxbpsmmcqe")
public suspend fun annotations(`value`: Output>) {
this.annotations = value
}
/**
* @param value Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
*/
@JvmName("klnexfxlggofwqfd")
public suspend fun containers(`value`: Output>) {
this.containers = value
}
@JvmName("edxpmuiacsjuxlhq")
public suspend fun containers(vararg values: Output) {
this.containers = Output.all(values.asList())
}
/**
* @param values Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
*/
@JvmName("kwkuweynrbuddkcg")
public suspend fun containers(values: List>) {
this.containers = Output.all(values)
}
/**
* @param value A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek
*/
@JvmName("ycrnrnpefdkikyhk")
public suspend fun encryptionKey(`value`: Output) {
this.encryptionKey = value
}
/**
* @param value The sandbox environment to host this Revision.
* Possible values are: `EXECUTION_ENVIRONMENT_GEN1`, `EXECUTION_ENVIRONMENT_GEN2`.
*/
@JvmName("hqwbsbgynjumxncv")
public suspend fun executionEnvironment(`value`: Output) {
this.executionEnvironment = value
}
/**
* @param value Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc.
* For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.
* Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system labels in v1 now have a corresponding field in v2 RevisionTemplate.
*/
@JvmName("utpoolgwdmacskhq")
public suspend fun labels(`value`: Output>) {
this.labels = value
}
/**
* @param value Sets the maximum number of requests that each serving instance can receive.
*/
@JvmName("qqsojlfebeipbtdy")
public suspend fun maxInstanceRequestConcurrency(`value`: Output) {
this.maxInstanceRequestConcurrency = value
}
/**
* @param value The unique name for the revision. If this field is omitted, it will be automatically generated based on the Service name.
*/
@JvmName("fpjovkastvlwycje")
public suspend fun revision(`value`: Output) {
this.revision = value
}
/**
* @param value Scaling settings for this Revision.
* Structure is documented below.
*/
@JvmName("ehhwuqoxtsesmixt")
public suspend fun scaling(`value`: Output) {
this.scaling = value
}
/**
* @param value Email address of the IAM service account associated with the revision of the service. The service account represents the identity of the running revision, and determines what permissions the revision has. If not provided, the revision will use the project's default service account.
*/
@JvmName("vbeudgdmaiyyurvy")
public suspend fun serviceAccount(`value`: Output) {
this.serviceAccount = value
}
/**
* @param value Enables session affinity. For more information, go to https://cloud.google.com/run/docs/configuring/session-affinity
*/
@JvmName("lmrrnbijhfdiqpxg")
public suspend fun sessionAffinity(`value`: Output) {
this.sessionAffinity = value
}
/**
* @param value Max allowed time for an instance to respond to a request.
* A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
*/
@JvmName("dbsmmqycuoifcmsr")
public suspend fun timeout(`value`: Output) {
this.timeout = value
}
/**
* @param value A list of Volumes to make available to containers.
* Structure is documented below.
*/
@JvmName("bskdnhssgoptourd")
public suspend fun volumes(`value`: Output>) {
this.volumes = value
}
@JvmName("ffjqckypygrrqohp")
public suspend fun volumes(vararg values: Output) {
this.volumes = Output.all(values.asList())
}
/**
* @param values A list of Volumes to make available to containers.
* Structure is documented below.
*/
@JvmName("rsflaluptiqylyds")
public suspend fun volumes(values: List>) {
this.volumes = Output.all(values)
}
/**
* @param value VPC Access configuration to use for this Task. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
* Structure is documented below.
*/
@JvmName("dxvueffrgjliochw")
public suspend fun vpcAccess(`value`: Output) {
this.vpcAccess = value
}
/**
* @param value Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
* Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system annotations in v1 now have a corresponding field in v2 RevisionTemplate.
* This field follows Kubernetes annotations' namespacing, limits, and rules.
*/
@JvmName("trtqvysrrbduselw")
public suspend fun annotations(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.annotations = mapped
}
/**
* @param values Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
* Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system annotations in v1 now have a corresponding field in v2 RevisionTemplate.
* This field follows Kubernetes annotations' namespacing, limits, and rules.
*/
@JvmName("luhwyiembfjbqadl")
public fun annotations(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.annotations = mapped
}
/**
* @param value Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
*/
@JvmName("wuhnbxhcuwpmbwdg")
public suspend fun containers(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.containers = mapped
}
/**
* @param argument Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
*/
@JvmName("fujjcixertwdpdvx")
public suspend fun containers(argument: List Unit>) {
val toBeMapped = argument.toList().map {
ServiceTemplateContainerArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.containers = mapped
}
/**
* @param argument Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
*/
@JvmName("lkogsfqljjsgxbvf")
public suspend fun containers(vararg argument: suspend ServiceTemplateContainerArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
ServiceTemplateContainerArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.containers = mapped
}
/**
* @param argument Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
*/
@JvmName("envpkhkdknanjsuv")
public suspend fun containers(argument: suspend ServiceTemplateContainerArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
ServiceTemplateContainerArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.containers = mapped
}
/**
* @param values Holds the containers that define the unit of execution for this Service.
* Structure is documented below.
*/
@JvmName("mudmxcgpvghcejuy")
public suspend fun containers(vararg values: ServiceTemplateContainerArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.containers = mapped
}
/**
* @param value A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek
*/
@JvmName("qnkwqjsulyqiomsv")
public suspend fun encryptionKey(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.encryptionKey = mapped
}
/**
* @param value The sandbox environment to host this Revision.
* Possible values are: `EXECUTION_ENVIRONMENT_GEN1`, `EXECUTION_ENVIRONMENT_GEN2`.
*/
@JvmName("spmaghbjnqtsfakk")
public suspend fun executionEnvironment(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.executionEnvironment = mapped
}
/**
* @param value Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc.
* For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.
* Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system labels in v1 now have a corresponding field in v2 RevisionTemplate.
*/
@JvmName("ofectopyovnymtvg")
public suspend fun labels(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param values Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc.
* For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.
* Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
* All system labels in v1 now have a corresponding field in v2 RevisionTemplate.
*/
@JvmName("lepuustfgqwxjodd")
public fun labels(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param value Sets the maximum number of requests that each serving instance can receive.
*/
@JvmName("opgtvfuybtrkpqkb")
public suspend fun maxInstanceRequestConcurrency(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.maxInstanceRequestConcurrency = mapped
}
/**
* @param value The unique name for the revision. If this field is omitted, it will be automatically generated based on the Service name.
*/
@JvmName("gaiowklisjqmjhhi")
public suspend fun revision(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.revision = mapped
}
/**
* @param value Scaling settings for this Revision.
* Structure is documented below.
*/
@JvmName("mqntmeralsbihylx")
public suspend fun scaling(`value`: ServiceTemplateScalingArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.scaling = mapped
}
/**
* @param argument Scaling settings for this Revision.
* Structure is documented below.
*/
@JvmName("wodoheqoawpfypuo")
public suspend fun scaling(argument: suspend ServiceTemplateScalingArgsBuilder.() -> Unit) {
val toBeMapped = ServiceTemplateScalingArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.scaling = mapped
}
/**
* @param value Email address of the IAM service account associated with the revision of the service. The service account represents the identity of the running revision, and determines what permissions the revision has. If not provided, the revision will use the project's default service account.
*/
@JvmName("sfmkthumjputwsgf")
public suspend fun serviceAccount(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.serviceAccount = mapped
}
/**
* @param value Enables session affinity. For more information, go to https://cloud.google.com/run/docs/configuring/session-affinity
*/
@JvmName("euiakfhadnvdllfk")
public suspend fun sessionAffinity(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sessionAffinity = mapped
}
/**
* @param value Max allowed time for an instance to respond to a request.
* A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
*/
@JvmName("fludeplwtyppcpgs")
public suspend fun timeout(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.timeout = mapped
}
/**
* @param value A list of Volumes to make available to containers.
* Structure is documented below.
*/
@JvmName("wdyfbpnkfevtkbfp")
public suspend fun volumes(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.volumes = mapped
}
/**
* @param argument A list of Volumes to make available to containers.
* Structure is documented below.
*/
@JvmName("rlphmjwbracjmqei")
public suspend fun volumes(argument: List Unit>) {
val toBeMapped = argument.toList().map {
ServiceTemplateVolumeArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.volumes = mapped
}
/**
* @param argument A list of Volumes to make available to containers.
* Structure is documented below.
*/
@JvmName("gxflkkdtjepbrpqr")
public suspend fun volumes(vararg argument: suspend ServiceTemplateVolumeArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
ServiceTemplateVolumeArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.volumes = mapped
}
/**
* @param argument A list of Volumes to make available to containers.
* Structure is documented below.
*/
@JvmName("hikpynumuivgwbpm")
public suspend fun volumes(argument: suspend ServiceTemplateVolumeArgsBuilder.() -> Unit) {
val toBeMapped = listOf(ServiceTemplateVolumeArgsBuilder().applySuspend { argument() }.build())
val mapped = of(toBeMapped)
this.volumes = mapped
}
/**
* @param values A list of Volumes to make available to containers.
* Structure is documented below.
*/
@JvmName("xaidntlstlibvegq")
public suspend fun volumes(vararg values: ServiceTemplateVolumeArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.volumes = mapped
}
/**
* @param value VPC Access configuration to use for this Task. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
* Structure is documented below.
*/
@JvmName("emvlhadwcyeewnmm")
public suspend fun vpcAccess(`value`: ServiceTemplateVpcAccessArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.vpcAccess = mapped
}
/**
* @param argument VPC Access configuration to use for this Task. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
* Structure is documented below.
*/
@JvmName("mhlsbtpltcjwhxub")
public suspend fun vpcAccess(argument: suspend ServiceTemplateVpcAccessArgsBuilder.() -> Unit) {
val toBeMapped = ServiceTemplateVpcAccessArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.vpcAccess = mapped
}
internal fun build(): ServiceTemplateArgs = ServiceTemplateArgs(
annotations = annotations,
containers = containers,
encryptionKey = encryptionKey,
executionEnvironment = executionEnvironment,
labels = labels,
maxInstanceRequestConcurrency = maxInstanceRequestConcurrency,
revision = revision,
scaling = scaling,
serviceAccount = serviceAccount,
sessionAffinity = sessionAffinity,
timeout = timeout,
volumes = volumes,
vpcAccess = vpcAccess,
)
}