provisioning-1/securitygroup.tf

29 lines
604 B
Terraform
Raw Permalink Normal View History

2025-07-03 17:08:46 +09:00
# ---------------------------
# Security Group
# ---------------------------
resource "aws_security_group" "hands_on_ec2_sg" {
name = "user01-hands-on-ec2-sg"
description = "For EC2 Linux"
vpc_id = aws_vpc.hands_on_vpc.id
tags = {
# Name = "userXX-hands-on-ec2-sg"
Name =
}
# インバウンドルール
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["3.112.23.0/29"]
}
# アウトバウンドルール
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}