-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
52 lines (41 loc) · 936 Bytes
/
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
/*
* Variables
*/
variable "environment_name" {
type = string
}
variable "region" {
type = string
}
variable "key_name" {
type = string
}
variable "tags" {
description = "Key/value tags to assign to all resources."
default = {}
type = map(string)
}
data "aws_caller_identity" "current" {}
data "aws_partition" "current" {}
data "aws_region" "current" {}
/*
* Security Groups
*/
resource "aws_security_group" "infrastructure_security_group" {
name = "infrastructure_security_group"
description = "Infrastructure Security Group"
vpc_id = data.aws_vpc.vpc.id
ingress {
cidr_blocks = ["${var.vpc_cidr}"]
protocol = "-1"
from_port = 0
to_port = 0
}
egress {
cidr_blocks = ["0.0.0.0/0"]
protocol = "-1"
from_port = 0
to_port = 0
}
tags = merge(var.tags, map("Name", "${var.environment_name}-infrastructure-security-group"))
}