Skip to content

Commit

Permalink
Really add numpy layer to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmannarino committed Aug 13, 2024
1 parent 4f4e2df commit 85dc4a5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ resource "aws_s3_bucket" "tiles_test" {
force_destroy = true
}

resource "aws_s3_bucket_object" "numpy_layer" {
bucket = aws_s3_bucket.pipelines_test.id
key = "lambda_layers/${local.numpy_layer_filename}"
source = "../fixtures/${local.numpy_layer_filename}"
etag = filemd5("../fixtures/${local.numpy_layer_filename}")
}

resource "aws_lambda_layer_version" "numpy_layer" {
layer_name = substr("${local.lambda_runtime_sn}_${replace(var.numpy_name_version, ".", "")}", 0, 64)
s3_bucket = aws_s3_bucket_object.numpy_layer.bucket
s3_key = aws_s3_bucket_object.numpy_layer.key
compatible_runtimes = [var.lambda_runtime]
source_code_hash = filebase64sha256(
"../fixtures/${local.numpy_layer_filename}"
)
}

resource "aws_s3_bucket_object" "rasterio_layer" {
bucket = aws_s3_bucket.pipelines_test.id
key = "lambda_layers/${local.rasterio_layer_filename}"
Expand Down Expand Up @@ -102,6 +119,7 @@ module "lambda_raster_tiler" {
source = "../../terraform/modules/lambda_raster_tiler"
environment = "test"
lambda_layers = [
aws_lambda_layer_version.numpy_layer.arn,
aws_lambda_layer_version.pillow_layer.arn,
aws_lambda_layer_version.rasterio_layer.arn,
aws_lambda_layer_version.mercantile_layer.arn
Expand Down

0 comments on commit 85dc4a5

Please sign in to comment.