Skip to content

Depreciations #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 24, 2025
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

[<img src="https://oso-public-resources.s3.eu-west-1.amazonaws.com/oso-logo-green.png" alt="OSO who we are" width="250"/>](https://oso.sh/who-we-are/)

Expand Down
13 changes: 6 additions & 7 deletions aws_lambda_function.tf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
},
},
)
}
18 changes: 9 additions & 9 deletions aws_s3_bucket_object_artifact_upload.tf
Original file line number Diff line number Diff line change
@@ -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
}
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
}
Loading