diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..b8c30c3 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,4 @@ + +# Example and manual test cases + +Each directory contains a configuration that serves as a manual test case and an example diff --git a/examples/basic/README.md b/examples/basic/README.md new file mode 100644 index 0000000..2660965 --- /dev/null +++ b/examples/basic/README.md @@ -0,0 +1 @@ +# Example: basic usage diff --git a/examples/basic/main.tf b/examples/basic/main.tf new file mode 100644 index 0000000..fdd990a --- /dev/null +++ b/examples/basic/main.tf @@ -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 +} diff --git a/examples/basic/outputs.tf b/examples/basic/outputs.tf new file mode 100644 index 0000000..e085c38 --- /dev/null +++ b/examples/basic/outputs.tf @@ -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}" +} diff --git a/examples/basic/providers.tf b/examples/basic/providers.tf new file mode 100644 index 0000000..31dd57a --- /dev/null +++ b/examples/basic/providers.tf @@ -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 +} diff --git a/examples/basic/variable.tf b/examples/basic/variable.tf new file mode 100644 index 0000000..81b8dbe --- /dev/null +++ b/examples/basic/variable.tf @@ -0,0 +1,3 @@ +variable "region" { + default = "us-west-2" +} diff --git a/examples/disabled/README.md b/examples/disabled/README.md new file mode 100644 index 0000000..dbee7cc --- /dev/null +++ b/examples/disabled/README.md @@ -0,0 +1 @@ +# Example: module disabled diff --git a/examples/disabled/main.tf b/examples/disabled/main.tf new file mode 100644 index 0000000..9a1e0a8 --- /dev/null +++ b/examples/disabled/main.tf @@ -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 +} diff --git a/examples/disabled/outputs.tf b/examples/disabled/outputs.tf new file mode 100644 index 0000000..e085c38 --- /dev/null +++ b/examples/disabled/outputs.tf @@ -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}" +} diff --git a/examples/disabled/providers.tf b/examples/disabled/providers.tf new file mode 100644 index 0000000..31dd57a --- /dev/null +++ b/examples/disabled/providers.tf @@ -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 +} diff --git a/examples/disabled/variable.tf b/examples/disabled/variable.tf new file mode 100644 index 0000000..81b8dbe --- /dev/null +++ b/examples/disabled/variable.tf @@ -0,0 +1,3 @@ +variable "region" { + default = "us-west-2" +}