Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
clouddrove-ci committed Jan 3, 2024
1 parent 5fe1f2c commit 4c40ae5
Showing 1 changed file with 56 additions and 29 deletions.
85 changes: 56 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- This file was automatically generated by the `geine`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->

<p align="center"> <img src="https://user-images.githubusercontent.com/50652676/62349836-882fef80-b51e-11e9-99e3-7b974309c7e3.png" width="100" height="100"></p>


<h1 align="center">
Terraform AZURE SUBNET
Expand All @@ -11,8 +13,11 @@

<p align="center">

<a href="https://www.terraform.io">
<img src="https://img.shields.io/badge/Terraform-v1.0.0-green" alt="Terraform">
<a href="https://github.com/clouddrove/terraform-azure-subnet/releases/latest">
<img src="https://img.shields.io/github/release/clouddrove/terraform-azure-subnet.svg" alt="Latest Release">
</a>
<a href="https://github.com/clouddrove/terraform-azure-subnet/actions/workflows/tfsec.yml">
<img src="https://github.com/clouddrove/terraform-azure-subnet/actions/workflows/tfsec.yml/badge.svg" alt="tfsec">
</a>
<a href="LICENSE.md">
<img src="https://img.shields.io/badge/License-APACHE-blue.svg" alt="Licence">
Expand All @@ -36,6 +41,12 @@
<hr>


We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.

This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.

We have [*fifty plus terraform modules*][terraform_modules]. A few of them are comepleted and are available for open source usage while a few others are in progress.




Expand All @@ -48,6 +59,7 @@ This module has a few dependencies:



## Examples


**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-azure-subnet/releases).
Expand All @@ -59,18 +71,20 @@ Here is an example of how you can use this module in your inventory structure:
```hcl
module "subnet" {
source = "clouddrove/subnet/azure"
name = "app"
environment = "test"
label_order = ["name", "environment"]
name = local.name
environment = local.environment
label_order = local.label_order
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
virtual_network_name = join("", module.vnet.vnet_name)
#subnet
subnet_names = ["subnet1", "subnet2"]
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24"]
subnet_names = ["subnet1", "subnet2"]
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24"]
# route_table
enable_route_table = true
route_table_name = "default_subnet"
routes = [
{
name = "rt-test"
Expand All @@ -84,9 +98,9 @@ Here is an example of how you can use this module in your inventory structure:
```hcl
module "name_specific_subnet" {
source = "clouddrove/subnet/azure"
name = "app"
environment = "test"
label_order = ["name", "environment"]
name = local.name
environment = local.environment
label_order = local.label_order
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
virtual_network_name = join("", module.vnet.vnet_name)
Expand All @@ -97,6 +111,8 @@ Here is an example of how you can use this module in your inventory structure:
subnet_prefixes = ["10.0.1.0/24"]
# route_table
enable_route_table = true
route_table_name = "name_specific_subnet"
routes = [
{
name = "rt-test"
Expand All @@ -110,19 +126,21 @@ Here is an example of how you can use this module in your inventory structure:
```hcl
module "name_specific_subnet" {
source = "clouddrove/subnet/azure"
name = "app"
environment = "test"
label_order = ["name", "environment"]
name = local.name
environment = local.environment
label_order = local.label_order
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
virtual_network_name = join("", module.vnet.vnet_name)
#subnet
create_nat_gateway = true
subnet_names = ["subnet1", "subnet2"]
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24"]
create_nat_gateway = true
subnet_names = ["subnet1", "subnet2"]
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24"]
# route_table
enable_route_table = true
route_table_name = "nat_gateway"
routes = [
{
name = "rt-test"
Expand All @@ -142,33 +160,34 @@ Here is an example of how you can use this module in your inventory structure:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| attributes | Additional attributes (e.g. `1`). | `list(any)` | `[]` | no |
| allocation\_method | Defines the allocation method for this IP address. Possible values are Static or Dynamic. | `string` | `"Static"` | no |
| create\_nat\_gateway | Flag to control nat gateway creation. | `bool` | `false` | no |
| delegation | Configuration delegations on subnet<br>object({<br> name = object({<br> name = string,<br> actions = list(string)<br> })<br>}) | `map(list(any))` | `{}` | no |
| delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | `string` | `"-"` | no |
| disable\_bgp\_route\_propagation | Boolean flag which controls propagation of routes learned by BGP on that route table. | `bool` | `false` | no |
| enable | Flag to control the module creation | `bool` | `true` | no |
| enable\_route\_table | Flag to control route table creation. | `bool` | `true` | no |
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `""` | no |
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `null` | no |
| label\_order | Label order, e.g. `name`,`application`. | `list(any)` | <pre>[<br> "name",<br> "environment"<br>]</pre> | no |
| location | The location/region where the virtual network is created. Changing this forces a new resource to be created. | `string` | `""` | no |
| location | The location/region where the virtual network is created. Changing this forces a new resource to be created. | `string` | `null` | no |
| managedby | ManagedBy, eg 'CloudDrove'. | `string` | `"hello@clouddrove.com"` | no |
| name | Name (e.g. `app` or `cluster`). | `string` | `""` | no |
| name | Name (e.g. `app` or `cluster`). | `string` | `null` | no |
| nat\_gateway\_idle\_timeout | Idle timeout configuration in minutes for Nat Gateway | `number` | `4` | no |
| public\_ip\_zones | Public ip Zones to configure. | `list(string)` | `null` | no |
| repository | Terraform current module repo | `string` | `"https://github.com/clouddrove/terraform-azure-subnet.git"` | no |
| resource\_group\_name | The name of an existing resource group to be imported. | `string` | `""` | no |
| resource\_group\_name | The name of an existing resource group to be imported. | `string` | `null` | no |
| route\_table\_name | The name of the route table. | `string` | `null` | no |
| routes | List of objects that represent the configuration of each route. | `list(map(string))` | `[]` | no |
| service\_endpoint\_policy\_ids | The list of IDs of Service Endpoint Policies to associate with the subnet. | `list(string)` | `null` | no |
| service\_endpoints | A map with key (string) `subnet name`, value (list(string)) to indicate enabled service endpoints on the subnet. Default value is []. | `list(string)` | `[]` | no |
| specific\_name\_subnet | n/a | `bool` | `false` | no |
| specific\_subnet\_names | A list of subnets inside the vNet. | `string` | `""` | no |
| subnet\_enforce\_private\_link\_endpoint\_network\_policies | A map with key (string) `subnet name`, value (bool) `true` or `false` to indicate enable or disable network policies for the private link endpoint on the subnet. Default value is false. | `map(bool)` | `{}` | no |
| sku | The SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic. Changing this forces a new resource to be created. | `string` | `"Standard"` | no |
| sku\_name | The SKU which should be used. At this time the only supported value is Standard. Defaults to Standard. | `string` | `"Standard"` | no |
| specific\_name\_subnet | fName of the specific subnet. | `bool` | `false` | no |
| specific\_subnet\_names | A list of subnets inside the vNet. | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
| subnet\_enforce\_private\_link\_endpoint\_network\_policies | A map with key (string) `subnet name`, value (bool) `true` or `false` to indicate enable or disable network policies for the private link endpoint on the subnet. Default value is false. | `bool` | `false` | no |
| subnet\_enforce\_private\_link\_service\_network\_policies | A map with key (string) `subnet name`, value (bool) `true` or `false` to indicate enable or disable network policies for the private link endpoint on the subnet. Default value is false. | `bool` | `true` | no |
| subnet\_names | A list of public subnets inside the vNet. | `list(string)` | `[]` | no |
| subnet\_prefixes | The address prefix to use for the subnet. | `list(string)` | `[]` | no |
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map(any)` | `{}` | no |
| virtual\_network\_name | The name of the virtual network in which the subnet is created in | `string` | `""` | no |
| virtual\_network\_name | The name of the virtual network in which the subnet is created in | `string` | `null` | no |
| zones | Public ip Zones to configure. | `list(string)` | `null` | no |

## Outputs

Expand All @@ -183,12 +202,20 @@ Here is an example of how you can use this module in your inventory structure:
| route\_table\_associated\_subnets | The collection of Subnets associated with this route table. |
| route\_table\_id | The Route Table ID. |
| specific\_subnet\_address\_prefixes | The address prefixes for the subnet. |
| specific\_subnet\_id | The subnet ID. |
| specific\_subnet\_id | The name of the subnet. |
| specific\_subnet\_name | The name of the subnet. |




## Testing
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.

You need to run the following command in the testing folder:
```hcl
go test -run Test
```



## Feedback
Expand Down

0 comments on commit 4c40ae5

Please sign in to comment.