-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.tf
60 lines (46 loc) · 1.19 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
provider "aws" {
region = "us-east-1"
}
data "aws_caller_identity" "this" {}
data "aws_region" "this" {}
resource "random_string" "this" {
length = 32
special = false
numeric = false
upper = false
}
locals {
bucket_name = random_string.this.id
access_point_name = "access-point-test-internet"
account_id = data.aws_caller_identity.this.account_id
region = data.aws_region.this.name
}
###################################################
# S3 Bucket
###################################################
module "bucket" {
source = "../../modules/s3-bucket"
# source = "tedilabs/data/aws//modules/s3-bucket"
# version = "~> 0.2.0"
name = local.bucket_name
force_destroy = true
tags = {
"project" = "terraform-aws-data-examples"
}
}
###################################################
# S3 Access Point
###################################################
module "access_point" {
source = "../../modules/s3-access-point"
# source = "tedilabs/data/aws//modules/s3-access-point"
# version = "~> 0.2.0"
name = local.access_point_name
bucket = {
name = module.bucket.name
}
policy = null
block_public_access = {
enabled = true
}
}