terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 2.70"
}
}
}
provider "aws" {
region = "us-west-2"
}
resource "aws_vpc" "my_vpc" {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
tags = {
Name = "MyVPC"
}
}
resource "aws_security_group" "allow_all_test" {
name = "allow_all_test" // Please replace it with your configuration and here is an example to allow all traffic
description = "Allow all inbound traffic"
ingress { // Please replace it with your configuration
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
egress { // Please replace it with your configuration and here is an example to allow all traffic
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
terraform init
terraform apply
Would you like a cup of coffee?