com.pulumi.awsnative.lambda.kotlin.LayerVersion.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.lambda.kotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.LayerVersionContent
import com.pulumi.awsnative.lambda.kotlin.outputs.LayerVersionContent.Companion.toKotlin
import com.pulumi.core.Output
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [LayerVersion].
*/
@PulumiTagMarker
public class LayerVersionResourceBuilder internal constructor() {
public var name: String? = null
public var args: LayerVersionArgs = LayerVersionArgs()
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 LayerVersionArgsBuilder.() -> Unit) {
val builder = LayerVersionArgsBuilder()
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(): LayerVersion {
val builtJavaResource = com.pulumi.awsnative.lambda.LayerVersion(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return LayerVersion(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Lambda::LayerVersion
*/
public class LayerVersion internal constructor(
override val javaResource: com.pulumi.awsnative.lambda.LayerVersion,
) : KotlinCustomResource(javaResource, LayerVersionMapper) {
/**
* A list of compatible instruction set architectures.
*/
public val compatibleArchitectures: Output>?
get() = javaResource.compatibleArchitectures().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.
*/
public val compatibleRuntimes: Output>?
get() = javaResource.compatibleRuntimes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The function layer archive.
*/
public val content: Output
get() = javaResource.content().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
/**
* The description of the version.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name or Amazon Resource Name (ARN) of the layer.
*/
public val layerName: Output?
get() = javaResource.layerName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ARN of the layer version.
*/
public val layerVersionArn: Output
get() = javaResource.layerVersionArn().applyValue({ args0 -> args0 })
/**
* The layer's software license.
*/
public val licenseInfo: Output?
get() = javaResource.licenseInfo().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object LayerVersionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.lambda.LayerVersion::class == javaResource::class
override fun map(javaResource: Resource): LayerVersion = LayerVersion(
javaResource as
com.pulumi.awsnative.lambda.LayerVersion,
)
}
/**
* @see [LayerVersion].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [LayerVersion].
*/
public suspend fun layerVersion(
name: String,
block: suspend LayerVersionResourceBuilder.() -> Unit,
): LayerVersion {
val builder = LayerVersionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [LayerVersion].
* @param name The _unique_ name of the resulting resource.
*/
public fun layerVersion(name: String): LayerVersion {
val builder = LayerVersionResourceBuilder()
builder.name(name)
return builder.build()
}