-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAmazon_S3.tf
59 lines (46 loc) · 1.33 KB
/
Amazon_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
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
resource "aws_s3_bucket" "raw_data_bucket" {
bucket = "madhatter-raw-data-bucket"
}
resource "aws_s3_bucket_acl" "madhatter_raw_bucket_acl" {
bucket = aws_s3_bucket.raw_data_bucket.id
acl = "private"
}
resource "aws_s3_bucket_acl" "madhatter_processed_bucket_acl" {
bucket = aws_s3_bucket.processed_data_bucket.id
acl = "private"
}
resource "aws_s3_bucket" "processed_data_bucket" {
bucket = "madhatter-processed-data-bucket"
}
resource "aws_s3_bucket_versioning" "raw_data_bucket_versioning" {
bucket = aws_s3_bucket.raw_data_bucket.id
versioning_configuration {
status = "Enabled"
}
}
resource "aws_s3_bucket_versioning" "processed_data_bucket_versioning" {
bucket = aws_s3_bucket.processed_data_bucket.id
versioning_configuration {
status = "Enabled"
}
}
resource "aws_s3_bucket_lifecycle_configuration" "raw_data_bucket_lifecycle" {
bucket = aws_s3_bucket.raw_data_bucket.id
rule {
id = "raw-data-expiration-rule"
status = "Enabled"
noncurrent_version_expiration {
noncurrent_days = 30
}
}
}
resource "aws_s3_bucket_lifecycle_configuration" "processed_data_bucket_lifecycle" {
bucket = aws_s3_bucket.processed_data_bucket.id
rule {
id = "processed-data-expiration-rule"
status = "Enabled"
noncurrent_version_expiration {
noncurrent_days = 30
}
}
}