Kelley Spoon | 500a7e9 | 2020-07-14 04:11:20 -0500 | [diff] [blame^] | 1 | provider "aws" { |
| 2 | region = "us-east-1" |
| 3 | } |
| 4 | |
| 5 | terraform { |
| 6 | backend "remote" { |
| 7 | hostname = "app.terraform.io" |
| 8 | organization = "trustedfirmware" |
| 9 | workspaces { |
| 10 | name = "prod" |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | # Pre-existing imported security groups |
| 16 | # "Flexnet" security group |
| 17 | resource "aws_security_group" "flexnet-sg" { |
| 18 | name = "Flexnet" |
| 19 | description = "Flexnet access" |
| 20 | } |
| 21 | |
| 22 | resource "aws_security_group_rule" "flexnet-sg" { |
| 23 | cidr_blocks = [ |
| 24 | "172.31.32.0/20", |
| 25 | ] |
| 26 | description = "Fastmodels http" |
| 27 | from_port = 81 |
| 28 | ipv6_cidr_blocks = [] |
| 29 | prefix_list_ids = [] |
| 30 | protocol = "tcp" |
| 31 | security_group_id = "sg-010ac7a82860d6f10" |
| 32 | self = false |
| 33 | to_port = 81 |
| 34 | type = "ingress" |
| 35 | } |
| 36 | |
| 37 | resource "aws_security_group_rule" "flexnet-sg-1" { |
| 38 | cidr_blocks = [ |
| 39 | "172.31.32.0/20", |
| 40 | ] |
| 41 | description = "Flexnet upper range" |
| 42 | from_port = 1000 |
| 43 | ipv6_cidr_blocks = [] |
| 44 | prefix_list_ids = [] |
| 45 | protocol = "tcp" |
| 46 | security_group_id = "sg-010ac7a82860d6f10" |
| 47 | self = false |
| 48 | to_port = 64000 |
| 49 | type = "ingress" |
| 50 | } |
| 51 | |
| 52 | resource "aws_security_group_rule" "flexnet-sg-2" { |
| 53 | cidr_blocks = [ |
| 54 | "172.31.32.0/20", |
| 55 | ] |
| 56 | description = "Flexnet upper range UDP" |
| 57 | from_port = 1000 |
| 58 | ipv6_cidr_blocks = [] |
| 59 | prefix_list_ids = [] |
| 60 | protocol = "udp" |
| 61 | security_group_id = "sg-010ac7a82860d6f10" |
| 62 | self = false |
| 63 | to_port = 64000 |
| 64 | type = "ingress" |
| 65 | } |
| 66 | |
| 67 | resource "aws_security_group_rule" "flexnet-sg-3" { |
| 68 | cidr_blocks = [ |
| 69 | "0.0.0.0/0", |
| 70 | ] |
| 71 | from_port = 0 |
| 72 | ipv6_cidr_blocks = [] |
| 73 | prefix_list_ids = [] |
| 74 | protocol = "-1" |
| 75 | security_group_id = "sg-010ac7a82860d6f10" |
| 76 | self = false |
| 77 | to_port = 0 |
| 78 | type = "egress" |
| 79 | } |
| 80 | |
| 81 | # "ci" security group |
| 82 | resource "aws_security_group" "ci-sg" { |
| 83 | name = "ci" |
| 84 | description = "Jenkins" |
| 85 | } |
| 86 | |
| 87 | resource "aws_security_group_rule" "ci-sg" { |
| 88 | cidr_blocks = [ |
| 89 | "0.0.0.0/0", |
| 90 | ] |
| 91 | from_port = 80 |
| 92 | ipv6_cidr_blocks = [] |
| 93 | prefix_list_ids = [] |
| 94 | protocol = "tcp" |
| 95 | security_group_id = "sg-05f5a50eee7a51e40" |
| 96 | self = false |
| 97 | to_port = 80 |
| 98 | type = "ingress" |
| 99 | } |
| 100 | |
| 101 | resource "aws_security_group_rule" "ci-sg-1" { |
| 102 | cidr_blocks = [] |
| 103 | from_port = 80 |
| 104 | ipv6_cidr_blocks = [ |
| 105 | "::/0", |
| 106 | ] |
| 107 | prefix_list_ids = [] |
| 108 | protocol = "tcp" |
| 109 | security_group_id = "sg-05f5a50eee7a51e40" |
| 110 | self = false |
| 111 | to_port = 80 |
| 112 | type = "ingress" |
| 113 | } |
| 114 | |
| 115 | resource "aws_security_group_rule" "ci-sg-2" { |
| 116 | cidr_blocks = [ |
| 117 | "0.0.0.0/0", |
| 118 | ] |
| 119 | from_port = 8080 |
| 120 | ipv6_cidr_blocks = [] |
| 121 | prefix_list_ids = [] |
| 122 | protocol = "tcp" |
| 123 | security_group_id = "sg-05f5a50eee7a51e40" |
| 124 | self = false |
| 125 | to_port = 8080 |
| 126 | type = "ingress" |
| 127 | } |
| 128 | |
| 129 | resource "aws_security_group_rule" "ci-sg-3" { |
| 130 | cidr_blocks = [] |
| 131 | from_port = 8080 |
| 132 | ipv6_cidr_blocks = [ |
| 133 | "::/0", |
| 134 | ] |
| 135 | prefix_list_ids = [] |
| 136 | protocol = "tcp" |
| 137 | security_group_id = "sg-05f5a50eee7a51e40" |
| 138 | self = false |
| 139 | to_port = 8080 |
| 140 | type = "ingress" |
| 141 | } |
| 142 | |
| 143 | resource "aws_security_group_rule" "ci-sg-4" { |
| 144 | cidr_blocks = [ |
| 145 | "0.0.0.0/0", |
| 146 | ] |
| 147 | from_port = 22 |
| 148 | ipv6_cidr_blocks = [] |
| 149 | prefix_list_ids = [] |
| 150 | protocol = "tcp" |
| 151 | security_group_id = "sg-05f5a50eee7a51e40" |
| 152 | self = false |
| 153 | to_port = 22 |
| 154 | type = "ingress" |
| 155 | } |
| 156 | |
| 157 | resource "aws_security_group_rule" "ci-sg-5" { |
| 158 | cidr_blocks = [ |
| 159 | "0.0.0.0/0", |
| 160 | ] |
| 161 | from_port = 50000 |
| 162 | ipv6_cidr_blocks = [] |
| 163 | prefix_list_ids = [] |
| 164 | protocol = "tcp" |
| 165 | security_group_id = "sg-05f5a50eee7a51e40" |
| 166 | self = false |
| 167 | to_port = 50000 |
| 168 | type = "ingress" |
| 169 | } |
| 170 | |
| 171 | resource "aws_security_group_rule" "ci-sg-6" { |
| 172 | cidr_blocks = [] |
| 173 | from_port = 50000 |
| 174 | ipv6_cidr_blocks = [ |
| 175 | "::/0", |
| 176 | ] |
| 177 | prefix_list_ids = [] |
| 178 | protocol = "tcp" |
| 179 | security_group_id = "sg-05f5a50eee7a51e40" |
| 180 | self = false |
| 181 | to_port = 50000 |
| 182 | type = "ingress" |
| 183 | } |
| 184 | |
| 185 | resource "aws_security_group_rule" "ci-sg-7" { |
| 186 | cidr_blocks = [ |
| 187 | "0.0.0.0/0", |
| 188 | ] |
| 189 | from_port = 443 |
| 190 | ipv6_cidr_blocks = [] |
| 191 | prefix_list_ids = [] |
| 192 | protocol = "tcp" |
| 193 | security_group_id = "sg-05f5a50eee7a51e40" |
| 194 | self = false |
| 195 | to_port = 443 |
| 196 | type = "ingress" |
| 197 | } |
| 198 | |
| 199 | resource "aws_security_group_rule" "ci-sg-8" { |
| 200 | cidr_blocks = [] |
| 201 | from_port = 443 |
| 202 | ipv6_cidr_blocks = [ |
| 203 | "::/0", |
| 204 | ] |
| 205 | prefix_list_ids = [] |
| 206 | protocol = "tcp" |
| 207 | security_group_id = "sg-05f5a50eee7a51e40" |
| 208 | self = false |
| 209 | to_port = 443 |
| 210 | type = "ingress" |
| 211 | } |
| 212 | |
| 213 | resource "aws_security_group_rule" "ci-sg-9" { |
| 214 | cidr_blocks = [ |
| 215 | "0.0.0.0/0", |
| 216 | ] |
| 217 | from_port = 0 |
| 218 | ipv6_cidr_blocks = [] |
| 219 | prefix_list_ids = [] |
| 220 | protocol = "-1" |
| 221 | security_group_id = "sg-05f5a50eee7a51e40" |
| 222 | self = false |
| 223 | to_port = 0 |
| 224 | type = "egress" |
| 225 | } |