Skip to content

Commit

Permalink
feat: added graviton support (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzzimmer committed Oct 1, 2021
1 parent 15fa1fd commit f038d63
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 20 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ MINOR, and PATCH versions on each release to indicate any incompatibilities.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.19 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.61 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.56.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.61 |

## Modules

Expand Down Expand Up @@ -329,10 +329,11 @@ MINOR, and PATCH versions on each release to indicate any incompatibilities.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_architectures"></a> [architectures](#input\_architectures) | Instruction set architecture for your Lambda function. Valid values are ["x86\_64"] and ["arm64"]. Removing this attribute, function's architecture stay the same. | `list(string)` | `null` | no |
| <a name="input_cloudwatch_event_rules"></a> [cloudwatch\_event\_rules](#input\_cloudwatch\_event\_rules) | Creates EventBridge (CloudWatch Events) rules invoking your Lambda function. Required Lambda invocation permissions will be generated. | `map(any)` | `{}` | no |
| <a name="input_cloudwatch_lambda_insights_enabled"></a> [cloudwatch\_lambda\_insights\_enabled](#input\_cloudwatch\_lambda\_insights\_enabled) | Enable CloudWatch Lambda Insights for your Lambda function. | `bool` | `false` | no |
| <a name="input_cloudwatch_lambda_insights_extension_version"></a> [cloudwatch\_lambda\_insights\_extension\_version](#input\_cloudwatch\_lambda\_insights\_extension\_version) | Version of the Lambda Insights extension for Lambda functions using `zip` deployment packages, see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html. | `number` | `14` | no |
| <a name="input_description"></a> [description](#input\_description) | Description of what your Lambda Function does. | `string` | `""` | no |
| <a name="input_description"></a> [description](#input\_description) | Description of what your Lambda Function does. | `string` | `"Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]."` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Environment (e.g. env variables) configuration for the Lambda function enable you to dynamically pass settings to your function code and libraries | <pre>object({<br> variables = map(string)<br> })</pre> | `null` | no |
| <a name="input_event"></a> [event](#input\_event) | (deprecated - use `cloudwatch_event_rules` [EventBridge/CloudWatch Events], `event_source_mappings` [DynamoDb, Kinesis, SQS] or `sns_subscriptions` [SNS] instead) Event source configuration which triggers the Lambda function. Supported events: cloudwatch-scheduled-event, dynamodb, kinesis, s3, sns, sqs | `map(string)` | `{}` | no |
| <a name="input_event_source_mappings"></a> [event\_source\_mappings](#input\_event\_source\_mappings) | Creates event source mappings to allow the Lambda function to get events from Kinesis, DynamoDB and SQS. The IAM role of this Lambda function will be enhanced with necessary minimum permissions to get those events. | `any` | `{}` | no |
Expand Down
7 changes: 4 additions & 3 deletions docs/part2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.19 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.61 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.56.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.61 |

## Modules

Expand Down Expand Up @@ -55,10 +55,11 @@

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_architectures"></a> [architectures](#input\_architectures) | Instruction set architecture for your Lambda function. Valid values are ["x86\_64"] and ["arm64"]. Removing this attribute, function's architecture stay the same. | `list(string)` | `null` | no |
| <a name="input_cloudwatch_event_rules"></a> [cloudwatch\_event\_rules](#input\_cloudwatch\_event\_rules) | Creates EventBridge (CloudWatch Events) rules invoking your Lambda function. Required Lambda invocation permissions will be generated. | `map(any)` | `{}` | no |
| <a name="input_cloudwatch_lambda_insights_enabled"></a> [cloudwatch\_lambda\_insights\_enabled](#input\_cloudwatch\_lambda\_insights\_enabled) | Enable CloudWatch Lambda Insights for your Lambda function. | `bool` | `false` | no |
| <a name="input_cloudwatch_lambda_insights_extension_version"></a> [cloudwatch\_lambda\_insights\_extension\_version](#input\_cloudwatch\_lambda\_insights\_extension\_version) | Version of the Lambda Insights extension for Lambda functions using `zip` deployment packages, see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html. | `number` | `14` | no |
| <a name="input_description"></a> [description](#input\_description) | Description of what your Lambda Function does. | `string` | `""` | no |
| <a name="input_description"></a> [description](#input\_description) | Description of what your Lambda Function does. | `string` | `"Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]."` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Environment (e.g. env variables) configuration for the Lambda function enable you to dynamically pass settings to your function code and libraries | <pre>object({<br> variables = map(string)<br> })</pre> | `null` | no |
| <a name="input_event"></a> [event](#input\_event) | (deprecated - use `cloudwatch_event_rules` [EventBridge/CloudWatch Events], `event_source_mappings` [DynamoDb, Kinesis, SQS] or `sns_subscriptions` [SNS] instead) Event source configuration which triggers the Lambda function. Supported events: cloudwatch-scheduled-event, dynamodb, kinesis, s3, sns, sqs | `map(string)` | `{}` | no |
| <a name="input_event_source_mappings"></a> [event\_source\_mappings](#input\_event\_source\_mappings) | Creates event source mappings to allow the Lambda function to get events from Kinesis, DynamoDB and SQS. The IAM role of this Lambda function will be enhanced with necessary minimum permissions to get those events. | `any` | `{}` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/container-image/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
2 changes: 1 addition & 1 deletion examples/deployment/container-image/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
2 changes: 1 addition & 1 deletion examples/deployment/s3/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
2 changes: 1 addition & 1 deletion examples/example-with-s3-event/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
4 changes: 3 additions & 1 deletion examples/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module "source" {
}

module "lambda" {
source = "../../"
source = "../../"

architectures = ["arm64"]
description = "Example usage for an AWS Lambda without an event trigger."
filename = module.source.output_path
function_name = "example-without-event"
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
2 changes: 1 addition & 1 deletion examples/with-cloudwatch-event-rules/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12.0"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
2 changes: 1 addition & 1 deletion examples/with-event-source-mappings/kinesis/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12.0"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
2 changes: 1 addition & 1 deletion examples/with-event-source-mappings/sqs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12.0"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
2 changes: 1 addition & 1 deletion examples/with-sns-subscriptions/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ data "aws_caller_identity" "current" {}
module "lambda" {
source = "./modules/lambda"

architectures = var.architectures
cloudwatch_lambda_insights_enabled = var.cloudwatch_lambda_insights_enabled
cloudwatch_lambda_insights_extension_version = var.cloudwatch_lambda_insights_extension_version
description = var.description
Expand Down
2 changes: 2 additions & 0 deletions modules/lambda/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ locals {
resource "aws_lambda_function" "lambda" {
count = var.ignore_external_function_updates ? 0 : 1

architectures = var.architectures
description = var.description
filename = var.filename
function_name = var.function_name
Expand Down Expand Up @@ -66,6 +67,7 @@ resource "aws_lambda_function" "lambda" {
resource "aws_lambda_function" "lambda_external_lifecycle" {
count = var.ignore_external_function_updates ? 1 : 0

architectures = var.architectures
description = var.description
filename = var.filename
function_name = var.function_name
Expand Down
6 changes: 6 additions & 0 deletions modules/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ variable "function_name" {
# These parameters have reasonable defaults.
# ---------------------------------------------------------------------------------------------------------------------

variable "architectures" {
default = null
description = "Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]. Removing this attribute, function's architecture stay the same."
type = list(string)
}

variable "cloudwatch_lambda_insights_enabled" {
description = "Enable CloudWatch Lambda Insights for your Lambda function."
default = false
Expand Down
2 changes: 1 addition & 1 deletion modules/lambda/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12.0"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ variable "function_name" {
# These parameters have reasonable defaults.
# ---------------------------------------------------------------------------------------------------------------------

variable "architectures" {
default = null
description = "Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]. Removing this attribute, function's architecture stay the same."
type = list(string)
}

variable "cloudwatch_event_rules" {
description = "Creates EventBridge (CloudWatch Events) rules invoking your Lambda function. Required Lambda invocation permissions will be generated."
default = {}
Expand All @@ -33,7 +39,7 @@ variable "cloudwatch_lambda_insights_extension_version" {

variable "description" {
description = "Description of what your Lambda Function does."
default = ""
default = "Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]."
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ terraform {
required_version = ">= 0.12.0"

required_providers {
aws = ">= 3.19"
aws = ">= 3.61"
}
}

0 comments on commit f038d63

Please sign in to comment.