-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.tf
61 lines (52 loc) · 1.33 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
# --------------------------------
# Creates cloud resources in AWS
# --------------------------------
provider "aws" {}
variable "image_bucket" {
description = "The AWS S3 bucket for the uploaded images, and for the current working image"
type = "string"
}
variable "website_bucket" {
description = "The AWS S3 bucket to host the statistics website"
type = "string"
}
variable "stats_table" {
description = "The AWS DynamoDB table name for stats"
type = "string"
}
variable "stats_key" {
description = "The AWS DynamoDB table primary key for stats"
type = "string"
}
variable "trend_table" {
description = "The AWS DynamoDB table name for trend data"
type = "string"
}
variable "trend_key" {
description = "The AWS DynamoDB table primary key for trend data"
type = "string"
}
resource "aws_s3_bucket" b1 {
bucket = var.image_bucket
acl = "private"
}
resource "aws_dynamodb_table" t1 {
name = var.stats_table
read_capacity = 5
write_capacity = 5
hash_key = var.stats_key
attribute {
name = var.stats_key
type = "S"
}
}
resource "aws_dynamodb_table" t2 {
name = var.trend_table
read_capacity = 5
write_capacity = 5
hash_key = var.trend_key
attribute {
name = var.trend_key
type = "S"
}
}