forked from gchamon/terraform-aws-bucket-antivirus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
s3.tf
21 lines (18 loc) · 697 Bytes
/
s3.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
resource "aws_s3_bucket" "antivirus_definitions" {
bucket = local.names["s3_antivirus_definitions_bucket"]
force_destroy = true
}
resource "aws_s3_bucket" "antivirus_code" {
bucket = local.names["s3_antivirus_code_bucket"]
force_destroy = true
}
resource "aws_s3_bucket_policy" "public_antivirus_definitions" {
count = var.allow_public_access == true ? 1 : 0
bucket = aws_s3_bucket.antivirus_definitions.bucket
policy = data.aws_iam_policy_document.bucket_antivirus_definitions.json
}
resource "aws_s3_bucket_object" "antivirus_code" {
bucket = aws_s3_bucket.antivirus_code.bucket
key = "lambda.zip"
source = pathexpand(local.antivirus_lambda_code_path)
}