generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
s3.tf
31 lines (28 loc) · 844 Bytes
/
s3.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
resource "aws_s3_bucket" "ecr_viewer" {
bucket = local.s3_viewer_bucket_name
force_destroy = true
tags = local.tags
}
resource "aws_s3_bucket_public_access_block" "ecr_viewer" {
bucket = aws_s3_bucket.ecr_viewer.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
# https://avd.aquasec.com/misconfig/aws/s3/avd-aws-0132/
# trivy:ignore:AVD-AWS-0132
resource "aws_s3_bucket_server_side_encryption_configuration" "ecr_viewer" {
bucket = aws_s3_bucket.ecr_viewer.bucket
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "aws:kms"
}
}
}
resource "aws_s3_bucket_versioning" "ecr_viewer" {
bucket = aws_s3_bucket.ecr_viewer.id
versioning_configuration {
status = "Enabled"
}
}