Skip to content

Commit

Permalink
Rework test cases to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Nemetz committed May 16, 2018
1 parent d2bfdbb commit eed35f4
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Example and manual test cases

Each directory contains a configuration that serves as a manual test case and an example
1 change: 1 addition & 0 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Example: basic usage
13 changes: 13 additions & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Lookup DNS zone, vpc, subnets

module "efs" {
source = "../../"
name = "efs-vol"
environment = "testing"
organization = ""
zone_id = "ZURF67XJUWC5A" # one
security_groups = []
ingress_cidr = ["10.0.0.0/8"]
subnets = ["subnet-857efce3", "subnet-0852f140", "subnet-6395c038"]
vpc_id = "vpc-417c0027" # one
}
55 changes: 55 additions & 0 deletions examples/basic/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// EFS File System outputs
output "dns_name" {
description = "FQDN of the EFS volume"
value = "${module.efs.dns_name}"
}

output "id" {
description = "ID of EFS"
value = "${module.efs.id}"
}

output "kms_key_id" {
description = ""
value = "${module.efs.kms_key_id}"
}

output "name" {
description = "Service name that was passed in. This is to make creating mount points easier"
value = "${module.efs.name}"
}

// EFS Mount Target outputs
/*
# Same as EFS mount_target_dns_names
output "mount_target_dns_names" {
description = "List of DNS names of the EFS mount targets"
value = ["${aws_efs_mount_target.default.*.dns_name}"]
}
*/
output "mount_target_ids" {
description = "List of IDs of the EFS mount targets"
value = "${module.efs.mount_target_ids}"
}

output "mount_target_ips" {
description = "List of IPs of the EFS mount targets"
value = "${module.efs.mount_target_ips}"
}

output "mount_target_net_intf_ids" {
description = "List of network interface IDs of the EFS mount targets"
value = "${module.efs.mount_target_net_intf_ids}"
}

// Other resources
output "security_group" {
description = ""
value = "${module.efs.security_group}"
}

// Submodules output
output "host" {
description = "Assigned DNS-record for the EFS"
value = "${module.efs.host}"
}
10 changes: 10 additions & 0 deletions examples/basic/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
provider "aws" {
region = "${var.region}"

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}
3 changes: 3 additions & 0 deletions examples/basic/variable.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "region" {
default = "us-west-2"
}
1 change: 1 addition & 0 deletions examples/disabled/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Example: module disabled
14 changes: 14 additions & 0 deletions examples/disabled/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Lookup DNS zone, vpc, subnets

module "efs" {
source = "../../"
name = "efs-vol-disabled"
environment = "testing"
organization = ""
zone_id = "ZURF67XJUWC5A" # one
security_groups = []
ingress_cidr = ["10.0.0.0/8"]
subnets = ["subnet-857efce3", "subnet-0852f140", "subnet-6395c038"]
vpc_id = "vpc-417c0027" # one
enabled = false
}
55 changes: 55 additions & 0 deletions examples/disabled/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// EFS File System outputs
output "dns_name" {
description = "FQDN of the EFS volume"
value = "${module.efs.dns_name}"
}

output "id" {
description = "ID of EFS"
value = "${module.efs.id}"
}

output "kms_key_id" {
description = ""
value = "${module.efs.kms_key_id}"
}

output "name" {
description = "Service name that was passed in. This is to make creating mount points easier"
value = "${module.efs.name}"
}

// EFS Mount Target outputs
/*
# Same as EFS mount_target_dns_names
output "mount_target_dns_names" {
description = "List of DNS names of the EFS mount targets"
value = ["${aws_efs_mount_target.default.*.dns_name}"]
}
*/
output "mount_target_ids" {
description = "List of IDs of the EFS mount targets"
value = "${module.efs.mount_target_ids}"
}

output "mount_target_ips" {
description = "List of IPs of the EFS mount targets"
value = "${module.efs.mount_target_ips}"
}

output "mount_target_net_intf_ids" {
description = "List of network interface IDs of the EFS mount targets"
value = "${module.efs.mount_target_net_intf_ids}"
}

// Other resources
output "security_group" {
description = ""
value = "${module.efs.security_group}"
}

// Submodules output
output "host" {
description = "Assigned DNS-record for the EFS"
value = "${module.efs.host}"
}
10 changes: 10 additions & 0 deletions examples/disabled/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
provider "aws" {
region = "${var.region}"

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}
3 changes: 3 additions & 0 deletions examples/disabled/variable.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "region" {
default = "us-west-2"
}

0 comments on commit eed35f4

Please sign in to comment.