-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding additional outputs to the module
- Loading branch information
Showing
14 changed files
with
240 additions
and
32 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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
# | ||
AUTHOR_EMAIL[email protected] | ||
|
||
.PHONY: all security lint format documentation documentation-examples | ||
.PHONY: all security lint format documentation documentation-examples validate-all validate validate-examples init | ||
|
||
default: all | ||
|
||
|
@@ -45,10 +45,24 @@ init: | |
@echo "--> Running terraform init" | ||
@terraform init -backend=false | ||
|
||
validate-all: | ||
@echo "--> Running all validation checks" | ||
$(MAKE) validate | ||
$(MAKE) validate-examples | ||
|
||
validate: | ||
@echo "--> Running terraform validate" | ||
@terraform init -backend=false | ||
@terraform validate | ||
|
||
validate-examples: | ||
@echo "--> Running terraform validate on examples" | ||
@find examples -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \ | ||
echo "--> Validating $$dir"; \ | ||
terraform -chdir=$$dir init; \ | ||
terraform -chdir=$$dir validate; \ | ||
done | ||
|
||
lint: | ||
@echo "--> Running tflint" | ||
@tflint --init | ||
|
@@ -57,3 +71,10 @@ lint: | |
format: | ||
@echo "--> Running terraform fmt" | ||
@terraform fmt -recursive -write=true | ||
|
||
clean: | ||
@echo "--> Cleaning up" | ||
@find . -type d -name ".terraform" | while read -r dir; do \ | ||
echo "--> Removing $$dir"; \ | ||
rm -rf $$dir; \ | ||
done |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 | | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0.0 | | ||
| <a name="requirement_awscc"></a> [awscc](#requirement\_awscc) | >= 0.11.0 | | ||
|
||
## Providers | ||
|
||
No providers. | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_vpc"></a> [vpc](#module\_vpc) | ../.. | n/a | | ||
|
||
## Resources | ||
|
||
No resources. | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_name"></a> [name](#input\_name) | Is the name of the network to provision | `string` | n/a | yes | | ||
| <a name="input_private_subnet_netmask"></a> [private\_subnet\_netmask](#input\_private\_subnet\_netmask) | The netmask for the private subnets | `number` | n/a | yes | | ||
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to apply to all resources | `map(string)` | n/a | yes | | ||
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | The number of availability zone the network should be deployed into | `number` | `2` | no | | ||
| <a name="input_enable_ipam"></a> [enable\_ipam](#input\_enable\_ipam) | Indicates the cidr block for the network should be assigned from IPAM | `bool` | `true` | no | | ||
| <a name="input_enable_ssm"></a> [enable\_ssm](#input\_enable\_ssm) | Indicates we should provision SSM private endpoints | `bool` | `false` | no | | ||
| <a name="input_enable_transit_gateway"></a> [enable\_transit\_gateway](#input\_enable\_transit\_gateway) | Indicates the network should provison nat gateways | `bool` | `false` | no | | ||
| <a name="input_public_subnet_netmask"></a> [public\_subnet\_netmask](#input\_public\_subnet\_netmask) | The netmask for the public subnets | `number` | `0` | no | | ||
| <a name="input_transit_gateway_id"></a> [transit\_gateway\_id](#input\_transit\_gateway\_id) | If enabled, and not lookup is disabled, the transit gateway id to connect to | `string` | `""` | no | | ||
| <a name="input_vpc_cidr"></a> [vpc\_cidr](#input\_vpc\_cidr) | An optional cidr block to assign to the VPC (if not using IPAM) | `string` | `null` | no | | ||
|
||
## Outputs | ||
|
||
No outputs. | ||
<!-- END_TF_DOCS --> |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
## Provision a VPC with public and private subnets | ||
module "vpc" { | ||
source = "../.." | ||
|
||
availability_zones = var.availability_zones | ||
enable_ipam = var.enable_ipam | ||
enable_ssm = var.enable_ssm | ||
enable_transit_gateway = var.enable_transit_gateway | ||
name = var.name | ||
private_subnet_netmask = var.private_subnet_netmask | ||
public_subnet_netmask = var.public_subnet_netmask | ||
tags = var.tags | ||
transit_gateway_id = var.transit_gateway_id | ||
vpc_cidr = var.vpc_cidr | ||
} |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
provider "aws" {} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
terraform { | ||
required_version = ">= 1.0.0" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 5.0.0" | ||
} | ||
awscc = { | ||
source = "hashicorp/awscc" | ||
version = ">= 0.11.0" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
variable "availability_zones" { | ||
description = "The number of availability zone the network should be deployed into" | ||
type = number | ||
default = 2 | ||
} | ||
|
||
variable "enable_ipam" { | ||
description = "Indicates the cidr block for the network should be assigned from IPAM" | ||
type = bool | ||
default = true | ||
} | ||
|
||
variable "enable_transit_gateway" { | ||
description = "Indicates the network should provison nat gateways" | ||
type = bool | ||
default = false | ||
} | ||
|
||
variable "enable_ssm" { | ||
description = "Indicates we should provision SSM private endpoints" | ||
type = bool | ||
default = false | ||
} | ||
|
||
variable "name" { | ||
description = "Is the name of the network to provision" | ||
type = string | ||
} | ||
|
||
variable "private_subnet_netmask" { | ||
description = "The netmask for the private subnets" | ||
type = number | ||
|
||
validation { | ||
condition = var.private_subnet_netmask > 0 && var.private_subnet_netmask <= 28 | ||
error_message = "private_subnet_netmask must be between 1 and 28" | ||
} | ||
} | ||
|
||
variable "public_subnet_netmask" { | ||
description = "The netmask for the public subnets" | ||
type = number | ||
default = 0 | ||
} | ||
|
||
variable "tags" { | ||
description = "Tags to apply to all resources" | ||
type = map(string) | ||
} | ||
|
||
variable "transit_gateway_id" { | ||
description = "If enabled, and not lookup is disabled, the transit gateway id to connect to" | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "vpc_cidr" { | ||
description = "An optional cidr block to assign to the VPC (if not using IPAM)" | ||
type = string | ||
default = null | ||
} |
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.