AWS Amazon EC2 VPC

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

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (aws_vpc)

Provides a VPC resource.

Parameters

Example Usage (from GitHub)

github-iconSnidermanIndustries/checkov-fork
resource "aws_vpc" "not_ok_vpc" {
  cidr_block = "10.0.0.0/16"
}

resource "aws_vpc" "not_ok_vpc_2" {
  cidr_block = "10.0.0.0/16"
github-icontappoflw/tappo1
resource "aws_vpc" "tappo-vpc" {
    cidr_block           = "192.168.0.0/24"
    enable_dns_hostnames = true
    enable_dns_support   = true
    instance_tenancy     = "default"

github-iconsymbol/symbol-infra
resource "aws_vpc" "symbol-mainnet_us-east-1" {
  provider = aws.us-east-1
  cidr_block       = var.vpc_cidr
  instance_tenancy = "default"
  enable_dns_support = true
  enable_dns_hostnames = true
github-iconjckuester/awsrm
resource "aws_vpc" "test1" {
  cidr_block = "10.0.0.0/16"

  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.

Parameters

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.