diff --git a/README.md b/README.md index a795abf..39169de 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ File a GitHub [issue](https://github.com/osodevops/aws-terraform-module-lambda-a ## The legals -Copyright © 2017-2024 [OSO](https://oso.sh) | See [LICENCE](LICENSE) for full details. +Copyright © 2017-2025 [OSO](https://oso.sh) | See [LICENCE](LICENSE) for full details. [OSO who we are](https://oso.sh/who-we-are/) diff --git a/aws_lambda_function.tf b/aws_lambda_function.tf index 23aca60..1b8de7b 100644 --- a/aws_lambda_function.tf +++ b/aws_lambda_function.tf @@ -1,12 +1,12 @@ # Create the Lambda function. Each new apply will publish a new version. resource "aws_lambda_function" "lambda" { - function_name = var.function_name - description = var.description - provider = aws.cloudfront + function_name = var.function_name + description = var.description + provider = aws.cloudfront # Find the file from S3 s3_bucket = data.aws_s3_bucket.artifact_bucket.id - s3_key = aws_s3_bucket_object.artifact.id - s3_object_version = aws_s3_bucket_object.artifact.version_id + s3_key = aws_s3_object.artifact.id + s3_object_version = aws_s3_object.artifact.version_id publish = true handler = var.lambda_handler @@ -15,13 +15,12 @@ resource "aws_lambda_function" "lambda" { lifecycle { ignore_changes = [ - last_modified, filename ] } tags = merge(var.common_tags, { "Name" = "${upper(var.environment)}-LOG-COLLECTOR-LAMBDA" - }, + }, ) } \ No newline at end of file diff --git a/aws_s3_bucket_object_artifact_upload.tf b/aws_s3_bucket_object_artifact_upload.tf index 010954c..d965799 100644 --- a/aws_s3_bucket_object_artifact_upload.tf +++ b/aws_s3_bucket_object_artifact_upload.tf @@ -1,12 +1,12 @@ /** - * Upload the build artifact zip file to S3. + * Upload the build artifact zip file to S3 using aws_s3_object. * */ -resource "aws_s3_bucket_object" "artifact" { - provider = aws.cloudfront - bucket = data.aws_s3_bucket.artifact_bucket.id - key = "${var.function_name}.zip" - source = data.archive_file.zip_file_for_lambda.output_path - etag = filemd5(data.archive_file.zip_file_for_lambda.output_path) - tags = var.common_tags -} \ No newline at end of file +resource "aws_s3_object" "artifact" { + provider = aws.cloudfront + bucket = data.aws_s3_bucket.artifact_bucket.id + key = "${var.function_name}.zip" + source = data.archive_file.zip_file_for_lambda.output_path + etag = filemd5(data.archive_file.zip_file_for_lambda.output_path) + tags = var.common_tags +}