-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tag "Name" added to vpc, subnet and e2 resources.
- Loading branch information
1 parent
8bb391f
commit 39f638b
Showing
11 changed files
with
65 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
source = "hashicorp/aws" | ||
version = "5.68.0" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = var.aws_region | ||
region = var.aws_region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
resource "aws_subnet" "subnet" { | ||
vpc_id = var.vpc_id | ||
cidr_block = var.cidr_block | ||
availability_zone = "${var.aws_region}${var.aws_az}" | ||
vpc_id = var.vpc_id | ||
cidr_block = var.cidr_block | ||
availability_zone = "${var.aws_region}${var.aws_az}" | ||
map_public_ip_on_launch = var.public_ip | ||
tags = { | ||
Name = var.subnet_name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
output "subnet_id" { | ||
description = "ID of the subnet" | ||
value = aws_subnet.subnet.id | ||
description = "ID of the subnet" | ||
value = aws_subnet.subnet.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
source = "hashicorp/aws" | ||
version = "5.68.0" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = var.aws_region | ||
region = var.aws_region | ||
} |
29 changes: 17 additions & 12 deletions
29
aws/terraform/networking-contentdelivery/subnet/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
variable "vpc_id" { | ||
type = string | ||
description = "Id of the VPC where the subnet has to be provisioned" | ||
type = string | ||
description = "Id of the VPC where the subnet has to be provisioned" | ||
} | ||
|
||
variable "cidr_block" { | ||
type = string | ||
description = "IP range for a subnet" | ||
type = string | ||
description = "IP range for a subnet" | ||
} | ||
|
||
variable "aws_region" { | ||
type = string | ||
description = "The region where the subnet has to be created" | ||
default = "eu-central-1" | ||
type = string | ||
description = "The region where the subnet has to be created" | ||
default = "eu-central-1" | ||
} | ||
|
||
variable "aws_az" { | ||
type = string | ||
description = "Single char ID of an availability zone i.e. 'a' for eu-central-1a" | ||
type = string | ||
description = "Single char ID of an availability zone i.e. 'a' for eu-central-1a" | ||
} | ||
|
||
variable "public_ip" { | ||
type = bool | ||
default = false | ||
description = "Whether the subnet should provision public IP or not for the deployed instances" | ||
type = bool | ||
default = false | ||
description = "Whether the subnet should provision public IP or not for the deployed instances" | ||
} | ||
|
||
variable "subnet_name" { | ||
type = string | ||
description = "The name set as value for the tag Name" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
resource "aws_vpc" "vpc" { | ||
provider = aws | ||
cidr_block = var.cidr_block | ||
provider = aws | ||
cidr_block = var.cidr_block | ||
tags = { | ||
Name = var.vpc_name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
output "vpc_id" { | ||
description = "ID of the VPC" | ||
value = aws_vpc.vpc.id | ||
description = "ID of the VPC" | ||
value = aws_vpc.vpc.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
source = "hashicorp/aws" | ||
version = "5.68.0" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = var.aws_region | ||
region = var.aws_region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
variable "cidr_block" { | ||
type = string | ||
description = "IP range for a new VPC" | ||
type = string | ||
description = "IP range for a new VPC" | ||
} | ||
|
||
variable "aws_region" { | ||
type = string | ||
default = "eu-central-1" | ||
type = string | ||
default = "eu-central-1" | ||
} | ||
|
||
variable "vpc_name" { | ||
type = string | ||
description = "The name set as value for the tag Name" | ||
} |