Skip to content

Commit 38dedb9

Browse files
authored
Fix Security Group ingress rules (#25)
* Fix tags * Remove "0.0.0.0/0" ingress rule from Security Group
1 parent 9de48a7 commit 38dedb9

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

main.tf

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,10 @@ resource "aws_iam_instance_profile" "ec2" {
307307

308308
resource "aws_security_group" "default" {
309309
name = "${module.label.id}"
310-
description = "Allow all inbound traffic"
310+
description = "Allow inbound traffic from provided Security Groups"
311311

312312
vpc_id = "${var.vpc_id}"
313313

314-
ingress {
315-
from_port = 0
316-
to_port = 0
317-
protocol = -1
318-
cidr_blocks = ["0.0.0.0/0"]
319-
}
320-
321314
ingress {
322315
from_port = 0
323316
to_port = 0
@@ -332,21 +325,13 @@ resource "aws_security_group" "default" {
332325
cidr_blocks = ["0.0.0.0/0"]
333326
}
334327

335-
tags {
336-
Name = "${module.label.id}"
337-
Namespace = "${var.namespace}"
338-
Stage = "${var.stage}"
339-
}
328+
tags = "${module.label.tags}"
340329
}
341330

342331
#
343-
344332
# Full list of options:
345-
346333
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elasticbeanstalkmanagedactionsplatformupdate
347-
348334
#
349-
350335
resource "aws_elastic_beanstalk_environment" "default" {
351336
name = "${module.label.id}"
352337
application = "${var.app}"
@@ -356,11 +341,7 @@ resource "aws_elastic_beanstalk_environment" "default" {
356341

357342
wait_for_ready_timeout = "${var.wait_for_ready_timeout}"
358343

359-
tags {
360-
Name = "${module.label.id}"
361-
Namespace = "${var.namespace}"
362-
Stage = "${var.stage}"
363-
}
344+
tags = "${module.label.tags}"
364345

365346
setting {
366347
namespace = "aws:ec2:vpc"

0 commit comments

Comments
 (0)