Skip to content

Commit b4e5d6c

Browse files
committed
pushed README.md
1 parent e01db4d commit b4e5d6c

File tree

1 file changed

+57
-53
lines changed

1 file changed

+57
-53
lines changed

README.md

Lines changed: 57 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
Terraform AWS Lambda
88
</h1>
99

10-
<p align="center" style="font-size: 1.2rem;">
10+
<p align="center" style="font-size: 1.2rem;">
1111
Terraform module to create Lambda resource on AWS for create lambda function.
1212
</p>
1313

1414
<p align="center">
1515

1616
<a href="https://www.terraform.io">
17-
<img src="https://img.shields.io/badge/Terraform-v0.12-green" alt="Terraform">
17+
<img src="https://img.shields.io/badge/Terraform-v0.13-green" alt="Terraform">
1818
</a>
1919
<a href="LICENSE.md">
2020
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="Licence">
@@ -38,7 +38,7 @@
3838
<hr>
3939

4040

41-
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
41+
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
4242

4343
This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
4444

@@ -49,9 +49,9 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c
4949

5050
## Prerequisites
5151

52-
This module has a few dependencies:
52+
This module has a few dependencies:
5353

54-
- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html)
54+
- [Terraform 0.13](https://learn.hashicorp.com/terraform/getting-started/install.html)
5555
- [Go](https://golang.org/doc/install)
5656
- [github.com/stretchr/testify/assert](https://github.com/stretchr/testify)
5757
- [github.com/gruntwork-io/terratest/modules/terraform](https://github.com/gruntwork-io/terratest)
@@ -72,7 +72,8 @@ Here are some examples of how you can use this module in your inventory structur
7272
### Basic Function
7373
```hcl
7474
module "lambda" {
75-
source = "git::https://github.com/clouddrove/terraform-aws-lambda.git?ref=tags/0.12.5"
75+
source = "clouddrove/lambda/aws"
76+
version = "0.13.0"
7677
name = "lambda"
7778
application = "clouddrove"
7879
environment = "test"
@@ -89,7 +90,8 @@ Here are some examples of how you can use this module in your inventory structur
8990
### Basic S3 Function
9091
```hcl
9192
module "lambda" {
92-
source = "git::https://github.com/clouddrove/terraform-aws-lambda.git?ref=tags/0.12.5"
93+
source = "clouddrove/lambda/aws"
94+
version = "0.13.0"
9395
name = "lambda"
9496
application = "clouddrove"
9597
environment = "test"
@@ -107,7 +109,8 @@ Here are some examples of how you can use this module in your inventory structur
107109
### Complete Function
108110
```hcl
109111
module "lambda" {
110-
source = "git::https://github.com/clouddrove/terraform-aws-lambda.git?ref=tags/0.12.5"
112+
source = "clouddrove/lambda/aws"
113+
version = "0.13.0"
111114
112115
name = "lambda"
113116
application = "clouddrove"
@@ -156,61 +159,62 @@ Here are some examples of how you can use this module in your inventory structur
156159
## Inputs
157160

158161
| Name | Description | Type | Default | Required |
159-
|------|-------------|:----:|:-----:|:-----:|
160-
| actions | The AWS Lambda action you want to allow in this statement. \(e.g. lambda:InvokeFunction\). | list | `<list>` | no |
161-
| application | Application \(e.g. `cd` or `clouddrove`\). | string | `""` | no |
162-
| attributes | Additional attributes \(e.g. `1`\). | list | `<list>` | no |
163-
| compatible\_runtimes | A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified. | list | `<list>` | no |
164-
| delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | string | `"-"` | no |
165-
| description | Description of what your Lambda Function does. | string | `""` | no |
166-
| descriptions | Description of what your Lambda Layer does. | list | `<list>` | no |
167-
| enabled | Whether to create lambda function. | bool | `"false"` | no |
168-
| environment | Environment \(e.g. `prod`, `dev`, `staging`\). | string | `""` | no |
169-
| event\_source\_tokens | The Event Source Token to validate. Used with Alexa Skills. | list | `<list>` | no |
170-
| filename | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. | string | `""` | no |
171-
| handler | The function entrypoint in your code. | string | n/a | yes |
172-
| iam\_actions | The actions for Iam Role Policy. | list | `<list>` | no |
173-
| kms\_key\_arn | The ARN for the KMS encryption key. | string | `""` | no |
174-
| label\_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
175-
| layer\_filenames | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. | list | `<list>` | no |
176-
| layers | List of Lambda Layer Version ARNs \(maximum of 5\) to attach to your Lambda Function. | string | `""` | no |
177-
| license\_infos | License info for your Lambda Layer. See License Info. | list | `<list>` | no |
178-
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"[email protected]"` | no |
179-
| memory\_size | Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. | number | `"128"` | no |
180-
| name | Name \(e.g. `app` or `cluster`\). | string | `""` | no |
181-
| names | A unique name for your Lambda Layer. | list | `<list>` | no |
182-
| principals | The principal who is getting this permission. e.g. s3.amazonaws.com, an AWS account ID, or any valid AWS service principal such as events.amazonaws.com or sns.amazonaws.com. | list | `<list>` | no |
183-
| publish | Whether to publish creation/change as new Lambda Function Version. Defaults to false. | bool | `"false"` | no |
184-
| qualifiers | Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN. e.g. arn:aws:lambda:aws-region:acct-id:function:function-name:2 | list | `<list>` | no |
185-
| reserved\_concurrent\_executions | The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. | number | `"-1"` | no |
186-
| runtime | Runtimes. | string | n/a | yes |
187-
| s3\_bucket | 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. | string | `""` | no |
188-
| s3\_buckets | 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. | list | `<list>` | no |
189-
| s3\_keies | The S3 key of an object containing the function's deployment package. Conflicts with filename. | list | `<list>` | no |
190-
| s3\_key | The S3 key of an object containing the function's deployment package. Conflicts with filename. | string | `""` | no |
191-
| s3\_object\_version | The object version containing the function's deployment package. Conflicts with filename. | string | `""` | no |
192-
| s3\_object\_versions | The object version containing the function's deployment package. Conflicts with filename. | list | `<list>` | no |
193-
| security\_group\_ids | Security group ids for vpc config. | list | `<list>` | no |
194-
| source\_accounts | This parameter is used for S3 and SES. The AWS account ID \(without a hyphen\) of the source owner. | list | `<list>` | no |
195-
| source\_arns | When granting Amazon S3 or CloudWatch Events permission to invoke your function, you should specify this field with the Amazon Resource Name \(ARN\) for the S3 Bucket or CloudWatch Events Rule as its value. This ensures that only events generated from the specified bucket or rule can invoke the function. | list | `<list>` | no |
196-
| statement\_ids | A unique statement identifier. By default generated by Terraform. | list | `<list>` | no |
197-
| subnet\_ids | Subnet ids for vpc config. | list | `<list>` | no |
198-
| tags | Additional tags \(e.g. map\(`BusinessUnit`,`XYZ`\). | map | `<map>` | no |
199-
| timeout | The amount of time your Lambda Function has to run in seconds. Defaults to 3. | number | `"3"` | no |
200-
| variables | A map that defines environment variables for the Lambda function. | map | `<map>` | no |
162+
|------|-------------|------|---------|:--------:|
163+
| actions | The AWS Lambda action you want to allow in this statement. (e.g. lambda:InvokeFunction). | `list` | `[]` | no |
164+
| application | Application (e.g. `cd` or `clouddrove`). | `string` | `""` | no |
165+
| attributes | Additional attributes (e.g. `1`). | `list` | `[]` | no |
166+
| compatible\_runtimes | A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified. | `list` | `[]` | no |
167+
| delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | `string` | `"-"` | no |
168+
| description | Description of what your Lambda Function does. | `string` | `""` | no |
169+
| descriptions | Description of what your Lambda Layer does. | `list` | `[]` | no |
170+
| enabled | Whether to create lambda function. | `bool` | `false` | no |
171+
| enabled\_cloudwatch\_logging | Whether to create create efs file system. | `bool` | `false` | no |
172+
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `""` | no |
173+
| event\_source\_tokens | The Event Source Token to validate. Used with Alexa Skills. | `list` | `[]` | no |
174+
| filename | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. | `any` | `null` | no |
175+
| handler | The function entrypoint in your code. | `string` | n/a | yes |
176+
| iam\_actions | The actions for Iam Role Policy. | `list` | <pre>[<br> "logs:CreateLogStream",<br> "logs:CreateLogGroup",<br> "logs:PutLogEvents"<br>]</pre> | no |
177+
| kms\_key\_arn | The ARN for the KMS encryption key. | `string` | `""` | no |
178+
| label\_order | Label order, e.g. `name`,`application`. | `list` | `[]` | no |
179+
| layer\_filenames | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. | `list` | `[]` | no |
180+
| layers | List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. | `any` | `null` | no |
181+
| license\_infos | License info for your Lambda Layer. See License Info. | `list` | `[]` | no |
182+
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | `string` | `"[email protected]"` | no |
183+
| memory\_size | Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. | `number` | `128` | no |
184+
| name | Name (e.g. `app` or `cluster`). | `string` | `""` | no |
185+
| names | A unique name for your Lambda Layer. | `list` | `[]` | no |
186+
| principals | The principal who is getting this permission. e.g. s3.amazonaws.com, an AWS account ID, or any valid AWS service principal such as events.amazonaws.com or sns.amazonaws.com. | `list` | `[]` | no |
187+
| publish | Whether to publish creation/change as new Lambda Function Version. Defaults to false. | `bool` | `false` | no |
188+
| qualifiers | Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN. e.g. arn:aws:lambda:aws-region:acct-id:function:function-name:2 | `list` | `[]` | no |
189+
| reserved\_concurrent\_executions | The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. | `number` | `-1` | no |
190+
| runtime | Runtimes. | `string` | n/a | yes |
191+
| s3\_bucket | 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. | `any` | `null` | no |
192+
| s3\_buckets | 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. | `list` | `[]` | no |
193+
| s3\_keies | The S3 key of an object containing the function's deployment package. Conflicts with filename. | `list` | `[]` | no |
194+
| s3\_key | The S3 key of an object containing the function's deployment package. Conflicts with filename. | `any` | `null` | no |
195+
| s3\_object\_version | The object version containing the function's deployment package. Conflicts with filename. | `any` | `null` | no |
196+
| s3\_object\_versions | The object version containing the function's deployment package. Conflicts with filename. | `list` | `[]` | no |
197+
| security\_group\_ids | Security group ids for vpc config. | `list` | `[]` | no |
198+
| source\_accounts | This parameter is used for S3 and SES. The AWS account ID (without a hyphen) of the source owner. | `list` | `[]` | no |
199+
| source\_arns | When granting Amazon S3 or CloudWatch Events permission to invoke your function, you should specify this field with the Amazon Resource Name (ARN) for the S3 Bucket or CloudWatch Events Rule as its value. This ensures that only events generated from the specified bucket or rule can invoke the function. | `list` | `[]` | no |
200+
| statement\_ids | A unique statement identifier. By default generated by Terraform. | `list` | `[]` | no |
201+
| subnet\_ids | Subnet ids for vpc config. | `list` | `[]` | no |
202+
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map` | `{}` | no |
203+
| timeout | The amount of time your Lambda Function has to run in seconds. Defaults to 3. | `number` | `3` | no |
204+
| variables | A map that defines environment variables for the Lambda function. | `map` | `{}` | no |
201205

202206
## Outputs
203207

204208
| Name | Description |
205209
|------|-------------|
206-
| arn | The Amazon Resource Name \(ARN\) identifying your Lambda Function. |
210+
| arn | The Amazon Resource Name (ARN) identifying your Lambda Function. |
207211
| tags | A mapping of tags to assign to the resource. |
208212

209213

210214

211215

212216
## Testing
213-
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
217+
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
214218

215219
You need to run the following command in the testing folder:
216220
```hcl
@@ -219,7 +223,7 @@ You need to run the following command in the testing folder:
219223

220224

221225

222-
## Feedback
226+
## Feedback
223227
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-lambda/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).
224228

225229
If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-lambda)!

0 commit comments

Comments
 (0)