-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paths3.tf
More file actions
36 lines (28 loc) · 944 Bytes
/
s3.tf
File metadata and controls
36 lines (28 loc) · 944 Bytes
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
32
33
34
35
36
// S3 bucket for storing grafana logs and prometheus metrics
resource "aws_s3_bucket" "main" {
bucket = "phl-citygeo-${var.app_name}-${var.env_name}"
tags = local.default_tags
}
resource "aws_s3_bucket_server_side_encryption_configuration" "main" {
bucket = aws_s3_bucket.main.id
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "aws:kms"
kms_master_key_id = data.aws_ssm_parameter.kms_id.value
}
bucket_key_enabled = true
}
}
resource "aws_s3_bucket_public_access_block" "main" {
bucket = aws_s3_bucket.main.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
# Upload registration
resource "aws_s3_object" "registration" {
bucket = aws_s3_bucket.main.bucket
key = "registration.yaml"
content_base64 = data.secretsmanager_file.registration.file_ref[0].content_base64
}