Skip to content

Commit eed35f4

Browse files
author
Steven Nemetz
committed
Rework test cases to examples
1 parent d2bfdbb commit eed35f4

File tree

11 files changed

+169
-0
lines changed

11 files changed

+169
-0
lines changed

examples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# Example and manual test cases
3+
4+
Each directory contains a configuration that serves as a manual test case and an example

examples/basic/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Example: basic usage

examples/basic/main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Lookup DNS zone, vpc, subnets
2+
3+
module "efs" {
4+
source = "../../"
5+
name = "efs-vol"
6+
environment = "testing"
7+
organization = ""
8+
zone_id = "ZURF67XJUWC5A" # one
9+
security_groups = []
10+
ingress_cidr = ["10.0.0.0/8"]
11+
subnets = ["subnet-857efce3", "subnet-0852f140", "subnet-6395c038"]
12+
vpc_id = "vpc-417c0027" # one
13+
}

examples/basic/outputs.tf

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// EFS File System outputs
2+
output "dns_name" {
3+
description = "FQDN of the EFS volume"
4+
value = "${module.efs.dns_name}"
5+
}
6+
7+
output "id" {
8+
description = "ID of EFS"
9+
value = "${module.efs.id}"
10+
}
11+
12+
output "kms_key_id" {
13+
description = ""
14+
value = "${module.efs.kms_key_id}"
15+
}
16+
17+
output "name" {
18+
description = "Service name that was passed in. This is to make creating mount points easier"
19+
value = "${module.efs.name}"
20+
}
21+
22+
// EFS Mount Target outputs
23+
/*
24+
# Same as EFS mount_target_dns_names
25+
output "mount_target_dns_names" {
26+
description = "List of DNS names of the EFS mount targets"
27+
value = ["${aws_efs_mount_target.default.*.dns_name}"]
28+
}
29+
*/
30+
output "mount_target_ids" {
31+
description = "List of IDs of the EFS mount targets"
32+
value = "${module.efs.mount_target_ids}"
33+
}
34+
35+
output "mount_target_ips" {
36+
description = "List of IPs of the EFS mount targets"
37+
value = "${module.efs.mount_target_ips}"
38+
}
39+
40+
output "mount_target_net_intf_ids" {
41+
description = "List of network interface IDs of the EFS mount targets"
42+
value = "${module.efs.mount_target_net_intf_ids}"
43+
}
44+
45+
// Other resources
46+
output "security_group" {
47+
description = ""
48+
value = "${module.efs.security_group}"
49+
}
50+
51+
// Submodules output
52+
output "host" {
53+
description = "Assigned DNS-record for the EFS"
54+
value = "${module.efs.host}"
55+
}

examples/basic/providers.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
provider "aws" {
2+
region = "${var.region}"
3+
4+
# Make it faster by skipping something
5+
skip_get_ec2_platforms = true
6+
skip_metadata_api_check = true
7+
skip_region_validation = true
8+
skip_credentials_validation = true
9+
skip_requesting_account_id = true
10+
}

examples/basic/variable.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+
}

examples/disabled/README.md

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

examples/disabled/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Lookup DNS zone, vpc, subnets
2+
3+
module "efs" {
4+
source = "../../"
5+
name = "efs-vol-disabled"
6+
environment = "testing"
7+
organization = ""
8+
zone_id = "ZURF67XJUWC5A" # one
9+
security_groups = []
10+
ingress_cidr = ["10.0.0.0/8"]
11+
subnets = ["subnet-857efce3", "subnet-0852f140", "subnet-6395c038"]
12+
vpc_id = "vpc-417c0027" # one
13+
enabled = false
14+
}

examples/disabled/outputs.tf

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// EFS File System outputs
2+
output "dns_name" {
3+
description = "FQDN of the EFS volume"
4+
value = "${module.efs.dns_name}"
5+
}
6+
7+
output "id" {
8+
description = "ID of EFS"
9+
value = "${module.efs.id}"
10+
}
11+
12+
output "kms_key_id" {
13+
description = ""
14+
value = "${module.efs.kms_key_id}"
15+
}
16+
17+
output "name" {
18+
description = "Service name that was passed in. This is to make creating mount points easier"
19+
value = "${module.efs.name}"
20+
}
21+
22+
// EFS Mount Target outputs
23+
/*
24+
# Same as EFS mount_target_dns_names
25+
output "mount_target_dns_names" {
26+
description = "List of DNS names of the EFS mount targets"
27+
value = ["${aws_efs_mount_target.default.*.dns_name}"]
28+
}
29+
*/
30+
output "mount_target_ids" {
31+
description = "List of IDs of the EFS mount targets"
32+
value = "${module.efs.mount_target_ids}"
33+
}
34+
35+
output "mount_target_ips" {
36+
description = "List of IPs of the EFS mount targets"
37+
value = "${module.efs.mount_target_ips}"
38+
}
39+
40+
output "mount_target_net_intf_ids" {
41+
description = "List of network interface IDs of the EFS mount targets"
42+
value = "${module.efs.mount_target_net_intf_ids}"
43+
}
44+
45+
// Other resources
46+
output "security_group" {
47+
description = ""
48+
value = "${module.efs.security_group}"
49+
}
50+
51+
// Submodules output
52+
output "host" {
53+
description = "Assigned DNS-record for the EFS"
54+
value = "${module.efs.host}"
55+
}

examples/disabled/providers.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
provider "aws" {
2+
region = "${var.region}"
3+
4+
# Make it faster by skipping something
5+
skip_get_ec2_platforms = true
6+
skip_metadata_api_check = true
7+
skip_region_validation = true
8+
skip_credentials_validation = true
9+
skip_requesting_account_id = true
10+
}

0 commit comments

Comments
 (0)