initial commit
This commit is contained in:
1 parent
9dfe9f4d64
commit
9d5b23ca08
9 files changed
+194
-13
No files matched your search
@@ -1,23 +1,28 @@
|
|||||||
# How to use this template
|
# Terraform module - VPC Factory
|
||||||
|
|
||||||
## Desciption
|
## Usage
|
||||||
|
|
||||||
This is a template for a minimal terraform module under GNU General Public License version 3.
|
```
|
||||||
|
module "network" {
|
||||||
|
source = "git:https://gitea.fillon.info/terraform-modules/terraform-aws-vpc-factory?ref=main"
|
||||||
|
|
||||||
|
cidr_block = "10.0.0.0/16"
|
||||||
## Todo
|
}
|
||||||
|
```
|
||||||
* workflows / actions (.tf format and validate)
|
|
||||||
* git hooks
|
|
||||||
|
|
||||||
<!-- BEGIN_TF_DOCS -->
|
<!-- BEGIN_TF_DOCS -->
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
No requirements.
|
| Name | Version |
|
||||||
|
|------|---------|
|
||||||
|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >=1.0.0 |
|
||||||
|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >=4.0 |
|
||||||
|
|
||||||
## Providers
|
## Providers
|
||||||
|
|
||||||
No providers.
|
| Name | Version |
|
||||||
|
|------|---------|
|
||||||
|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.33.0 |
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
@@ -25,13 +30,21 @@ No modules.
|
|||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
No resources.
|
| Name | Type |
|
||||||
|
|------|------|
|
||||||
|
| [aws_vpc.self](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc) | resource |
|
||||||
|
| [aws_availability_zones.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source |
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
No inputs.
|
| Name | Description | Type | Default | Required |
|
||||||
|
|------|-------------|------|---------|:--------:|
|
||||||
|
| <a name="input_cidr_block"></a> [cidr\_block](#input\_cidr\_block) | The IPv4 CIDR block for the VPC. | `string` | `"10.0.0.0/16"` | no |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
No outputs.
|
| Name | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| <a name="output_aws_availability_zones"></a> [aws\_availability\_zones](#output\_aws\_availability\_zones) | List of available AZ names. |
|
||||||
|
| <a name="output_vpc"></a> [vpc](#output\_vpc) | value |
|
||||||
<!-- END_TF_DOCS -->
|
<!-- END_TF_DOCS -->
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# Minimum VPC Factory
|
||||||
|
|
||||||
|
Configuration in this directory creates a VPC from module VPC Factory with default variables values.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To run this example you need to execute:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
terraform init
|
||||||
|
terraform plan
|
||||||
|
terraform apply
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- BEGIN_TF_DOCS -->
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
| Name | Version |
|
||||||
|
|------|---------|
|
||||||
|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >=1.0 |
|
||||||
|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >=4.0 |
|
||||||
|
|
||||||
|
## Providers
|
||||||
|
|
||||||
|
No providers.
|
||||||
|
|
||||||
|
## Modules
|
||||||
|
|
||||||
|
| Name | Source | Version |
|
||||||
|
|------|--------|---------|
|
||||||
|
| <a name="module_vpc"></a> [vpc](#module\_vpc) | ../.. | n/a |
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
No resources.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
No inputs.
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| <a name="output_module"></a> [module](#output\_module) | VPC module outputs |
|
||||||
|
<!-- END_TF_DOCS -->
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
provider "aws" {
|
||||||
|
region = local.region
|
||||||
|
|
||||||
|
default_tags {
|
||||||
|
tags = local.tags
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
name = "ex-${basename(path.cwd)}"
|
||||||
|
region = "eu-west-1"
|
||||||
|
|
||||||
|
tags = {
|
||||||
|
Example = local.name
|
||||||
|
Repo = "terraform-aws-vpc-factory"
|
||||||
|
Org = "terraform-modules"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module "vpc" {
|
||||||
|
source = "../.."
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
output "module" {
|
||||||
|
description = "VPC module outputs"
|
||||||
|
value = module.vpc
|
||||||
|
}
|
||||||
Whitespace-only changes.
@@ -0,0 +1,10 @@
|
|||||||
|
terraform {
|
||||||
|
required_version = ">=1.0"
|
||||||
|
|
||||||
|
required_providers {
|
||||||
|
aws = {
|
||||||
|
source = "hashicorp/aws"
|
||||||
|
version = ">=4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
terraform {
|
||||||
|
required_version = ">=1.0.0"
|
||||||
|
|
||||||
|
required_providers {
|
||||||
|
aws = {
|
||||||
|
source = "hashicorp/aws"
|
||||||
|
version = ">=4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data "aws_availability_zones" "current" {
|
||||||
|
state = "available"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_vpc" "self" {
|
||||||
|
cidr_block = var.cidr_block
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_default_route_table" "self" {
|
||||||
|
default_route_table_id = aws_vpc.self.default_route_table_id
|
||||||
|
|
||||||
|
route = []
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_default_network_acl" "self" {
|
||||||
|
default_network_acl_id = aws_vpc.self.default_network_acl_id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_default_security_group" "self" {
|
||||||
|
vpc_id = aws_vpc.self.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_default_vpc_dhcp_options" "default" {
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [tags_all]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_subnet" "public" {
|
||||||
|
for_each = var.public_subnets
|
||||||
|
|
||||||
|
vpc_id = aws_vpc.self.id
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
output "aws_availability_zones" {
|
||||||
|
description = "List of available AZ names."
|
||||||
|
value = data.aws_availability_zones.current.names
|
||||||
|
}
|
||||||
|
|
||||||
|
output "vpc" {
|
||||||
|
description = "value"
|
||||||
|
value = aws_vpc.self
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
variable "cidr_block" {
|
||||||
|
description = "The IPv4 CIDR block for the VPC."
|
||||||
|
type = string
|
||||||
|
default = "10.0.0.0/16"
|
||||||
|
}
|
||||||
|
|
||||||
|
# variable "public_cidr_block" {
|
||||||
|
# description = "Alternate CIDR block "
|
||||||
|
# type = string
|
||||||
|
# default = ""
|
||||||
|
# }
|
||||||
|
|
||||||
|
# variable "internal_cidr_block" {
|
||||||
|
# description = "value"
|
||||||
|
# type = string
|
||||||
|
# default = ""
|
||||||
|
# }
|
||||||
|
|
||||||
|
variable "public_subnets" {
|
||||||
|
description = "Map of public subnets"
|
||||||
|
type = map(object({
|
||||||
|
cidr_block = string
|
||||||
|
}))
|
||||||
|
default = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
# variable "private_subnets" {
|
||||||
|
|
||||||
|
# }
|
||||||
|
|
||||||
|
# variable "internal_subnets" {
|
||||||
|
|
||||||
|
# }
|
||||||
Reference in new issue
Block a user