Skip to content

Commit fa5327c

Browse files
author
Steven Nemetz
committed
Start reworking manual test cases as examples
1 parent 2bc8f91 commit fa5327c

27 files changed

+869
-513
lines changed

examples/disabled/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Module disabled

examples/disabled/main.tf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
data "aws_vpc" "vpc" {
2+
tags {
3+
Env = "one"
4+
}
5+
}
6+
7+
# Look up security group
8+
data "aws_subnet_ids" "public_subnet_ids" {
9+
vpc_id = "${data.aws_vpc.vpc.id}"
10+
11+
tags {
12+
Network = "Public"
13+
}
14+
}
15+
16+
data "aws_subnet_ids" "private_subnet_ids" {
17+
vpc_id = "${data.aws_vpc.vpc.id}"
18+
19+
tags {
20+
Network = "Private"
21+
}
22+
}
23+
24+
module "disabled" {
25+
source = "../../"
26+
name = "lb-disabled"
27+
environment = "one"
28+
organization = "wiser"
29+
enabled = false
30+
instance_http_ports = "80,8080"
31+
instance_https_ports = "443"
32+
instance_tcp_ports = ""
33+
lb_http_ports = "80,8080"
34+
lb_https_ports = "443"
35+
lb_protocols = ["HTTP", "HTTPS"]
36+
lb_tcp_ports = ""
37+
ports = "3000,4000"
38+
security_groups = ["sg-bef0a5c2"] # Need at least 1
39+
subnets = "${data.aws_subnet_ids.private_subnet_ids.ids}"
40+
vpc_id = "${data.aws_vpc.vpc.id}"
41+
}

examples/disabled/outputs.tf

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
//
2+
// LB attributes
3+
//
4+
output "arn" {
5+
description = "ARN of the LB itself. Useful for debug output, for example when attaching a WAF."
6+
value = "${module.disabled.arn}"
7+
}
8+
9+
output "dns_name" {
10+
description = "The DNS name of the LB presumably to be used with a friendlier CNAME."
11+
value = "${module.disabled.dns_name}"
12+
}
13+
14+
output "id" {
15+
description = "The ID of the LB we created."
16+
value = "${module.disabled.id}"
17+
}
18+
19+
output "zone_id" {
20+
description = "The zone_id of the LB to assist with creating DNS records."
21+
value = "${module.disabled.zone_id}"
22+
}
23+
24+
# arn_suffix
25+
# canonical_hosted_zone_id
26+
27+
//
28+
// LB Listener attributes
29+
//
30+
output "listener_http_arns" {
31+
description = "The ARNs of the HTTP LB Listeners"
32+
value = "${module.disabled.listener_http_arns}"
33+
}
34+
35+
output "listener_http_ids" {
36+
description = "The IDs of the HTTP LB Listeners"
37+
value = "${module.disabled.listener_http_ids}"
38+
}
39+
40+
output "listener_https_arns" {
41+
description = "The ARNs of the HTTPS LB Listeners"
42+
value = "${module.disabled.listener_https_arns}"
43+
}
44+
45+
output "listener_https_ids" {
46+
description = "The IDs of the HTTPS LB Listeners"
47+
value = "${module.disabled.listener_https_ids}"
48+
}
49+
50+
output "listener_tcp_arns" {
51+
description = "The ARNs of the network TCP LB Listeners"
52+
value = "${module.disabled.listener_tcp_arns}"
53+
}
54+
55+
output "listener_tcp_ids" {
56+
description = "The IDs of the network TCP LB Listeners"
57+
value = "${module.disabled.listener_tcp_ids}"
58+
}
59+
60+
output "listener_arns" {
61+
description = "ARNs of all the LB Listeners"
62+
value = "${module.disabled.listener_arns}"
63+
}
64+
65+
output "listener_ids" {
66+
description = "IDs of all the LB Listeners"
67+
value = "${module.disabled.listener_ids}"
68+
}
69+
70+
//
71+
// LB Target Group attributes
72+
//
73+
output "target_group_http_arns" {
74+
description = "ARNs of the HTTP target groups. Useful for passing to your Auto Scaling group module."
75+
value = "${module.disabled.target_group_http_arns}"
76+
}
77+
78+
output "target_group_https_arns" {
79+
description = "ARNs of the HTTPS target groups. Useful for passing to your Auto Scaling group module."
80+
value = "${module.disabled.target_group_https_arns}"
81+
}
82+
83+
output "target_group_tcp_arns" {
84+
description = "ARNs of the TCP target groups. Useful for passing to your Auto Scaling group module."
85+
value = "${module.disabled.target_group_tcp_arns}"
86+
}
87+
88+
output "target_group_arns" {
89+
description = "ARNs of all the target groups. Useful for passing to your Auto Scaling group module."
90+
value = "${module.disabled.target_group_arns}"
91+
}
92+
93+
output "target_group_http_ids" {
94+
description = "IDs of the HTTP target groups"
95+
value = "${module.disabled.target_group_http_ids}"
96+
}
97+
98+
output "target_group_https_ids" {
99+
description = "IDs of the HTTPS target groups"
100+
value = "${module.disabled.target_group_https_ids}"
101+
}
102+
103+
output "target_group_tcp_ids" {
104+
description = "IDs of the TCP target groups"
105+
value = "${module.disabled.target_group_tcp_ids}"
106+
}
107+
108+
output "target_group_ids" {
109+
description = "IDs of all the target groups"
110+
value = "${module.disabled.target_group_ids}"
111+
}
112+
113+
# arn_suffix
114+
# name
115+
116+
//
117+
// Misc
118+
//
119+
output "principal_account_id" {
120+
description = "The AWS-owned account given permissions to write your LB logs to S3."
121+
value = "${module.disabled.principal_account_id}"
122+
}
File renamed without changes.
File renamed without changes.

examples/http/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ALB using HTTP

examples/http/main.tf

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
data "aws_vpc" "vpc" {
2+
tags {
3+
Env = "one"
4+
}
5+
}
6+
7+
# Look up security group
8+
data "aws_subnet_ids" "public_subnet_ids" {
9+
vpc_id = "${data.aws_vpc.vpc.id}"
10+
11+
tags {
12+
Network = "Public"
13+
}
14+
}
15+
16+
data "aws_subnet_ids" "private_subnet_ids" {
17+
vpc_id = "${data.aws_vpc.vpc.id}"
18+
19+
tags {
20+
Network = "Private"
21+
}
22+
}
23+
24+
module "lb-http" {
25+
source = "../../"
26+
name = "lb-http"
27+
environment = "one"
28+
organization = "wiser"
29+
30+
#enable_deletion_protection = true
31+
#enable_http2 = false
32+
instance_http_ports = "80,8080"
33+
34+
instance_https_ports = ""
35+
instance_tcp_ports = ""
36+
lb_http_ports = "80,8080"
37+
lb_https_ports = ""
38+
lb_protocols = ["HTTP"]
39+
lb_tcp_ports = ""
40+
ports = "3000,4000"
41+
security_groups = ["sg-bef0a5c2"] # Need at least 1
42+
subnets = "${data.aws_subnet_ids.private_subnet_ids.ids}"
43+
vpc_id = "${data.aws_vpc.vpc.id}"
44+
}

examples/http/outputs.tf

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
//
2+
// LB attributes
3+
//
4+
output "arn" {
5+
description = "ARN of the LB itself. Useful for debug output, for example when attaching a WAF."
6+
value = "${module.lb-http.arn}"
7+
}
8+
9+
output "dns_name" {
10+
description = "The DNS name of the LB presumably to be used with a friendlier CNAME."
11+
value = "${module.lb-http.dns_name}"
12+
}
13+
14+
output "id" {
15+
description = "The ID of the LB we created."
16+
value = "${module.lb-http.id}"
17+
}
18+
19+
output "zone_id" {
20+
description = "The zone_id of the LB to assist with creating DNS records."
21+
value = "${module.lb-http.zone_id}"
22+
}
23+
24+
# arn_suffix
25+
# canonical_hosted_zone_id
26+
27+
//
28+
// LB Listener attributes
29+
//
30+
output "listener_http_arns" {
31+
description = "The ARNs of the HTTP LB Listeners"
32+
value = "${module.lb-http.listener_http_arns}"
33+
}
34+
35+
output "listener_http_ids" {
36+
description = "The IDs of the HTTP LB Listeners"
37+
value = "${module.lb-http.listener_http_ids}"
38+
}
39+
40+
output "listener_https_arns" {
41+
description = "The ARNs of the HTTPS LB Listeners"
42+
value = "${module.lb-http.listener_https_arns}"
43+
}
44+
45+
output "listener_https_ids" {
46+
description = "The IDs of the HTTPS LB Listeners"
47+
value = "${module.lb-http.listener_https_ids}"
48+
}
49+
50+
output "listener_tcp_arns" {
51+
description = "The ARNs of the network TCP LB Listeners"
52+
value = "${module.lb-http.listener_tcp_arns}"
53+
}
54+
55+
output "listener_tcp_ids" {
56+
description = "The IDs of the network TCP LB Listeners"
57+
value = "${module.lb-http.listener_tcp_ids}"
58+
}
59+
60+
output "listener_arns" {
61+
description = "ARNs of all the LB Listeners"
62+
value = "${module.lb-http.listener_arns}"
63+
}
64+
65+
output "listener_ids" {
66+
description = "IDs of all the LB Listeners"
67+
value = "${module.lb-http.listener_ids}"
68+
}
69+
70+
//
71+
// LB Target Group attributes
72+
//
73+
output "target_group_http_arns" {
74+
description = "ARNs of the HTTP target groups. Useful for passing to your Auto Scaling group module."
75+
value = "${module.lb-http.target_group_http_arns}"
76+
}
77+
78+
output "target_group_https_arns" {
79+
description = "ARNs of the HTTPS target groups. Useful for passing to your Auto Scaling group module."
80+
value = "${module.lb-http.target_group_https_arns}"
81+
}
82+
83+
output "target_group_tcp_arns" {
84+
description = "ARNs of the TCP target groups. Useful for passing to your Auto Scaling group module."
85+
value = "${module.lb-http.target_group_tcp_arns}"
86+
}
87+
88+
output "target_group_arns" {
89+
description = "ARNs of all the target groups. Useful for passing to your Auto Scaling group module."
90+
value = "${module.lb-http.target_group_arns}"
91+
}
92+
93+
output "target_group_http_ids" {
94+
description = "IDs of the HTTP target groups"
95+
value = "${module.lb-http.target_group_http_ids}"
96+
}
97+
98+
output "target_group_https_ids" {
99+
description = "IDs of the HTTPS target groups"
100+
value = "${module.lb-http.target_group_https_ids}"
101+
}
102+
103+
output "target_group_tcp_ids" {
104+
description = "IDs of the TCP target groups"
105+
value = "${module.lb-http.target_group_tcp_ids}"
106+
}
107+
108+
output "target_group_ids" {
109+
description = "IDs of all the target groups"
110+
value = "${module.lb-http.target_group_ids}"
111+
}
112+
113+
# arn_suffix
114+
# name
115+
116+
//
117+
// Misc
118+
//
119+
output "principal_account_id" {
120+
description = "The AWS-owned account given permissions to write your LB logs to S3."
121+
value = "${module.lb-http.principal_account_id}"
122+
}

examples/http/providers.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "aws" {
2+
region = "${var.region}"
3+
4+
#version = "1.5"
5+
}

examples/http/variables.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "region" {
2+
default = "us-west-2"
3+
}

0 commit comments

Comments
 (0)