From 6f9642f8c06f7b25294e1250fa974d7357a44699 Mon Sep 17 00:00:00 2001 From: sleistner Date: Fri, 17 Mar 2023 01:00:58 +0000 Subject: [PATCH] docs(README): auto update all sections --- README.md | 73 +++++++++++++++++++++++++++++++++++------------ docs/terraform.md | 49 +++++++++++++++++++------------ 2 files changed, 86 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 0cc8cdd..ba5c407 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,30 @@ module "layer" { } ``` +### 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 +``` + @@ -76,39 +100,52 @@ module "layer" { | Name | Version | |------|---------| -| terraform | >= 0.13 | +| [terraform](#requirement\_terraform) | >= 0.13 | ## Providers | Name | Version | |------|---------| -| archive | n/a | -| aws | n/a | -| null | n/a | -| random | n/a | +| [archive](#provider\_archive) | n/a | +| [aws](#provider\_aws) | n/a | +| [null](#provider\_null) | n/a | +| [random](#provider\_random) | n/a | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_lambda_layer_version.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_layer_version) | resource | +| [null_resource.build](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | +| [random_uuid.id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/uuid) | resource | +| [archive_file.layer](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | ## 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 | +| [compatible\_runtimes](#input\_compatible\_runtimes) | (Optional) A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified. | `list(string)` | `null` | no | +| [description](#input\_description) | (Optional) Description of what the Lambda layer does. | `string` | `null` | no | +| [layer\_name](#input\_layer\_name) | (Required) A unique name for the Lambda Layer. | `string` | n/a | yes | +| [package\_file](#input\_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](#input\_rsync\_pattern) | (Optional) A list of rsync pattern to include or exclude files and directories. | `list(string)` |
[
"--include=*"
]
| no | +| [source\_dir](#input\_source\_dir) | (Optional) The location of the Lamvda layer source code. Requires source\_type to be defined. | `string` | `null` | no | +| [source\_type](#input\_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. | - +| [archive\_path](#output\_archive\_path) | Path to archive file | +| [arn](#output\_arn) | The Amazon Resource Name (ARN) of the Lambda layer with version. | +| [created\_date](#output\_created\_date) | The date the layer was created. | +| [layer\_arn](#output\_layer\_arn) | The Amazon Resource Name (ARN) of the Lambda layer without version. | +| [source\_code\_size](#output\_source\_code\_size) | The size in bytes of the layer .zip file. | +| [version](#output\_version) | The Lamba layer version. | diff --git a/docs/terraform.md b/docs/terraform.md index a9bea33..9583fcf 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -3,37 +3,50 @@ | Name | Version | |------|---------| -| terraform | >= 0.13 | +| [terraform](#requirement\_terraform) | >= 0.13 | ## Providers | Name | Version | |------|---------| -| archive | n/a | -| aws | n/a | -| null | n/a | -| random | n/a | +| [archive](#provider\_archive) | n/a | +| [aws](#provider\_aws) | n/a | +| [null](#provider\_null) | n/a | +| [random](#provider\_random) | n/a | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_lambda_layer_version.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_layer_version) | resource | +| [null_resource.build](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | +| [random_uuid.id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/uuid) | resource | +| [archive_file.layer](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | ## 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 | +| [compatible\_runtimes](#input\_compatible\_runtimes) | (Optional) A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified. | `list(string)` | `null` | no | +| [description](#input\_description) | (Optional) Description of what the Lambda layer does. | `string` | `null` | no | +| [layer\_name](#input\_layer\_name) | (Required) A unique name for the Lambda Layer. | `string` | n/a | yes | +| [package\_file](#input\_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](#input\_rsync\_pattern) | (Optional) A list of rsync pattern to include or exclude files and directories. | `list(string)` |
[
"--include=*"
]
| no | +| [source\_dir](#input\_source\_dir) | (Optional) The location of the Lamvda layer source code. Requires source\_type to be defined. | `string` | `null` | no | +| [source\_type](#input\_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. | - +| [archive\_path](#output\_archive\_path) | Path to archive file | +| [arn](#output\_arn) | The Amazon Resource Name (ARN) of the Lambda layer with version. | +| [created\_date](#output\_created\_date) | The date the layer was created. | +| [layer\_arn](#output\_layer\_arn) | The Amazon Resource Name (ARN) of the Lambda layer without version. | +| [source\_code\_size](#output\_source\_code\_size) | The size in bytes of the layer .zip file. | +| [version](#output\_version) | The Lamba layer version. |