Skip to content
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Terraform module for configuring an integration with Lacework and AWS for cloud
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.11.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.55.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_archive"></a> [archive](#provider\_archive) | n/a |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.11.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.55.0 |

## Modules

Expand Down
16 changes: 14 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
locals {
# Python3.9 support introduced in version 3.55.0
# https://github.com/hashicorp/terraform-provider-aws/blob/release/3.x/CHANGELOG.md#3550-august-19-2021
python_version = "python3.9"

# Python3.10 support introduced in version 4.64.0
# https://github.com/hashicorp/terraform-provider-aws/blob/release/4.x/CHANGELOG.md#4640-april-20-2023
# python_version = "python3.10"

# Python3.11 support introduced in version 5.11.0
# https://github.com/hashicorp/terraform-provider-aws/blob/main/CHANGELOG.md#5110-august--3-2023
# python_version = "python3.11"

kms_key_arn = length(var.kms_key_arn) > 0 ? var.kms_key_arn : aws_kms_key.lacework_kms_key[0].arn
lambda_zip = "LaceworkIntegrationSetup1.1.2.zip"
s3_lambda_key = "${var.cf_s3_prefix}/lambda/${local.lambda_zip}"
Expand Down Expand Up @@ -44,9 +56,9 @@ resource "aws_lambda_function" "lacework_copy_zip_files" {
function_name = "lacework_copy_zip_files"
handler = "index.handler"
role = aws_iam_role.lacework_copy_zip_files_role.arn
runtime = "python3.11"
source_code_hash = data.archive_file.lambda_zip_file.output_base64sha256
timeout = 240
runtime = local.python_version

tracing_config {
mode = "Active"
Expand Down Expand Up @@ -143,10 +155,10 @@ resource "aws_lambda_function" "lacework_setup_function" {
function_name = "lacework_setup_function"
handler = "lw_integration_lambda_function.handler"
role = aws_iam_role.lacework_setup_function_role.arn
runtime = "python3.11"
s3_bucket = aws_s3_bucket.lacework_org_lambda.bucket
s3_key = local.s3_lambda_key
timeout = 900
runtime = local.python_version

tracing_config {
mode = "Active"
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.11.0"
version = ">= 3.55.0"
}
}
}