Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save derekm1215/2a627c1c119b89420895a2f615d75d28 to your computer and use it in GitHub Desktop.
Save derekm1215/2a627c1c119b89420895a2f615d75d28 to your computer and use it in GitHub Desktop.
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
provider "aws" {
region = "us-west-1"
}
data "aws_region" "current" {}
variable "cidr_block" {
type = string
default = "10.0.0.0/16"
}
resource "aws_vpc" "main" {
cidr_block = var.cidr_block
tags = {
Name = "main"
}
}
output "owner_id" {
value = join("", slice(split("", aws_vpc.main.owner_id), 8, 12))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment