-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
62 lines (50 loc) · 1.06 KB
/
main.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "daneborg"
key = "daneborg.tfstate"
region = "eu-central-1"
}
}
provider "aws" {
region = "eu-central-1"
}
resource "aws_s3_bucket" "borg" {
bucket = "daneborg"
force_destroy = false
tags = {
Name = "Borg backup"
}
#checkov:skip=CKV_AWS_18
#checkov:skip=CKV2_AWS_62
#checkov:skip=CKV_AWS_21
#checkov:skip=CKV_AWS_144
#checkov:skip=CKV_AWS_145
}
resource "aws_s3_bucket_lifecycle_configuration" "borg" {
bucket = aws_s3_bucket.borg.id
rule {
id = "deepa"
filter {}
abort_incomplete_multipart_upload {
days_after_initiation = 1
}
transition {
days = 0
storage_class = "DEEP_ARCHIVE"
}
status = "Enabled"
}
}
resource "aws_s3_bucket_public_access_block" "borg" {
bucket = aws_s3_bucket.borg.id
block_public_acls = true
block_public_policy = true
restrict_public_buckets = true
ignore_public_acls = true
}