An open API service indexing awesome lists of open source software.

https://github.com/enter-at/terraform-aws-lambda-layer

Terraform module designed to facilitate the creation of AWS Lambda layers
https://github.com/enter-at/terraform-aws-lambda-layer

aws aws-lambda aws-lambda-layer terraform terraform-module

Last synced: 6 months ago
JSON representation

Terraform module designed to facilitate the creation of AWS Lambda layers

Awesome Lists containing this project

README

          

# terraform-aws-lambda-layer
[![Build Status](https://github.com/enter-at/terraform-aws-lambda-layer/workflows/Code%20checks%20and%20tests/badge.svg)](https://github.com/enter-at/terraform-aws-lambda-layer/actions) [![Latest Release](https://img.shields.io/github/release/enter-at/terraform-aws-lambda-layer.svg)](https://github.com/enter-at/terraform-aws-lambda-layer/releases/latest) [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Terraform module designed to facilitate the creation of AWS Lambda layers.

---

It's 100% Open Source and licensed under the [APACHE2](LICENSE).

## Usage

**IMPORTANT:** The `main` branch is used in `source` just as an example. In your code, do not pin to `main` because there may be breaking changes between releases.
Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest releases](https://github.com/enter-at/terraform-aws-lambda-layer/releases).

### Simple Example

```hcl
module "layer" {
source = "git::https://github.com/enter-at/terraform-aws-lambda-layer.git?ref=main"
layer_name = "dependencies"
package_file = "../Pipfile"
}
```

### Advanced Example

```hcl
module "layer" {
source = "git::https://github.com/enter-at/terraform-aws-lambda-layer.git?ref=main"
layer_name = "dependencies"
source_dir = "../src/lib"
source_type = "python"

rsync_pattern = [
"--exclude='**tests**'",
"--exclude='**__pycache__**'",
"--include=module/{a,b,c}/",
"--include='*.py'",
"--exclude='module/*'"
]
}
```

## Requirements

| Name | Version |
|------|---------|
| terraform | >= 0.13 |

## Providers

| Name | Version |
|------|---------|
| archive | n/a |
| aws | n/a |
| null | n/a |
| random | n/a |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| compatible\_runtimes | (Optional) A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified. | `list(string)` | `null` | no |
| description | (Optional) Description of what the Lambda layer does. | `string` | `null` | no |
| layer\_name | (Required) A unique name for the Lambda Layer. | `string` | n/a | yes |
| package\_file | (Optional) The location of the package manager config file. Can be one of (package.json, requirements.txt, Pipfile) | `string` | `null` | no |
| rsync\_pattern | (Optional) A list of rsync pattern to include or exclude files and directories. | `list(string)` |

[
"--include=*"
]
| no |
| source\_dir | (Optional) The location of the Lamvda layer source code. Requires source\_type to be defined. | `string` | `null` | no |
| source\_type | (Optional) The location of the Lambda layer source type. Can be one of (nodejs, python) | `string` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| arn | The Amazon Resource Name (ARN) of the Lambda layer with version. |
| created\_date | The date the layer was created. |
| layer\_arn | The Amazon Resource Name (ARN) of the Lambda layer without version. |
| source\_code\_size | The size in bytes of the layer .zip file. |
| version | The Lamba layer version. |

## Share the Love

Like this project?
Please give it a ★ on [our GitHub](https://github.com/enter-at/terraform-aws-lambda-layer)!

## Related Projects

Check out these related projects.

- [terraform-aws-lambda](https://github.com/enter-at/terraform-aws-lambda) - Terraform module designed to facilitate the creation of AWS Lambda functions.

## Help

**Got a question?**

File a GitHub [issue](https://github.com/enter-at/terraform-aws-lambda-layer/issues).

## Contributing

### Bug Reports & Feature Requests

Please use the [issue tracker](https://github.com/enter-at/terraform-aws-lambda-layer/issues) to report any bugs or file feature requests.

### Developing

If you are interested in being a contributor and want to get involved in developing this project, we would love to hear from you!

In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull Request** so that we can review your changes

**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!

## License

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

See [LICENSE](LICENSE) for full details.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.