From ffa375fb6fa29fcd84c4d7ace195ad469f6813dc Mon Sep 17 00:00:00 2001 From: Travis Saucier Date: Wed, 17 May 2023 09:51:50 -0400 Subject: [PATCH] change the name of the vpc example --- examples/simple/.terraform-version | 1 + examples/simple/.terraform.lock.hcl | 139 ++++++++++++++++++++++++++++ examples/simple/README.md | 40 ++++++++ examples/simple/main.tf | 50 ++++++++++ examples/simple/outputs.tf | 4 + examples/simple/variables.tf | 44 +++++++++ 6 files changed, 278 insertions(+) create mode 100644 examples/simple/.terraform-version create mode 100644 examples/simple/.terraform.lock.hcl create mode 100644 examples/simple/README.md create mode 100644 examples/simple/main.tf create mode 100644 examples/simple/outputs.tf create mode 100644 examples/simple/variables.tf diff --git a/examples/simple/.terraform-version b/examples/simple/.terraform-version new file mode 100644 index 0000000..a1c22f8 --- /dev/null +++ b/examples/simple/.terraform-version @@ -0,0 +1 @@ +latest:^1.3 diff --git a/examples/simple/.terraform.lock.hcl b/examples/simple/.terraform.lock.hcl new file mode 100644 index 0000000..6bffdc9 --- /dev/null +++ b/examples/simple/.terraform.lock.hcl @@ -0,0 +1,139 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/cloudposse/awsutils" { + version = "0.15.0" + constraints = ">= 0.8.0, ~> 0.15" + hashes = [ + "h1:L7SFFKdGXSdtui8mROf3aMJIcljEgxw/YH1ShbZrajY=", + "h1:Oj2vUB7rFx4jK9GaqIAQhrX6PScz82m5SpRDBAN/++0=", + "h1:j/4IQ9Cxv1xiyXQ9xfoHOU+/KLKH6t2KSnIQjemu7PU=", + "zh:0ebc5f3d236915f4c2e2cf77cb20a2e234e5cd0398e9377838ba2c5c81e098b4", + "zh:1921b87d2afb0afb1a211e9b997c2be36dabeaeeaae8e3d57bcdccb9e3499597", + "zh:39edbbf93feccdc9374b7592318f816b2bbd51aaf0493386ebcf3f6c1d55eeeb", + "zh:4534f0182e8acda0669a7eb9fcf0411392724f89bbbe4f4f3008fbd13efccc1c", + "zh:51238cdd6f92c544d45df5f874893eacdb76ba78ca134637af0a6c58af3c2d78", + "zh:6c71dccb64979e1562c01b1e233d09c7b5175dccab459864868d013d37132993", + "zh:81fce9fe59f2edf021c3865f0f78d60dbc3c05bf98ce9b91b2ce152e830f18c3", + "zh:84bf715f2d337de502815d4dec79ff48572920c9cc5deb2ec4936e144e9fc4a9", + "zh:8cb34b159da8973e9431f4157350b157d1150432f5a83069fd467ef51bd06ad1", + "zh:8d14bd66cf0bcb6bb7d6120667c28954b8da8efeecc8e9c508b0752c9c81a40b", + "zh:916b19d72922c3ff78f989b498040c351e7e41395b0d677bdfc774a617337c20", + "zh:bb8fd6878afa8eefc2b9e15f3a237e817b92832457938230c3c9de176c5bf70f", + "zh:bf885c0e987abd604497c4b9ab93029dd2214ac4d60533891d2d225f5fc52481", + "zh:f580afb656b8e31dd05ff27295dfdbdf4ed0158e6c592f391ae13cf9eba02d88", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.57.0" + constraints = ">= 2.0.0, >= 3.0.0, >= 4.0.0, >= 4.9.0, ~> 4.9" + hashes = [ + "h1:07cB50nnQkmdSHw5ehVEOny4czNYxAAdp00RUKWVa/w=", + "h1:b76m+0Afn8VrXUMzHmsQ2b5EnxGFoBxKzo2KKxmFUyM=", + "h1:xMOeHMZM7RAO6HKP2C6XbbBjGdHogTJ3CwPRw6xFj30=", + "zh:07d89ad94267b7d6285fd65fbd67f8680e111abf9bbcbcac2e30154262fbbe46", + "zh:0eeee044e6fc285c20241d3de7f9b79450cab2df1452a9c18c0bed1090085a25", + "zh:306ba8ac99a0d9f9eba0386cb11459323696e69dcb28bc5e55b6fb2de28640cd", + "zh:40afc24b94e7cae387f22dd3045b09311a120e429aa4f06168d7498995a98f67", + "zh:5a2c846a2cc463841ca2353fb734ba6f9502e662196c85fd3332a4e18acec72e", + "zh:854fbf7d058e4e31ce4ed882e2085bd94c53be4b38b15f3b5d3d897a2c5102df", + "zh:89a7a5e7de6400662804d5dc43251172e3f0522853dcab304d637a7bbb266654", + "zh:89ef96a1b36396f555e80505f55fd29432be3dc518bd75b72a1aae29e8171b4a", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:b28516cc8e614fad40738ec73ce70528e2a817dae3118895333c1d63f1e22a89", + "zh:c3f1c6a7d56b0838da2f880a74e19df65ca9006cb3ebdc34403cb9d6e4ee046d", + "zh:d036a7355494792e2347b92d766431ba91cb399a4bd2bb719db3025542c0e674", + "zh:d3299b9507085238aaf24f38faffb5d6226a31f916e47320b31d728c7062be16", + "zh:d9f5c04f4648d593d91be2a66c6c61f6c52512c78ac6fb3077f0911a6b95fa2f", + "zh:f84143ee0cff2ad0af8ad40074fb5dcd83bfb8a514c7f43ca23c7422caa42330", + ] +} + +provider "registry.terraform.io/hashicorp/local" { + version = "2.3.0" + constraints = ">= 1.2.0" + hashes = [ + "h1:7y8CXQKtfyvrMCSWgCkCclNN9L161u6jO1dEGVaB5RQ=", + "h1:U+DbBqKnXSIqC2z7qIko2dy8w6wwuZd89orPvfeqHk0=", + "h1:XKX/I/af0ra7hFlQ3eP+rszk37q0Vd9pa9ALgEKcIHg=", + "zh:1f1920b3f78c31c6b69cdfe1e016a959667c0e2d01934e1a084b94d5a02cd9d2", + "zh:550a3cdae0ddb350942624e7b2e8b31d28bc15c20511553432413b1f38f4b214", + "zh:68d1d9ccbfce2ce56b28a23b22833a5369d4c719d6d75d50e101a8a8dbe33b9b", + "zh:6ae3ad6d865a906920c313ec2f413d080efe32c230aca711fd106b4cb9022ced", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:a0f413d50f54124057ae3dcd9353a797b84e91dc34bcf85c34a06f8aef1f9b12", + "zh:a2ac6d4088ceddcd73d88505e18b8226a6e008bff967b9e2d04254ef71b4ac6b", + "zh:a851010672e5218bdd4c4ea1822706c9025ef813a03da716d647dd6f8e2cffb0", + "zh:aa797561755041ef2fad99ee9ffc12b5e724e246bb019b21d7409afc2ece3232", + "zh:c6afa960a20d776f54bb1fc260cd13ead17280ebd87f05b9abcaa841ed29d289", + "zh:df0975e86b30bb89717b8c8d6d4690b21db66de06e79e6d6cfda769f3304afe6", + "zh:f0d3cc3da72135efdbe8f4cfbfb0f2f7174827887990a5545e6db1981f0d3a7c", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.1" + constraints = ">= 2.0.0" + hashes = [ + "h1:Tt3YZzWt6hurTE8+C2NQdDl70qDy5xyo9SDv2qymFdA=", + "h1:tSj1mL6OQ8ILGqR2mDu7OYYYWf+hoir0pf9KAQ8IzO8=", + "h1:ydA0/SNRVB1o95btfshvYsmxA+jZFRZcvKzZSB+4S1M=", + "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", + "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", + "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", + "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", + "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", + "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", + "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", + "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", + "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", + "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", + ] +} + +provider "registry.terraform.io/hashicorp/time" { + version = "0.9.1" + constraints = ">= 0.8.0" + hashes = [ + "h1:NDBCUogi8SVEFGCmoVP7VOU2KbnV7z2mUQF3pRyndoo=", + "h1:UHcDnIYFZ00uoou0TwPGMwOrE8gTkoRephIvdwDAK70=", + "h1:VxyoYYOCaJGDmLz4TruZQTSfQhvwEcMxvcKclWdnpbs=", + "zh:00a1476ecf18c735cc08e27bfa835c33f8ac8fa6fa746b01cd3bcbad8ca84f7f", + "zh:3007f8fc4a4f8614c43e8ef1d4b0c773a5de1dcac50e701d8abc9fdc8fcb6bf5", + "zh:5f79d0730fdec8cb148b277de3f00485eff3e9cf1ff47fb715b1c969e5bbd9d4", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:8c8094689a2bed4bb597d24a418bbbf846e15507f08be447d0a5acea67c2265a", + "zh:a6d9206e95d5681229429b406bc7a9ba4b2d9b67470bda7df88fa161508ace57", + "zh:aa299ec058f23ebe68976c7581017de50da6204883950de228ed9246f309e7f1", + "zh:b129f00f45fba1991db0aa954a6ba48d90f64a738629119bfb8e9a844b66e80b", + "zh:ef6cecf5f50cda971c1b215847938ced4cb4a30a18095509c068643b14030b00", + "zh:f1f46a4f6c65886d2dd27b66d92632232adc64f92145bf8403fe64d5ffa5caea", + "zh:f79d6155cda7d559c60d74883a24879a01c4d5f6fd7e8d1e3250f3cd215fb904", + "zh:fd59fa73074805c3575f08cd627eef7acda14ab6dac2c135a66e7a38d262201c", + ] +} + +provider "registry.terraform.io/hashicorp/tls" { + version = "3.4.0" + constraints = ">= 3.2.0, < 4.0.0" + hashes = [ + "h1:QpJxHEQt5369EnAZ10+8MnvJ0TktFA0oWbRe6lzvb+s=", + "h1:eR8HSjiYHn0pwlogB05zZ00bkhg7J7C+dWauV1NmRT8=", + "h1:fSRc/OyRitbAST9vE+mEcmgJiDp+Jx8pGPbUUeYEQRc=", + "zh:2442a0df0cfb550b8eba9b2af39ac06f54b62447eb369ecc6b1c29f739b33bbb", + "zh:3ebb82cacb677a099de55f844f0d02886bc804b1a2b94441bc40fabcb64d2a38", + "zh:436125c2a7e66bc62a4a7c68bdca694f071d7aa894e8637dc83f4a68fe322546", + "zh:5f03db9f1d77e8274ff4750ae32d5c16c42b862b06bcb0683e4d733c8db922e4", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:8190142ae8a539ab34193b7e75da0fa04035d1dcd8af8be94df1eafeeffb44b6", + "zh:8cdc7cd9221e27c189e5beaf78462fce4c2edb081f415a1eafc6da2949de31e2", + "zh:a5de0f7f5d63c59ebf61d3c1d94040f410665ff0aa04f66674efe24b39a11f94", + "zh:a9fce48db3c140cc3e06f8a3c7ef4d36735e457e7660442d6d5dcd2b0781adc3", + "zh:beb92de584c790c7c7f047e45ccd22b6ee3263c7b5a91ae4d6882ae6e7700570", + "zh:f373f8cc52846fb513f44f468d885f722ca4dc22af9ff1942368cafd16b796b3", + "zh:f69627fd6e5a920b17ff423cdbad2715078ca6d13146dc67668795582ab43748", + ] +} diff --git a/examples/simple/README.md b/examples/simple/README.md new file mode 100644 index 0000000..79e392c --- /dev/null +++ b/examples/simple/README.md @@ -0,0 +1,40 @@ + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | ~> 1.3 | +| [aws](#requirement\_aws) | ~> 4.9 | + +## Providers + +No providers. + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [network](#module\_network) | ../. | n/a | +| [tags](#module\_tags) | git::https://github.com/sourcefuse/terraform-aws-refarch-tags.git | 1.1.0 | + +## Resources + +No resources. + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [availability\_zones](#input\_availability\_zones) | List of availability zones to deploy resources in. | `list(string)` |
[
"us-east-1a",
"us-east-1b"
]
| no | +| [environment](#input\_environment) | Name of the environment, i.e. dev, stage, prod | `string` | `"dev"` | no | +| [namespace](#input\_namespace) | Namespace of the project, i.e. refarch | `string` | `"example"` | no | +| [profile](#input\_profile) | AWS profile | `string` | `"default"` | no | +| [region](#input\_region) | AWS Region | `string` | `"us-east-1"` | no | +| [vpc\_ipv4\_primary\_cidr\_block](#input\_vpc\_ipv4\_primary\_cidr\_block) | IPv4 CIDR block for the VPC to use. | `string` | `"10.9.0.0/16"` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [vpn\_endpoint\_dns\_name](#output\_vpn\_endpoint\_dns\_name) | The DNS Name of the Client VPN Endpoint Connection. | + diff --git a/examples/simple/main.tf b/examples/simple/main.tf new file mode 100644 index 0000000..e8f08f7 --- /dev/null +++ b/examples/simple/main.tf @@ -0,0 +1,50 @@ +################################################################ +## defaults +################################################################ +terraform { + required_version = ">= 1.3" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.0" + } + } +} + +provider "aws" { + region = var.region +} + +module "tags" { + source = "git::https://github.com/sourcefuse/terraform-aws-refarch-tags.git?ref=1.1.0" + + environment = var.environment + project = "terraform-aws-ref-arch-network" + + extra_tags = { + Example = "True" + } +} + +################################################################ +## network +################################################################ +module "network" { + source = "../." + + namespace = var.namespace + environment = var.environment + availability_zones = var.availability_zones + vpc_ipv4_primary_cidr_block = var.vpc_ipv4_primary_cidr_block + client_vpn_enabled = true + tags = module.tags.tags + client_vpn_authorization_rules = [ + { + target_network_cidr = var.vpc_ipv4_primary_cidr_block + authorize_all_groups = true + description = "default authorization group to allow all authenticated clients to access the vpc" + } + ] + +} diff --git a/examples/simple/outputs.tf b/examples/simple/outputs.tf new file mode 100644 index 0000000..0a0950b --- /dev/null +++ b/examples/simple/outputs.tf @@ -0,0 +1,4 @@ +output "vpn_endpoint_dns_name" { + value = module.network.vpn_endpoint_dns_name + description = "The DNS Name of the Client VPN Endpoint Connection." +} diff --git a/examples/simple/variables.tf b/examples/simple/variables.tf new file mode 100644 index 0000000..4199a4a --- /dev/null +++ b/examples/simple/variables.tf @@ -0,0 +1,44 @@ +################################################################ +## shared +################################################################ +variable "environment" { + type = string + description = "Name of the environment, i.e. dev, stage, prod" + default = "dev" +} + +variable "region" { + type = string + description = "AWS Region" + default = "us-east-1" +} + +variable "namespace" { + type = string + description = "Namespace of the project, i.e. refarch" + default = "example" +} + +variable "profile" { + type = string + description = "AWS profile" + default = "default" +} + +################################################################ +## network +################################################################ +variable "availability_zones" { + type = list(string) + description = "List of availability zones to deploy resources in." + default = [ + "us-east-1a", + "us-east-1b" + ] +} + +variable "vpc_ipv4_primary_cidr_block" { + type = string + description = "IPv4 CIDR block for the VPC to use." + default = "10.9.0.0/16" +}