com.pulumi.awsnative.lambda.kotlin.LambdaFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-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.awsnative.lambda.kotlin
import com.pulumi.awsnative.lambda.LambdaFunctions.getAliasPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getCodeSigningConfigPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getEventInvokeConfigPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getEventSourceMappingPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getFunctionPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getLayerVersionPermissionPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getLayerVersionPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getPermissionPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getUrlPlain
import com.pulumi.awsnative.lambda.LambdaFunctions.getVersionPlain
import com.pulumi.awsnative.lambda.kotlin.inputs.GetAliasPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetAliasPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetCodeSigningConfigPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetCodeSigningConfigPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetEventInvokeConfigPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetEventInvokeConfigPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetEventSourceMappingPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetEventSourceMappingPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetFunctionPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetFunctionPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetLayerVersionPermissionPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetLayerVersionPermissionPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetLayerVersionPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetLayerVersionPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetPermissionPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetPermissionPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetUrlPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetUrlPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.inputs.GetVersionPlainArgs
import com.pulumi.awsnative.lambda.kotlin.inputs.GetVersionPlainArgsBuilder
import com.pulumi.awsnative.lambda.kotlin.outputs.GetAliasResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetCodeSigningConfigResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetEventInvokeConfigResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetEventSourceMappingResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetFunctionResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetLayerVersionPermissionResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetLayerVersionResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetPermissionResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetUrlResult
import com.pulumi.awsnative.lambda.kotlin.outputs.GetVersionResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.awsnative.lambda.kotlin.outputs.GetAliasResult.Companion.toKotlin as getAliasResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetCodeSigningConfigResult.Companion.toKotlin as getCodeSigningConfigResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetEventInvokeConfigResult.Companion.toKotlin as getEventInvokeConfigResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetEventSourceMappingResult.Companion.toKotlin as getEventSourceMappingResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetFunctionResult.Companion.toKotlin as getFunctionResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetLayerVersionPermissionResult.Companion.toKotlin as getLayerVersionPermissionResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetLayerVersionResult.Companion.toKotlin as getLayerVersionResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetPermissionResult.Companion.toKotlin as getPermissionResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetUrlResult.Companion.toKotlin as getUrlResultToKotlin
import com.pulumi.awsnative.lambda.kotlin.outputs.GetVersionResult.Companion.toKotlin as getVersionResultToKotlin
public object LambdaFunctions {
/**
* Resource Type definition for AWS::Lambda::Alias
* @param argument null
* @return null
*/
public suspend fun getAlias(argument: GetAliasPlainArgs): GetAliasResult =
getAliasResultToKotlin(getAliasPlain(argument.toJava()).await())
/**
* @see [getAlias].
* @param aliasArn Lambda Alias ARN generated by the service.
* @return null
*/
public suspend fun getAlias(aliasArn: String): GetAliasResult {
val argument = GetAliasPlainArgs(
aliasArn = aliasArn,
)
return getAliasResultToKotlin(getAliasPlain(argument.toJava()).await())
}
/**
* @see [getAlias].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetAliasPlainArgs].
* @return null
*/
public suspend fun getAlias(argument: suspend GetAliasPlainArgsBuilder.() -> Unit): GetAliasResult {
val builder = GetAliasPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getAliasResultToKotlin(getAliasPlain(builtArgument.toJava()).await())
}
/**
* Resource Type definition for AWS::Lambda::CodeSigningConfig.
* @param argument null
* @return null
*/
public suspend fun getCodeSigningConfig(argument: GetCodeSigningConfigPlainArgs): GetCodeSigningConfigResult =
getCodeSigningConfigResultToKotlin(getCodeSigningConfigPlain(argument.toJava()).await())
/**
* @see [getCodeSigningConfig].
* @param codeSigningConfigArn A unique Arn for CodeSigningConfig resource
* @return null
*/
public suspend fun getCodeSigningConfig(codeSigningConfigArn: String): GetCodeSigningConfigResult {
val argument = GetCodeSigningConfigPlainArgs(
codeSigningConfigArn = codeSigningConfigArn,
)
return getCodeSigningConfigResultToKotlin(getCodeSigningConfigPlain(argument.toJava()).await())
}
/**
* @see [getCodeSigningConfig].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetCodeSigningConfigPlainArgs].
* @return null
*/
public suspend fun getCodeSigningConfig(argument: suspend GetCodeSigningConfigPlainArgsBuilder.() -> Unit): GetCodeSigningConfigResult {
val builder = GetCodeSigningConfigPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getCodeSigningConfigResultToKotlin(getCodeSigningConfigPlain(builtArgument.toJava()).await())
}
/**
* The AWS::Lambda::EventInvokeConfig resource configures options for asynchronous invocation on a version or an alias.
* @param argument null
* @return null
*/
public suspend fun getEventInvokeConfig(argument: GetEventInvokeConfigPlainArgs): GetEventInvokeConfigResult =
getEventInvokeConfigResultToKotlin(getEventInvokeConfigPlain(argument.toJava()).await())
/**
* @see [getEventInvokeConfig].
* @param functionName The name of the Lambda function.
* @param qualifier The identifier of a version or alias.
* @return null
*/
public suspend fun getEventInvokeConfig(functionName: String, qualifier: String): GetEventInvokeConfigResult {
val argument = GetEventInvokeConfigPlainArgs(
functionName = functionName,
qualifier = qualifier,
)
return getEventInvokeConfigResultToKotlin(getEventInvokeConfigPlain(argument.toJava()).await())
}
/**
* @see [getEventInvokeConfig].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetEventInvokeConfigPlainArgs].
* @return null
*/
public suspend fun getEventInvokeConfig(argument: suspend GetEventInvokeConfigPlainArgsBuilder.() -> Unit): GetEventInvokeConfigResult {
val builder = GetEventInvokeConfigPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getEventInvokeConfigResultToKotlin(getEventInvokeConfigPlain(builtArgument.toJava()).await())
}
/**
* The ``AWS::Lambda::EventSourceMapping`` resource creates a mapping between an event source and an LAMlong function. LAM reads items from the event source and triggers the function.
* For details about each event source type, see the following topics. In particular, each of the topics describes the required and optional parameters for the specific event source.
* + [Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping)
* + [Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping)
* + [Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource)
* + [Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping)
* + [Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html)
* + [Configuring Self-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html)
* + [Configuring Amazon DocumentDB as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html)
* @param argument null
* @return null
*/
public suspend fun getEventSourceMapping(argument: GetEventSourceMappingPlainArgs): GetEventSourceMappingResult =
getEventSourceMappingResultToKotlin(getEventSourceMappingPlain(argument.toJava()).await())
/**
* @see [getEventSourceMapping].
* @param id The event source mapping's ID.
* @return null
*/
public suspend fun getEventSourceMapping(id: String): GetEventSourceMappingResult {
val argument = GetEventSourceMappingPlainArgs(
id = id,
)
return getEventSourceMappingResultToKotlin(getEventSourceMappingPlain(argument.toJava()).await())
}
/**
* @see [getEventSourceMapping].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetEventSourceMappingPlainArgs].
* @return null
*/
public suspend fun getEventSourceMapping(argument: suspend GetEventSourceMappingPlainArgsBuilder.() -> Unit): GetEventSourceMappingResult {
val builder = GetEventSourceMappingPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getEventSourceMappingResultToKotlin(getEventSourceMappingPlain(builtArgument.toJava()).await())
}
/**
* The ``AWS::Lambda::Function`` resource creates a Lambda function. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html). The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing.
* You set the package type to ``Image`` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html). For a container image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to specify the handler and runtime properties.
* You set the package type to ``Zip`` if the deployment package is a [.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip). For a .zip file archive, the code property specifies the location of the .zip file. You must also specify the handler and runtime properties. For a Python example, see [Deploy Python Lambda functions with .zip file archives](https://docs.aws.amazon.com/lambda/latest/dg/python-package.html).
* You can use [code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html) if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with ``UpdateFunctionCode``, Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.
* Note that you configure [provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html) on a ``AWS::Lambda::Version`` or a ``AWS::Lambda::Alias``.
* For a complete introduction to Lambda functions, see [What is Lambda?](https://docs.aws.amazon.com/lambda/latest/dg/lambda-welcome.html) in the *Lambda developer guide.*
* @param argument null
* @return null
*/
public suspend fun getFunction(argument: GetFunctionPlainArgs): GetFunctionResult =
getFunctionResultToKotlin(getFunctionPlain(argument.toJava()).await())
/**
* @see [getFunction].
* @param functionName The name of the Lambda function, up to 64 characters in length. If you don't specify a name, CFN generates one.
* If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
* @return null
*/
public suspend fun getFunction(functionName: String): GetFunctionResult {
val argument = GetFunctionPlainArgs(
functionName = functionName,
)
return getFunctionResultToKotlin(getFunctionPlain(argument.toJava()).await())
}
/**
* @see [getFunction].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetFunctionPlainArgs].
* @return null
*/
public suspend fun getFunction(argument: suspend GetFunctionPlainArgsBuilder.() -> Unit): GetFunctionResult {
val builder = GetFunctionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getFunctionResultToKotlin(getFunctionPlain(builtArgument.toJava()).await())
}
/**
* Resource Type definition for AWS::Lambda::LayerVersion
* @param argument null
* @return null
*/
public suspend fun getLayerVersion(argument: GetLayerVersionPlainArgs): GetLayerVersionResult =
getLayerVersionResultToKotlin(getLayerVersionPlain(argument.toJava()).await())
/**
* @see [getLayerVersion].
* @param layerVersionArn The ARN of the layer version.
* @return null
*/
public suspend fun getLayerVersion(layerVersionArn: String): GetLayerVersionResult {
val argument = GetLayerVersionPlainArgs(
layerVersionArn = layerVersionArn,
)
return getLayerVersionResultToKotlin(getLayerVersionPlain(argument.toJava()).await())
}
/**
* @see [getLayerVersion].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetLayerVersionPlainArgs].
* @return null
*/
public suspend fun getLayerVersion(argument: suspend GetLayerVersionPlainArgsBuilder.() -> Unit): GetLayerVersionResult {
val builder = GetLayerVersionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getLayerVersionResultToKotlin(getLayerVersionPlain(builtArgument.toJava()).await())
}
/**
* Schema for Lambda LayerVersionPermission
* @param argument null
* @return null
*/
public suspend fun getLayerVersionPermission(argument: GetLayerVersionPermissionPlainArgs): GetLayerVersionPermissionResult =
getLayerVersionPermissionResultToKotlin(getLayerVersionPermissionPlain(argument.toJava()).await())
/**
* @see [getLayerVersionPermission].
* @param id ID generated by service
* @return null
*/
public suspend fun getLayerVersionPermission(id: String): GetLayerVersionPermissionResult {
val argument = GetLayerVersionPermissionPlainArgs(
id = id,
)
return getLayerVersionPermissionResultToKotlin(getLayerVersionPermissionPlain(argument.toJava()).await())
}
/**
* @see [getLayerVersionPermission].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetLayerVersionPermissionPlainArgs].
* @return null
*/
public suspend fun getLayerVersionPermission(argument: suspend GetLayerVersionPermissionPlainArgsBuilder.() -> Unit): GetLayerVersionPermissionResult {
val builder = GetLayerVersionPermissionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getLayerVersionPermissionResultToKotlin(getLayerVersionPermissionPlain(builtArgument.toJava()).await())
}
/**
* The ``AWS::Lambda::Permission`` resource grants an AWS service or another account permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function.
* To grant permission to another account, specify the account ID as the ``Principal``. To grant permission to an organization defined in AOlong, specify the organization ID as the ``PrincipalOrgID``. For AWS services, the principal is a domain-style identifier defined by the service, like ``s3.amazonaws.com`` or ``sns.amazonaws.com``. For AWS services, you can also specify the ARN of the associated resource as the ``SourceArn``. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function.
* If your function has a function URL, you can specify the ``FunctionUrlAuthType`` parameter. This adds a condition to your permission that only applies when your function URL's ``AuthType`` matches the specified ``FunctionUrlAuthType``. For more information about the ``AuthType`` parameter, see [Security and auth model for function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html).
* This resource adds a statement to a resource-based permission policy for the function. For more information about function policies, see [Lambda Function Policies](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html).
* @param argument null
* @return null
*/
public suspend fun getPermission(argument: GetPermissionPlainArgs): GetPermissionResult =
getPermissionResultToKotlin(getPermissionPlain(argument.toJava()).await())
/**
* @see [getPermission].
* @param functionName The name or ARN of the Lambda function, version, or alias.
* **Name formats**
* + *Function name* – ``my-function`` (name-only), ``my-function:v1`` (with alias).
* + *Function ARN* – ``arn:aws:lambda:us-west-2:123456789012:function:my-function``.
* + *Partial ARN* – ``123456789012:function:my-function``.
* You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
* @param id
* @return null
*/
public suspend fun getPermission(functionName: String, id: String): GetPermissionResult {
val argument = GetPermissionPlainArgs(
functionName = functionName,
id = id,
)
return getPermissionResultToKotlin(getPermissionPlain(argument.toJava()).await())
}
/**
* @see [getPermission].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetPermissionPlainArgs].
* @return null
*/
public suspend fun getPermission(argument: suspend GetPermissionPlainArgsBuilder.() -> Unit): GetPermissionResult {
val builder = GetPermissionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getPermissionResultToKotlin(getPermissionPlain(builtArgument.toJava()).await())
}
/**
* Resource Type definition for AWS::Lambda::Url
* @param argument null
* @return null
*/
public suspend fun getUrl(argument: GetUrlPlainArgs): GetUrlResult =
getUrlResultToKotlin(getUrlPlain(argument.toJava()).await())
/**
* @see [getUrl].
* @param functionArn The full Amazon Resource Name (ARN) of the function associated with the Function URL.
* @return null
*/
public suspend fun getUrl(functionArn: String): GetUrlResult {
val argument = GetUrlPlainArgs(
functionArn = functionArn,
)
return getUrlResultToKotlin(getUrlPlain(argument.toJava()).await())
}
/**
* @see [getUrl].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetUrlPlainArgs].
* @return null
*/
public suspend fun getUrl(argument: suspend GetUrlPlainArgsBuilder.() -> Unit): GetUrlResult {
val builder = GetUrlPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getUrlResultToKotlin(getUrlPlain(builtArgument.toJava()).await())
}
/**
* Resource Type definition for AWS::Lambda::Version
* @param argument null
* @return null
*/
public suspend fun getVersion(argument: GetVersionPlainArgs): GetVersionResult =
getVersionResultToKotlin(getVersionPlain(argument.toJava()).await())
/**
* @see [getVersion].
* @param functionArn The ARN of the version.
* @return null
*/
public suspend fun getVersion(functionArn: String): GetVersionResult {
val argument = GetVersionPlainArgs(
functionArn = functionArn,
)
return getVersionResultToKotlin(getVersionPlain(argument.toJava()).await())
}
/**
* @see [getVersion].
* @param argument Builder for [com.pulumi.awsnative.lambda.kotlin.inputs.GetVersionPlainArgs].
* @return null
*/
public suspend fun getVersion(argument: suspend GetVersionPlainArgsBuilder.() -> Unit): GetVersionResult {
val builder = GetVersionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getVersionResultToKotlin(getVersionPlain(builtArgument.toJava()).await())
}
}