This repo has a simple Lambda function which written in Python 3.9.
The function can be deployed by the Terraform.
The CD for this whole module is using Jenkins, details can be found in the Jenkins file along with the repo.
- The Terraform version is 1.0.11
- The Lambda module should be suited for most Lambda deployment.
- The module will create an IAM role along with the Lambda function also a Cloudwatch log group.
- The module use AWS s3 as backend.
- If you want to deploy it to other AWS account, please change the backend and if needed also the region.
- The source module if under the folder
lambda
- The Terraform run time file is on the top layer (can also move to the specific folder if for monorepo case.)
- Using Jenkins for CI/CD here.
- Jenkins is running on Kubernetes and using Jenkins config as code.
- The pod template is no need to change as the using the Terraform official latest image.
- The pipeline will send notification to Slack channel for the build info.
- There is one parameter for the build which you can choose to create/update or destroy the Lambda funtion.
Name |
Source |
Version |
lambda |
./lambda |
n/a |
No resources.
Name |
Description |
Type |
Default |
Required |
aws_region |
The region of AWS |
string |
"ap-southeast-1" |
no |
function_name |
Unique name for your Lambda Function. |
string |
"Lambda function Greg" |
no |
handler |
Function entrypoint in your code |
string |
"" |
no |
output_file_name |
The archive file output file name |
string |
"" |
no |
runtime |
Identifier of the function's runtime |
string |
"" |
no |
source_file_name |
The archive file source file anme |
string |
"" |
no |
tags |
A map of tags to apply to the Lambda function. |
map(string) |
{} |
no |
Name |
Description |
arn |
Amazon Resource Name (ARN) identifying your Lambda Function. |
cloudwatch_loggroup |
The ARN of the CLoudwatch loggroup. |
invoke_arn |
ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration's uri. |
last_modified |
Date this resource was last modified. |
qualified_arn |
ARN identifying your Lambda Function Version (if versioning is enabled via publish = true). |
rols_arn |
The ARN of the Iam role which created for the Lambda funtion. |
source_code_size |
Size in bytes of the function .zip file. |
tags_all |
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. |
version |
Latest published version of your Lambda Function. |
vpc_config |
ID of the VPC. |