Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
GMafra authored Apr 18, 2018
1 parent 7d60798 commit 26781cb
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
# terraform-gcp-subnet
## Subnetwork module for Google Cloud Platform

Creates and manages Subnetworks within a VPC on GCP

**Basic usage**

```hcl
module subnet-module {
source = "/Users/Gabriel/Terraform/GCP/modules/subnet-module"
name = "tf-subnet"
vpc = "tf-vpc"
ip_cidr_range = "10.0.1.0/24"
}
```
It can also be used in conjunction with my VPC module to create VPC + Subnet

```hcl
module vpc-module {
source = "[email protected]:GMafra/GCP-modules.git//vpc-module"
name = "tf-vpc"
}
module subnet-module {
source = "[email protected]:GMafra/GCP-modules.git//subnet-module"
name = "tf-subnet"
vpc = "${module.vpc-module.name}"
ip_cidr_range = "10.0.1.0/24"
}
```
## Variables
|Name|Description|Type|Default|Required|
|----|-----------|:----:|:-------:|:--------:|
|name|Subnet name|String| - |Yes|
|vpc|VPC to link the subnet to|String| - |Yes|
|subnet-region|Zone associated with the subnet. Defaults to the region configured in the provider|String| - |No|
|ip_cidr_range|IP range address - format 0.0.0.0/0|String| - |Yes|

## Outputs

|Name|Description|
|----|-----------|
|name|Subnetwork name|
|gateway_address|The IP address of the gateway|
|self_link|The URI of the created resource|
|ip_cidr_range|The IP address range that machines in this network are assigned to, represented as a CIDR block

### Reference
- [Terraform GCP Subnetwork](https://www.terraform.io/docs/providers/google/d/datasource_compute_subnetwork.html)
- [Terraform Modules](https://www.terraform.io/docs/modules/usage.html)
- [Terraform Interpolation](https://www.terraform.io/docs/configuration/interpolation.html)

0 comments on commit 26781cb

Please sign in to comment.