forked from kleivane/immutable-webapp-starterpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
37 lines (30 loc) · 732 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
provider "aws" {
version = "~> 2.0"
region = "eu-north-1"
}
resource "aws_s3_bucket" "bucket-host" {
bucket = "my-tf-bucket-host"
acl = "private"
tags = {
Managed = "Terraform"
}
}
resource "aws_s3_bucket" "bucket-asset" {
bucket = "my-tf-bucket-asset"
acl = "private"
tags = {
Managed = "Terraform"
}
}
resource "aws_s3_bucket_policy" "bucket-host" {
bucket = "my-tf-bucket-host"
policy = templatefile("policy/public_bucket.json.tpl", {
bucket_arn = aws_s3_bucket.bucket-host.arn
})
}
resource "aws_s3_bucket_policy" "bucket-asset" {
bucket = "my-tf-bucket-asset"
policy = templatefile("policy/public_bucket.json.tpl", {
bucket_arn = aws_s3_bucket.bucket-asset.arn
})
}