Skip to content

Instantly share code, notes, and snippets.

@rkhullar
Last active September 8, 2023 23:39
Show Gist options
  • Save rkhullar/de91fa49db1dbf346ad1830e1b3e2dbb to your computer and use it in GitHub Desktop.
Save rkhullar/de91fa49db1dbf346ad1830e1b3e2dbb to your computer and use it in GitHub Desktop.
tutorials/terraform-example-module
resource "aws_vpc" "default" {
cidr_block = var.cidr
tags = {
Name = var.name
}
}
variable "name" {
type = string
nullable = false
}
variable "cidr" {
type = string
nullable = false
default = "10.0.0.0/16"
}
variable "region" {
type = string
nullable = false
}
output "id" {
value = aws_vpc.default.id
}
terraform {
required_version = "~> 1.5"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = var.region
}
name = "devops-prod"
cidr = "10.101.0.0/16"
region = "us-east-1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment