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

com.pulumi.awsnative.lambda.kotlin.EventInvokeConfig.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.lambda.kotlin

import com.pulumi.awsnative.lambda.kotlin.outputs.EventInvokeConfigDestinationConfig
import com.pulumi.awsnative.lambda.kotlin.outputs.EventInvokeConfigDestinationConfig.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [EventInvokeConfig].
 */
@PulumiTagMarker
public class EventInvokeConfigResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: EventInvokeConfigArgs = EventInvokeConfigArgs()

    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 EventInvokeConfigArgsBuilder.() -> Unit) {
        val builder = EventInvokeConfigArgsBuilder()
        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(): EventInvokeConfig {
        val builtJavaResource = com.pulumi.awsnative.lambda.EventInvokeConfig(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return EventInvokeConfig(builtJavaResource)
    }
}

/**
 * The AWS::Lambda::EventInvokeConfig resource configures options for asynchronous invocation on a version or an alias.
 */
public class EventInvokeConfig internal constructor(
    override val javaResource: com.pulumi.awsnative.lambda.EventInvokeConfig,
) : KotlinCustomResource(javaResource, EventInvokeConfigMapper) {
    /**
     * A destination for events after they have been sent to a function for processing.
     * **Destinations** - *Function* - The Amazon Resource Name (ARN) of a Lambda function.
     * - *Queue* - The ARN of a standard SQS queue.
     * - *Topic* - The ARN of a standard SNS topic.
     * - *Event Bus* - The ARN of an Amazon EventBridge event bus.
     */
    public val destinationConfig: Output?
        get() = javaResource.destinationConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> toKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The name of the Lambda function.
     */
    public val functionName: Output
        get() = javaResource.functionName().applyValue({ args0 -> args0 })

    /**
     * The maximum age of a request that Lambda sends to a function for processing.
     */
    public val maximumEventAgeInSeconds: Output?
        get() = javaResource.maximumEventAgeInSeconds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The maximum number of times to retry when the function returns an error.
     */
    public val maximumRetryAttempts: Output?
        get() = javaResource.maximumRetryAttempts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The identifier of a version or alias.
     */
    public val qualifier: Output
        get() = javaResource.qualifier().applyValue({ args0 -> args0 })
}

public object EventInvokeConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.lambda.EventInvokeConfig::class == javaResource::class

    override fun map(javaResource: Resource): EventInvokeConfig = EventInvokeConfig(
        javaResource as
            com.pulumi.awsnative.lambda.EventInvokeConfig,
    )
}

/**
 * @see [EventInvokeConfig].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [EventInvokeConfig].
 */
public suspend fun eventInvokeConfig(
    name: String,
    block: suspend EventInvokeConfigResourceBuilder.() -> Unit,
): EventInvokeConfig {
    val builder = EventInvokeConfigResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [EventInvokeConfig].
 * @param name The _unique_ name of the resulting resource.
 */
public fun eventInvokeConfig(name: String): EventInvokeConfig {
    val builder = EventInvokeConfigResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy