Skip to content

Commit fe82af0

Browse files
Added VPC Skelton and IGW resources
1 parent 7d02562 commit fe82af0

File tree

6 files changed

+63
-1
lines changed

6 files changed

+63
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
*.tfstate
66
*.tfstate.*
77

8+
# Local .hcl configurations
9+
*.hcl
10+
811
# Crash log files
9-
crash.log
12+
*.log
1013

1114
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
1215
# .tfvars files are managed as part of configuration and so should be included in

backend.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Terraform Backend
2+
/*
3+
terraform {
4+
backend "s3" {}
5+
}
6+
*/

main.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# AWS VPC
2+
terraform {
3+
required_version = ">= 0.12.0"
4+
}
5+
6+
# AWS VPC Resources
7+
resource "aws_vpc" "vpc" {
8+
cidr_block = "${var.cidr}"
9+
10+
tags = {
11+
Name = "${var.prefix}-${var.environment}"
12+
Environment = var.environment
13+
}
14+
}
15+
16+
# AWS VPC Internet Gateway
17+
resource "aws_internet_gateway" "igw" {
18+
vpc_id = aws_vpc.vpc.id
19+
20+
tags = {
21+
Name = "${var.prefix}-${var.environment}"
22+
Environment = var.environment
23+
}
24+
}

output.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Terraform Output

provider.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Terraform Provider
2+
provider "aws" {
3+
region = var.aws_region
4+
}

variables.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Terraform Variables
2+
variable "aws_region" {
3+
description = "AWS Default Region"
4+
type = string
5+
default = "us-east-1"
6+
}
7+
8+
variable "prefix" {
9+
description = "To apply generic naming to AWS VPC Resources"
10+
type = string
11+
default = "copper"
12+
}
13+
14+
variable "environment" {
15+
description = "To apply generic environment to AWS VPC Resources"
16+
type = string
17+
default = "devops"
18+
}
19+
20+
variable "cidr" {
21+
description = "CIDR block value to define the size of the AWS VPC"
22+
type = string
23+
default = "10.0.0.0/20"
24+
}

0 commit comments

Comments
 (0)