Skip to content

Commit

Permalink
add architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogoda committed May 23, 2024
1 parent fa3fe17 commit 5d612b7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This module will deploy a Lambda function. It supports both Zip and Image deploy
- `reserved_concurrent_executions` (number) - The amount of reserved concurrent executions for this lambda function.
- `tags` (map) - A mapping of tags to assign to this lambda function.
- `datadog_log_subscription_arn` - (string) - Log subscription arn for shipping logs to datadog.
- `architectures` - (list) - List of architectures to support for the Lambda function.

### Zip deployment variables
- `runtime` - (string) - **REQUIRED** - The runtime environment for the Lambda function you are uploading.
Expand Down Expand Up @@ -50,6 +51,7 @@ module "lambda" {
timeout = 5
memory_size = 256
lambda_env = "${var.lambda_env}"
architectures = ["x86_64"]
}
```
Lambda environment variables file:
Expand Down
5 changes: 1 addition & 4 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
terraform {
required_version = ">= 0.12"
}

resource "aws_lambda_function" "lambda_function" {
image_uri = var.image_uri
s3_bucket = var.s3_bucket
Expand All @@ -16,6 +12,7 @@ resource "aws_lambda_function" "lambda_function" {
tags = var.tags
package_type = var.image_uri != null ? "Image" : "Zip"
layers = var.layers
architectures = var.architectures

dynamic "image_config" {
for_each = var.image_uri != null ? [1] : []
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ variable "layers" {
description = "ARNs of the layers to attach to the lambda function in order"
default = []
}

variable "architectures" {
type = list(string)
description = "Lambda architectures to support."
default = ["x86_64"]
}
9 changes: 9 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 0.12"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.61.0"
}
}
}

0 comments on commit 5d612b7

Please sign in to comment.