generated from enter-at/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathREADME.yaml
106 lines (86 loc) · 2.8 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-aws-lambda-layer
# Tags of this project
tags:
- aws
- aws-lambda
- aws-lambda-layer
- terraform
- terraform-modules
# Categories of this project
categories:
- terraform-modules/supported
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: enter-at/terraform-aws-lambda-layer
# Badges to display
badges:
- name: "Build Status"
image: "https://github.com/enter-at/terraform-aws-lambda-layer/workflows/Code%20checks%20and%20tests/badge.svg"
url: "https://github.com/enter-at/terraform-aws-lambda-layer/actions"
- name: "Latest Release"
image: "https://img.shields.io/github/release/enter-at/terraform-aws-lambda-layer.svg"
url: "https://github.com/enter-at/terraform-aws-lambda-layer/releases/latest"
- name: "Semantic Release"
image: "https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg"
url: "https://github.com/semantic-release/semantic-release"
related:
- name: "terraform-aws-lambda"
description: "Terraform module designed to facilitate the creation of AWS Lambda functions."
url: "https://github.com/enter-at/terraform-aws-lambda"
# Short description of this project
description: |-
Terraform module designed to facilitate the creation of AWS Lambda layers.
# How to use this project
usage: |-
### 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/*'"
]
}
```
### Example on Ruby Gem layer
```hcl
module "layer" {
source = "git::https://github.com/enter-at/terraform-aws-lambda-layer.git?ref=main"
layer_name = "dependencies"
source = "."
package_file = "Gemfile"
compatible_runtimes = ["ruby2.7"]
}
```
Note the following
* The package includes the following directory structure ruby/*ruby\_version*/...
* The ruby directory contains Gemfile/Gemfile.lock. These are included for referential integrity
You will may want to symlink these together with your `lambda_function`
```sh
# In your script for packing lambda function
ln -sf /opt/ruby/Gemfile Gemfile
ln -sf /opt/ruby/Gemfile.lock Gemfile.lock
```
include:
- "docs/terraform.md"