This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathremo.tf
66 lines (59 loc) · 2.77 KB
/
remo.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
module "remo-staging" {
source = "./modules/remo"
environment = "staging"
vpc_id = "${aws_vpc.apps-production-vpc.id}"
remo_elasticache_instance_size = "cache.t2.micro"
service_security_group_id = "${module.mesos-cluster-production.mesos-cluster-slave-sg-id}"
elasticache_subnet_group = "${aws_elasticache_subnet_group.elasticache-production-subnet-group.name}"
elasticache_sg_name = "remo-redis-staging-sg"
elasticache_sg_description = "remo staging elasticache SG"
iam-assume-role-policy = "${data.aws_iam_policy_document.containers-assume-role-policy.json}"
}
module "remo-production" {
source = "./modules/remo"
environment = "production"
vpc_id = "${aws_vpc.apps-production-vpc.id}"
remo_elasticache_instance_size = "cache.t2.micro"
service_security_group_id = "${module.mesos-cluster-production.mesos-cluster-slave-sg-id}"
elasticache_subnet_group = "${aws_elasticache_subnet_group.elasticache-production-subnet-group.name}"
elasticache_sg_name = "remo-redis-shared-sg"
elasticache_sg_description = "remo elasticache SG"
iam-assume-role-policy = "${data.aws_iam_policy_document.containers-assume-role-policy.json}"
}
# Generic remo memcache instance
resource "aws_security_group" "remo-memcache-sg" {
name = "generic-remo-memcache-sg"
description = "Generic remo memcache SG"
vpc_id = "${aws_vpc.apps-production-vpc.id}"
}
resource "aws_security_group_rule" "remo-memcache-sg-allowmemcachefromslaves" {
type = "ingress"
from_port = 11211
to_port = 11211
protocol = "tcp"
source_security_group_id = "${module.mesos-cluster-production.mesos-cluster-slave-sg-id}"
security_group_id = "${aws_security_group.remo-memcache-sg.id}"
}
resource "aws_security_group_rule" "remo-memcache-sg-allowegress" {
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
source_security_group_id = "${module.mesos-cluster-production.mesos-cluster-slave-sg-id}"
security_group_id = "${aws_security_group.remo-memcache-sg.id}"
}
resource "aws_elasticache_cluster" "remo-memcache-ec" {
cluster_id = "remo-generic"
engine = "memcached"
node_type = "cache.t2.micro"
port = 11211
num_cache_nodes = 1
subnet_group_name = "${aws_elasticache_subnet_group.elasticache-production-subnet-group.name}"
security_group_ids = ["${aws_security_group.remo-memcache-sg.id}"]
tags {
Name = "remo-generic-memcache"
app = "memcache"
env = "production"
project = "remo"
}
}