File tree 3 files changed +16
-17
lines changed
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
79
79
80
80
## The legals
81
81
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.
83
83
84
84
[ <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/ )
85
85
Original file line number Diff line number Diff line change 1
1
# Create the Lambda function. Each new apply will publish a new version.
2
2
resource "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
6
6
# Find the file from S3
7
7
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
10
10
11
11
publish = true
12
12
handler = var. lambda_handler
@@ -15,13 +15,12 @@ resource "aws_lambda_function" "lambda" {
15
15
16
16
lifecycle {
17
17
ignore_changes = [
18
- last_modified ,
19
18
filename
20
19
]
21
20
}
22
21
23
22
tags = merge (var. common_tags , {
24
23
" Name" = " ${ upper (var. environment )} -LOG-COLLECTOR-LAMBDA"
25
- },
24
+ },
26
25
)
27
26
}
Original file line number Diff line number Diff line change 1
1
/* *
2
- * Upload the build artifact zip file to S3.
2
+ * Upload the build artifact zip file to S3 using aws_s3_object .
3
3
*
4
4
*/
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