Skip to content

Instantly share code, notes, and snippets.

@jgwerner
Created February 23, 2023 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgwerner/7b519b19a9b641c3d8fb684fe181a1db to your computer and use it in GitHub Desktop.
Save jgwerner/7b519b19a9b641c3d8fb684fe181a1db to your computer and use it in GitHub Desktop.
Example output of a main.tf file created by ChatGPT
provider "aws" {
region = "us-west-2"
}
resource "aws_vpc" "example" {
cidr_block = "10.0.0.0/16"
tags = {
Name = "example-vpc"
}
}
resource "aws_subnet" "example" {
vpc_id = aws_vpc.example.id
cidr_block = "10.0.1.0/24"
tags = {
Name = "example-subnet"
}
}
resource "aws_security_group" "example" {
name_prefix = "example-"
vpc_id = aws_vpc.example.id
ingress {
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "example-security-group"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment