feat: switch to public s3 module
This commit is contained in:
@@ -18,7 +18,7 @@ See https://docs.aws.amazon.com/lambda/latest/dg/packaging-layers.html
|
|||||||
|
|
||||||
| Name | Version |
|
| Name | Version |
|
||||||
|------|---------|
|
|------|---------|
|
||||||
| aws | 5.100.0 |
|
| aws | 6.32.0 |
|
||||||
| random | 3.8.1 |
|
| random | 3.8.1 |
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
@@ -26,7 +26,7 @@ See https://docs.aws.amazon.com/lambda/latest/dg/packaging-layers.html
|
|||||||
| Name | Source | Version |
|
| Name | Source | Version |
|
||||||
|------|--------|---------|
|
|------|--------|---------|
|
||||||
| lambda\_archive | ../modules/compute/LambdaZipBuilder | n/a |
|
| lambda\_archive | ../modules/compute/LambdaZipBuilder | n/a |
|
||||||
| s3 | ../modules/storage/s3_bucket_2023 | n/a |
|
| s3 | terraform-aws-modules/s3-bucket/aws | 5.10.0 |
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
|
|||||||
+20
-9
@@ -14,14 +14,14 @@ module "lambda_archive" {
|
|||||||
|
|
||||||
pip_packages = "pandas numpy pytz openpyxl"
|
pip_packages = "pandas numpy pytz openpyxl"
|
||||||
upload_archive_to_s3 = true
|
upload_archive_to_s3 = true
|
||||||
s3_bucket_name = module.s3.bucket_name
|
s3_bucket_name = module.s3.s3_bucket_id
|
||||||
pip_path = "/my/work/xpk-git/venv314/bin/pip3"
|
pip_path = "/my/work/xpk-git/venv314/bin/pip3"
|
||||||
}
|
}
|
||||||
|
|
||||||
# create lambda layer
|
# create lambda layer
|
||||||
resource "aws_lambda_layer_version" "pandas" {
|
resource "aws_lambda_layer_version" "pandas" {
|
||||||
description = "Python packages pandas numpy pytz openpyxl"
|
description = "Python packages pandas numpy pytz openpyxl"
|
||||||
s3_bucket = module.s3.bucket_name
|
s3_bucket = module.s3.s3_bucket_id
|
||||||
s3_key = module.lambda_archive.s3_object_key
|
s3_key = module.lambda_archive.s3_object_key
|
||||||
source_code_hash = module.lambda_archive.s3_object_hash
|
source_code_hash = module.lambda_archive.s3_object_hash
|
||||||
layer_name = "py_packages"
|
layer_name = "py_packages"
|
||||||
@@ -30,13 +30,24 @@ resource "aws_lambda_layer_version" "pandas" {
|
|||||||
|
|
||||||
# s3 bucket required for uploading python package zip
|
# s3 bucket required for uploading python package zip
|
||||||
module "s3" {
|
module "s3" {
|
||||||
source = "../modules/storage/s3_bucket_2023"
|
source = "terraform-aws-modules/s3-bucket/aws"
|
||||||
bucket_name = "lab-lambdalayer-${random_uuid.this.result}"
|
version = "5.10.0"
|
||||||
bucket_force_destroy = true
|
|
||||||
enable_bucket_logging = false
|
bucket = "lab-lambdalayer-${random_uuid.this.result}"
|
||||||
enable_bucket_lifecycle = false
|
|
||||||
enable_versioning = false
|
server_side_encryption_configuration = {
|
||||||
enable_encryption = true
|
rule = {
|
||||||
|
bucket_key_enabled = true
|
||||||
|
apply_server_side_encryption_by_default = {
|
||||||
|
sse_algorithm = "aws:kms"
|
||||||
|
kms_master_key_id = "alias/aws/s3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
attach_deny_insecure_transport_policy = true
|
||||||
|
block_public_policy = true
|
||||||
|
force_destroy = true
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "random_uuid" "this" {}
|
resource "random_uuid" "this" {}
|
||||||
Reference in New Issue
Block a user