This repository was archived by the owner on Jul 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 418
/
Copy pathmain.tf
68 lines (61 loc) · 1.81 KB
/
main.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
/**
* 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" {
default = {
us-east-1 = "ami-5f3ff932"
us-west-1 = "ami-31c08551"
us-west-2 = "ami-f3985d93"
eu-west-1 = "ami-063f1a60"
eu-central-1 = "ami-6c58b103"
ap-northeast-1 = "ami-a69d68c7"
ap-northeast-2 = "ami-7b2de615"
ap-southeast-1 = "ami-550dde36"
ap-southeast-2 = "ami-c799b0a4"
sa-east-1 = "ami-0274fe6e"
}
}
# http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html#attach-bucket-policy
variable "default_log_account_ids" {
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)}"
}