Difference between revisions of "Terraform resource: aws security group"

From wikieduonline
Jump to navigation Jump to search
Line 36: Line 36:
 
* <code>[[vpc_id]]</code>
 
* <code>[[vpc_id]]</code>
 
* <code>[[security_groups]]</code>: <code>[[aws_ecs_service]]</code>
 
* <code>[[security_groups]]</code>: <code>[[aws_ecs_service]]</code>
* <code>[[vpc_security_group_ids]]</code>
+
* <code>[[vpc_security_group_ids]]</code>: <code>[[aws_instance]], [[aws_db_instance]]</code>
  
 
== See also ==
 
== See also ==

Revision as of 11:46, 31 January 2023

aws_security_group


resource "aws_security_group" "allow_tls" {
  name        = "allow_tls"
  description = "Allow TLS inbound traffic"
  vpc_id      = aws_vpc.main.id

  ingress {
    description      = "TLS from VPC"
    from_port        = 443
    to_port          = 443
    protocol         = "tcp"
    cidr_blocks      = [aws_vpc.main.cidr_block]
    ipv6_cidr_blocks = [aws_vpc.main.ipv6_cidr_block]
  } 

  egress {
    from_port        = 0
    to_port          = 0
    protocol         = "-1"
    cidr_blocks      = ["0.0.0.0/0"]
    ipv6_cidr_blocks = ["::/0"]
  }

  tags = {
    Name = "allow_tls"
  }
}


Related terms

See also

Advertising: