forked from segmentio/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
72 lines (63 loc) · 1.84 KB
/
main.tf
File metadata and controls
72 lines (63 loc) · 1.84 KB
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
/**
* This module is used to set configuration defaults for the AWS infrastructure.
* It doesn't provide much value when used on its own because terraform makes it
* hard to do dynamic generations of things like subnets, for now it's used as
* a helper module for the stack.
*
* Usage:
*
* module "defaults" {
* source = "github.com/segmentio/stack/defaults"
* region = "us-east-1"
* cidr = "10.0.0.0/16"
* }
*
*/
variable "region" {
description = "The AWS region"
}
variable "cidr" {
description = "The CIDR block to provision for the VPC"
}
variable "default_ecs_ami" {
type = "map"
default = {
us-east-1 = "ami-dde4e6ca"
us-west-1 = "ami-6d21770d"
us-west-2 = "ami-97da70f7"
eu-west-1 = "ami-c41f3bb7"
eu-central-1 = "ami-4ba16024"
ap-northeast-1 = "ami-90ea86f7"
ap-northeast-2 = "ami-8a4b9ce4"
ap-southeast-1 = "ami-d603afb5"
ap-southeast-2 = "ami-1ddce47e"
sa-east-1 = "ami-29039a45"
}
}
# http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html#attach-bucket-policy
variable "default_log_account_ids" {
type = "map"
default = {
us-east-1 = "127311923021"
us-west-2 = "797873946194"
us-west-1 = "027434742980"
eu-west-1 = "156460612806"
eu-central-1 = "054676820928"
ap-southeast-1 = "114774131450"
ap-northeast-1 = "582318560864"
ap-southeast-2 = "783225319266"
ap-northeast-2 = "600734575887"
sa-east-1 = "507241528517"
us-gov-west-1 = "048591011584"
cn-north-1 = "638102146993"
}
}
output "domain_name_servers" {
value = "${cidrhost(var.cidr, 2)}"
}
output "ecs_ami" {
value = "${lookup(var.default_ecs_ami, var.region)}"
}
output "s3_logs_account_id" {
value = "${lookup(var.default_log_account_ids, var.region)}"
}