provider “aws” {
region = “us-east-1” # Set your desired region here
}

resource “aws_vpc” “my_vpc” {
cidr_block = “10.0.0.0/16” # Set your desired CIDR block for the VPC
}

resource “aws_subnet” “my_subnet” {
vpc_id = aws_vpc.my_vpc.id
cidr_block = “10.0.1.0/24” # Set your desired CIDR block for the subnet
}

resource “aws_security_group” “my_security_group” {
name = “my-security-group”
description = “My security group”
vpc_id = aws_vpc.my_vpc.id

ingress {
from_port = 22
to_port = 22
protocol = “tcp”
cidr_blocks = [“0.0.0.0/0”] # You can restrict this to a specific IP range
}

egress {
from_port = 0
to_port = 0
protocol = “-1”
cidr_blocks = [“0.0.0.0/0”]}
}

Recent Posts

Start typing and press Enter to search