Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Update of README.md #310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 55 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```




Expand All @@ -76,39 +100,52 @@ module "layer" {

| Name | Version |
|------|---------|
| terraform | >= 0.13 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |

## Providers

| Name | Version |
|------|---------|
| archive | n/a |
| aws | n/a |
| null | n/a |
| random | n/a |
| <a name="provider_archive"></a> [archive](#provider\_archive) | n/a |
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
| <a name="provider_null"></a> [null](#provider\_null) | n/a |
| <a name="provider_random"></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)` | <pre>[<br> "--include=*"<br>]</pre> | 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 |
| <a name="input_compatible_runtimes"></a> [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 |
| <a name="input_description"></a> [description](#input\_description) | (Optional) Description of what the Lambda layer does. | `string` | `null` | no |
| <a name="input_layer_name"></a> [layer\_name](#input\_layer\_name) | (Required) A unique name for the Lambda Layer. | `string` | n/a | yes |
| <a name="input_package_file"></a> [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 |
| <a name="input_rsync_pattern"></a> [rsync\_pattern](#input\_rsync\_pattern) | (Optional) A list of rsync pattern to include or exclude files and directories. | `list(string)` | <pre>[<br> "--include=*"<br>]</pre> | no |
| <a name="input_source_dir"></a> [source\_dir](#input\_source\_dir) | (Optional) The location of the Lamvda layer source code. Requires source\_type to be defined. | `string` | `null` | no |
| <a name="input_source_type"></a> [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. |

| <a name="output_archive_path"></a> [archive\_path](#output\_archive\_path) | Path to archive file |
| <a name="output_arn"></a> [arn](#output\_arn) | The Amazon Resource Name (ARN) of the Lambda layer with version. |
| <a name="output_created_date"></a> [created\_date](#output\_created\_date) | The date the layer was created. |
| <a name="output_layer_arn"></a> [layer\_arn](#output\_layer\_arn) | The Amazon Resource Name (ARN) of the Lambda layer without version. |
| <a name="output_source_code_size"></a> [source\_code\_size](#output\_source\_code\_size) | The size in bytes of the layer .zip file. |
| <a name="output_version"></a> [version](#output\_version) | The Lamba layer version. |
<!-- markdownlint-restore -->


Expand Down
49 changes: 31 additions & 18 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,50 @@

| Name | Version |
|------|---------|
| terraform | >= 0.13 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |

## Providers

| Name | Version |
|------|---------|
| archive | n/a |
| aws | n/a |
| null | n/a |
| random | n/a |
| <a name="provider_archive"></a> [archive](#provider\_archive) | n/a |
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
| <a name="provider_null"></a> [null](#provider\_null) | n/a |
| <a name="provider_random"></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)` | <pre>[<br> "--include=*"<br>]</pre> | 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 |
| <a name="input_compatible_runtimes"></a> [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 |
| <a name="input_description"></a> [description](#input\_description) | (Optional) Description of what the Lambda layer does. | `string` | `null` | no |
| <a name="input_layer_name"></a> [layer\_name](#input\_layer\_name) | (Required) A unique name for the Lambda Layer. | `string` | n/a | yes |
| <a name="input_package_file"></a> [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 |
| <a name="input_rsync_pattern"></a> [rsync\_pattern](#input\_rsync\_pattern) | (Optional) A list of rsync pattern to include or exclude files and directories. | `list(string)` | <pre>[<br> "--include=*"<br>]</pre> | no |
| <a name="input_source_dir"></a> [source\_dir](#input\_source\_dir) | (Optional) The location of the Lamvda layer source code. Requires source\_type to be defined. | `string` | `null` | no |
| <a name="input_source_type"></a> [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. |

| <a name="output_archive_path"></a> [archive\_path](#output\_archive\_path) | Path to archive file |
| <a name="output_arn"></a> [arn](#output\_arn) | The Amazon Resource Name (ARN) of the Lambda layer with version. |
| <a name="output_created_date"></a> [created\_date](#output\_created\_date) | The date the layer was created. |
| <a name="output_layer_arn"></a> [layer\_arn](#output\_layer\_arn) | The Amazon Resource Name (ARN) of the Lambda layer without version. |
| <a name="output_source_code_size"></a> [source\_code\_size](#output\_source\_code\_size) | The size in bytes of the layer .zip file. |
| <a name="output_version"></a> [version](#output\_version) | The Lamba layer version. |
<!-- markdownlint-restore -->