-
Notifications
You must be signed in to change notification settings - Fork 0
/
backend-service.tf
67 lines (59 loc) · 2.14 KB
/
backend-service.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
resource "aws_db_subnet_group" "vprofile-rds-subgrp" {
name = "main"
subnet_ids = [module.vpc.private_subnets[0], module.vpc.private_subnets[1], module.vpc.private_subnets[2]]
tags = {
name = "subnet group for RDS"
}
}
resource "aws_elasticache_subnet_group" "vprofile-ecache-subgrp" {
name = "vprofile-ecache-subgrp"
subnet_ids = [module.vpc.private_subnets[0], module.vpc.private_subnets[1], module.vpc.private_subnets[2]]
}
resource "aws_db_instance" "vprofile-rds" {
allocated_storage = 20
storage_type = "gp2"
engine = "mysql"
engine_version = "5.7"
instance_class = "db.t2.micro"
identifier = var.db_name
username = var.dbuser
password = var.dbpass
parameter_group_name = "default.mysql5.7"
multi_az = "false"
publicly_accessible = "false"
skip_final_snapshot = true
db_subnet_group_name = aws_db_subnet_group.vprofile-rds-subgrp.name
vpc_security_group_ids = [aws_security_group.vprofile-backend-sg.id]
}
resource "aws_elasticache_parameter_group" "vprofile-cache-param" {
family = "memcached1.5"
name = "vprofile-cache-params"
description = "Custom parameter group for vprofile cache cluster"
parameter {
name = "parameter1"
value = "value1"
}
}
resource "aws_elasticache_cluster" "vprofile-cache" {
cluster_id = "vprofile-cache"
engine = "memcached"
node_type = "cache.t2.micro"
num_cache_nodes = 1
parameter_group_name = "default.memecached1.5"
port = 11211
security_group_ids = [aws_security_group.vprofile-backend-sg.id]
subnet_group_name = aws_elasticache_subnet_group.vprofile-ecache-subgrp.name
}
resource "aws_mq_broker" "vprofile-rmq" {
broker_name = "vprofile-rmq"
engine_type = "ActiveMQ"
engine_version = "5.17.6"
host_instance_type = "mq.t2.micro"
publicly_accessible = false
security_groups = [aws_security_group.vprofile-backend-sg.id]
subnet_ids = [module.vpc.private_subnets[0]]
user {
password = "Hajarah23456789&"
username = "rabbit"
}
}