forked from bregman-arie/devops-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
40 lines (33 loc) · 838 Bytes
/
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
resource "aws_s3_bucket" "private_bucket" {
bucket = "my-first-private-bucket"
region = "eu-west-2"
acl = "private"
tags = {
Name = "My First Private Bucket"
Environment = "Exercise"
}
}
resource "aws_s3_bucket_acl" "private_bucket_acl" {
bucket = aws_s3_bucket.private_bucket.id
acl = "private"
}
resource "aws_s3_bucket" "public_bucket" {
bucket = "my-first-public-bucket"
region = "eu-west-1"
tags = {
Name = "My First Public Bucket"
Environment = "Exercise"
}
versioning {
enabled = true
}
}
resource "aws_s3_bucket_acl" "public_bucket_acl" {
bucket = aws_s3_bucket.public_bucket.id
acl = "public-read"
}
resource "aws_s3_bucket_object" "bucket_object" {
bucket = "my-first-private-bucket"
key = "some_object_key"
content = "object content"
}