Class LayerVersion
Provides a Lambda Layer Version resource. Lambda Layers allow you to reuse shared bits of code across multiple lambda functions.
For information about Lambda Layers and how to use them, see AWS Lambda Layers
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var lambdaLayer = new Aws.Lambda.LayerVersion("lambdaLayer", new Aws.Lambda.LayerVersionArgs
{
CompatibleRuntimes =
{
"nodejs8.10",
},
Code = new FileArchive("lambda_layer_payload.zip"),
LayerName = "lambda_layer_name",
});
}
}
Specifying the Deployment Package
AWS Lambda Layers expect source code to be provided as a deployment package whose structure varies depending on which compatible_runtimes this layer specifies.
See Runtimes for the valid values of compatible_runtimes.
Once you have created your deployment package you can specify it either directly as a local file (using the filename argument) or
indirectly via Amazon S3 (using the s3_bucket, s3_key and s3_object_version arguments). When providing the deployment
package via S3 it may be useful to use the aws.s3.BucketObject resource to upload it.
For larger deployment packages it is recommended by Amazon to upload via S3, since the S3 API has better support for uploading large files efficiently.
Inherited Members
Namespace: Pulumi.Aws.Lambda
Assembly: Pulumi.Aws.dll
Syntax
public class LayerVersion : CustomResource
Constructors
View SourceLayerVersion(String, LayerVersionArgs, CustomResourceOptions)
Create a LayerVersion resource with the given unique name, arguments, and options.
Declaration
public LayerVersion(string name, LayerVersionArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| LayerVersionArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArn
The Amazon Resource Name (ARN) of the Lambda Layer with version.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Code
The path to the function's deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used.
Declaration
public Output<Archive> Code { get; }
Property Value
| Type | Description |
|---|---|
| Output<Archive> |
CompatibleRuntimes
A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified.
Declaration
public Output<ImmutableArray<string>> CompatibleRuntimes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
CreatedDate
The date this resource was created.
Declaration
public Output<string> CreatedDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
Description of what your Lambda Layer does.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LayerArn
The Amazon Resource Name (ARN) of the Lambda Layer without version.
Declaration
public Output<string> LayerArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LayerName
A unique name for your Lambda Layer
Declaration
public Output<string> LayerName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LicenseInfo
License info for your Lambda Layer. See License Info.
Declaration
public Output<string> LicenseInfo { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
S3Bucket
The S3 bucket location containing the function's deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function.
Declaration
public Output<string> S3Bucket { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
S3Key
The S3 key of an object containing the function's deployment package. Conflicts with filename.
Declaration
public Output<string> S3Key { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
S3ObjectVersion
The object version containing the function's deployment package. Conflicts with filename.
Declaration
public Output<string> S3ObjectVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceCodeHash
Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. The usual way to set this is ${filebase64sha256("file.zip")} (this provider 0.11.12 or later) or ${base64sha256(file("file.zip"))} (this provider 0.11.11 and earlier), where "file.zip" is the local filename of the lambda layer source archive.
Declaration
public Output<string> SourceCodeHash { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceCodeSize
The size in bytes of the function .zip file.
Declaration
public Output<int> SourceCodeSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Version
This Lamba Layer version.
Declaration
public Output<string> Version { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, LayerVersionState, CustomResourceOptions)
Get an existing LayerVersion resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static LayerVersion Get(string name, Input<string> id, LayerVersionState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| LayerVersionState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| LayerVersion |