-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.tf
81 lines (70 loc) · 1.69 KB
/
production.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
resource "aws_db_instance" "main" {
copy_tags_to_snapshot = true
engine = "postgres"
engine_version = "11.5"
identifier = "shopping"
instance_class = "db.t2.micro"
max_allocated_storage = 1000
name = "covid19_shopping_assistant_production"
performance_insights_enabled = true
skip_final_snapshot = true
storage_encrypted = false
}
resource "aws_instance" "main" {
instance_type = "t2.2xlarge"
ami = "ami-035966e8adab4aaad"
iam_instance_profile = aws_iam_instance_profile.main.name
}
resource "aws_route53_zone" "puedo_ir_com" {
name = "puedo-ir.com."
}
resource "aws_route53_zone" "puedo_ir_es" {
name = "puedo-ir.es."
}
resource "aws_route53_zone" "can_i_go_co_uk" {
name = "can-i-go.co.uk."
}
resource "aws_route53_zone" "necakajvrade_com" {
name = "necakajvrade.com."
}
resource "aws_iam_role_policy" "main_instance_send_emails" {
name = "main_instance_send_emails"
role = aws_iam_role.main_instance.id
policy = <<EOF
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Action":[
"ses:SendEmail",
"ses:SendRawEmail"
],
"Resource":"*"
}
]
}
EOF
}
resource "aws_iam_role" "main_instance" {
name = "main_instance"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
EOF
}
resource "aws_iam_instance_profile" "main" {
name = "main"
role = aws_iam_role.main_instance.name
}