AWS Amazon EC2 VPC

This page shows how to write Terraform and CloudFormation for Amazon EC2 VPC and write them securely.


Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.


Terraform Example (aws_vpc)

Provides a VPC resource.


Example Usage (from GitHub)

resource "aws_vpc" "not_ok_vpc" {
  cidr_block = ""

resource "aws_vpc" "not_ok_vpc_2" {
  cidr_block = ""
resource "aws_vpc" "tappo-vpc" {
    cidr_block           = ""
    enable_dns_hostnames = true
    enable_dns_support   = true
    instance_tenancy     = "default"

resource "aws_vpc" "symbol-mainnet_us-east-1" {
  provider =
  cidr_block       = var.vpc_cidr
  instance_tenancy = "default"
  enable_dns_support = true
  enable_dns_hostnames = true
resource "aws_vpc" "test1" {
  cidr_block = ""

  tags = {
    Name = "foo"
    awsrm = "test-acc"

CloudFormation Example (AWS::EC2::VPC)

Specifies a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). For more information about how large to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.


Frequently asked questions

What is AWS Amazon EC2 VPC?

AWS Amazon EC2 VPC is a resource for Amazon EC2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon EC2 VPC?

For Terraform, the SnidermanIndustries/checkov-fork, tappoflw/tappo1 and symbol/symbol-infra source code examples are useful. See the Terraform Example section for further details.