forked from arminc/terraform-ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.tf
50 lines (42 loc) · 1.66 KB
/
ecs.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
provider "aws" {
region = "eu-west-1"
}
module "ecs" {
source = "modules/ecs"
environment = "${var.environment}"
cluster = "${var.environment}"
cloudwatch_prefix = "${var.environment}" #See ecs_instances module when to set this and when not!
vpc_cidr = "${var.vpc_cidr}"
public_subnet_cidrs = "${var.public_subnet_cidrs}"
private_subnet_cidrs = "${var.private_subnet_cidrs}"
availability_zones = "${var.availability_zones}"
max_size = "${var.max_size}"
min_size = "${var.min_size}"
desired_capacity = "${var.desired_capacity}"
key_name = "${aws_key_pair.ecs.key_name}"
instance_type = "${var.instance_type}"
ecs_aws_ami = "${var.ecs_aws_ami}"
}
resource "aws_key_pair" "ecs" {
key_name = "ecs-key-${var.environment}"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtMljjj0Ccxux5Mssqraa/iHHxheW+m0Rh17fbd8t365y9EwBn00DN/0PjdU2CK6bjxwy8BNGXWoUXiSDDtGqRupH6e9J012yE5kxhpXnnkIcLGjkAiflDBVV4sXS4b3a2LSXL5Dyb93N2GdnJ03FJM4qDJ8lfDQxb38eYHytZkmxW14xLoyW5Hbyr3SXhdHC2/ecdp5nLNRwRWiW6g9OA6jTQ3LgeOZoM6dK4ltJUQOakKjiHsE+jvmO0hJYQN7+5gYOw0HHsM+zmATvSipAWzoWBWcmBxAbcdW0R0KvCwjylCyRVbRMRbSZ/c4idZbFLZXRb7ZJkqNJuy99+ld41 [email protected]"
}
variable "vpc_cidr" {}
variable "environment" {}
variable "max_size" {}
variable "min_size" {}
variable "desired_capacity" {}
variable "instance_type" {}
variable "ecs_aws_ami" {}
variable "private_subnet_cidrs" {
type = "list"
}
variable "public_subnet_cidrs" {
type = "list"
}
variable "availability_zones" {
type = "list"
}
output "default_alb_target_group" {
value = "${module.ecs.default_alb_target_group}"
}