Skip to content

Commit 130275e

Browse files
author
Sol Rosenberg
authored
Merge pull request #4 from solsglasses/readme_jan2019
Update README
2 parents 1348758 + 0260bab commit 130275e

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@ A terraform module that takes a simple approach to setting up a VPC with all the
1010
1. Create two NAT Gateways and assign them to subnets on an odd/even basis for multi-AZ.
1111
1. Resists the temptation to allow for snowflake customization features like VPC Peering, VPN routing, DHCP Options, etc. Keep it simple, when possible.
1212

13+
## Usage
14+
15+
##### Launch an EC2 instance into a single subnet
16+
17+
```terraform
18+
resource "aws_instance" "web" {
19+
ami = "${data.aws_ami.ubuntu.id}"
20+
instance_type = "t2.micro"
21+
vpc_security_group_ids = ["${module.vpc.default_security_group"]
22+
subnet_id = "${element(module.vpc.private_subnet_ids["private"],0)}"
23+
}
24+
```
25+
26+
##### Launch an ELB into multiple subnets
27+
```terraform
28+
resource "aws_lb" "test" {
29+
name = "test-lb-tf"
30+
internal = false
31+
load_balancer_type = "application"
32+
security_groups = ["${module.vpc.default_security_group"]
33+
subnets = ["${module.vpc.public_subnet_ids["public"]}"]
34+
}
35+
```
36+
1337
## Outputs
1438

1539
Supported module outputs are:
@@ -18,17 +42,12 @@ Supported module outputs are:
1842
1. `public_subnet_ids` (map)
1943
1. `vpc_id` (string)
2044

21-
Example of using subnet ID map, assuming you called it via the name `module "vpc" {}`:
22-
```terraform
23-
resource "aws_autoscaling_group" "main" {
24-
name = "foobar3-terraform-test"
25-
26-
...omitted...
27-
vpc_zone_identifier = [ "${module.vpc.private_subnet_ids["app"]}" ]
28-
}
45+
Example console output with these custom variables defined:
46+
```
47+
private_subnet_nametags = ["app1", "app2", "db"]
48+
public_subnet_nametags = ["lb", "bastion"]
2949
```
3050

31-
Example console output:
3251
```
3352
default_security_group_id = sg-286b0e60
3453
private_subnet_ids = {

0 commit comments

Comments
 (0)