diff --git a/README.md b/README.md index 22a5e63..38f863b 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ Terraform module for configuring an integration with Lacework and AWS for cloud | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.14 | -| [aws](#requirement\_aws) | >= 5.11.0 | +| [aws](#requirement\_aws) | >= 3.55.0 | ## Providers | Name | Version | |------|---------| | [archive](#provider\_archive) | n/a | -| [aws](#provider\_aws) | >= 5.11.0 | +| [aws](#provider\_aws) | >= 3.55.0 | ## Modules diff --git a/main.tf b/main.tf index 4d3caf8..7397f91 100644 --- a/main.tf +++ b/main.tf @@ -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}" @@ -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" @@ -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" diff --git a/versions.tf b/versions.tf index 06279dd..0738c65 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.11.0" + version = ">= 3.55.0" } } }