Skip to content

Commit a85cfb3

Browse files
authored
feat: Add s3_acl and s3_server_site_encryption variables (#120)
1 parent caa8a5c commit a85cfb3

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,12 @@ No Modules.
694694
| role\_permissions\_boundary | The ARN of the policy that is used to set the permissions boundary for the IAM role used by Lambda Function | `string` | `null` | no |
695695
| role\_tags | A map of tags to assign to IAM role | `map(string)` | `{}` | no |
696696
| runtime | Lambda Function runtime | `string` | `""` | no |
697+
| s3\_acl | The canned ACL to apply. Valid values are private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, and bucket-owner-full-control. Defaults to private. | `string` | `"private"` | no |
697698
| s3\_bucket | S3 bucket to store artifacts | `string` | `null` | no |
698699
| s3\_existing\_package | The S3 bucket object with keys bucket, key, version pointing to an existing zip-file to use | `map(string)` | `null` | no |
699700
| s3\_object\_storage\_class | Specifies the desired Storage Class for the artifact uploaded to S3. Can be either STANDARD, REDUCED\_REDUNDANCY, ONEZONE\_IA, INTELLIGENT\_TIERING, or STANDARD\_IA. | `string` | `"ONEZONE_IA"` | no |
700701
| s3\_object\_tags | A map of tags to assign to S3 bucket object. | `map(string)` | `{}` | no |
702+
| s3\_server\_side\_encryption | Specifies server-side encryption of the object in S3. Valid values are "AES256" and "aws:kms". | `string` | `null` | no |
701703
| source\_path | The absolute path to a local file or directory containing your Lambda source code | `any` | `null` | no |
702704
| store\_on\_s3 | Whether to store produced artifacts on S3 or locally. | `bool` | `false` | no |
703705
| tags | A map of tags to assign to resources. | `map(string)` | `{}` | no |

main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,14 @@ resource "aws_s3_bucket_object" "lambda_package" {
109109
count = var.create && var.store_on_s3 && var.create_package ? 1 : 0
110110

111111
bucket = var.s3_bucket
112+
acl = var.s3_acl
112113
key = data.external.archive_prepare[0].result.filename
113114
source = data.external.archive_prepare[0].result.filename
114115
etag = fileexists(data.external.archive_prepare[0].result.filename) ? filemd5(data.external.archive_prepare[0].result.filename) : null
115116
storage_class = var.s3_object_storage_class
116117

118+
server_side_encryption = var.s3_server_side_encryption
119+
117120
tags = merge(var.tags, var.s3_object_tags)
118121

119122
depends_on = [null_resource.archive]

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,18 @@ variable "s3_bucket" {
523523
default = null
524524
}
525525

526+
variable "s3_acl" {
527+
description = "The canned ACL to apply. Valid values are private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, and bucket-owner-full-control. Defaults to private."
528+
type = string
529+
default = "private"
530+
}
531+
532+
variable "s3_server_side_encryption" {
533+
description = "Specifies server-side encryption of the object in S3. Valid values are \"AES256\" and \"aws:kms\"."
534+
type = string
535+
default = null
536+
}
537+
526538
variable "source_path" {
527539
description = "The absolute path to a local file or directory containing your Lambda source code"
528540
type = any # string | list(string | map(any))

0 commit comments

Comments
 (0)