File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed
Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ File a GitHub [issue](https://github.com/osodevops/aws-terraform-module-lambda-a
7979
8080## The legals
8181
82- Copyright © 2017-2024 [ OSO] ( https://oso.sh ) | See [ LICENCE] ( LICENSE ) for full details.
82+ Copyright © 2017-2025 [ OSO] ( https://oso.sh ) | See [ LICENCE] ( LICENSE ) for full details.
8383
8484[ <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/ )
8585
Original file line number Diff line number Diff line change 11# Create the Lambda function. Each new apply will publish a new version.
22resource "aws_lambda_function" "lambda" {
3- function_name = var. function_name
4- description = var. description
5- provider = aws. cloudfront
3+ function_name = var. function_name
4+ description = var. description
5+ provider = aws. cloudfront
66 # Find the file from S3
77 s3_bucket = data. aws_s3_bucket . artifact_bucket . id
8- s3_key = aws_s3_bucket_object . artifact . id
9- s3_object_version = aws_s3_bucket_object . artifact . version_id
8+ s3_key = aws_s3_object . artifact . id
9+ s3_object_version = aws_s3_object . artifact . version_id
1010
1111 publish = true
1212 handler = var. lambda_handler
@@ -15,13 +15,12 @@ resource "aws_lambda_function" "lambda" {
1515
1616 lifecycle {
1717 ignore_changes = [
18- last_modified ,
1918 filename
2019 ]
2120 }
2221
2322 tags = merge (var. common_tags , {
2423 " Name" = " ${ upper (var. environment )} -LOG-COLLECTOR-LAMBDA"
25- },
24+ },
2625 )
2726}
Original file line number Diff line number Diff line change 11/* *
2- * Upload the build artifact zip file to S3.
2+ * Upload the build artifact zip file to S3 using aws_s3_object .
33 *
44 */
5- resource "aws_s3_bucket_object " "artifact" {
6- provider = aws. cloudfront
7- bucket = data. aws_s3_bucket . artifact_bucket . id
8- key = " ${ var . function_name } .zip"
9- source = data. archive_file . zip_file_for_lambda . output_path
10- etag = filemd5 (data. archive_file . zip_file_for_lambda . output_path )
11- tags = var. common_tags
12- }
5+ resource "aws_s3_object " "artifact" {
6+ provider = aws. cloudfront
7+ bucket = data. aws_s3_bucket . artifact_bucket . id
8+ key = " ${ var . function_name } .zip"
9+ source = data. archive_file . zip_file_for_lambda . output_path
10+ etag = filemd5 (data. archive_file . zip_file_for_lambda . output_path )
11+ tags = var. common_tags
12+ }
You can’t perform that action at this time.
0 commit comments