Skip to content

Commit

Permalink
Fix outputs (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh authored Jan 25, 2019
1 parent 70c53a0 commit f4c8c73
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 102 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ install:
- make init

script:
- make terraform:install
- make terraform:get-plugins
- make terraform:get-modules
- make terraform:lint
- make terraform:validate
- make terraform/install
- make terraform/get-plugins
- make terraform/get-modules
- make terraform/lint
- make terraform/validate
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2017-2018 Cloud Posse, LLC
Copyright 2017-2019 Cloud Posse, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
55 changes: 29 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ Include this repository as a module in your existing terraform code:
```hcl
module "efs" {
source = "git::https://github.com/cloudposse/terraform-aws-efs.git?ref=master"
namespace = "global"
name = "app"
namespace = "eg"
stage = "prod"
name = "app"
attributes = ["efs"]
aws_region = "${var.aws_region}"
vpc_id = "${var.vpc_id}"
subnets = "${var.private_subnets}"
subnets = ["${var.private_subnets}"]
availability_zones = ["${var.availability_zones}"]
security_groups = ["${var.security_group_id}"]
Expand All @@ -77,42 +77,41 @@ Available targets:
lint Lint terraform code
```

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| attributes | Additional attributes (e.g. `policy` or `role`) | list | `<list>` | no |
| attributes | Additional attributes (e.g. `1`) | list | `<list>` | no |
| availability_zones | Availability Zone IDs | list | - | yes |
| aws_region | AWS region ID | string | - | yes |
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| aws_region | AWS Region | string | - | yes |
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | string | `-` | no |
| enabled | Set to false to prevent the module from creating any resources | string | `true` | no |
| encrypted | If true, the disk will be encrypted. | string | `false` | no |
| mount_target_ip_address | The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target. | string | `` | no |
| name | Name (_e.g._ `app` or `wordpress`) | string | `app` | no |
| namespace | Namespace (_e.g._ `eg` or `cp`) | string | `global` | no |
| encrypted | If true, the disk will be encrypted | string | `false` | no |
| mount_target_ip_address | The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target | string | `` | no |
| name | Name (_e.g._ `app`) | string | `app` | no |
| namespace | Namespace (_e.g._ `eg` or `cp`) | string | `eg` | no |
| performance_mode | The file system performance mode. Can be either `generalPurpose` or `maxIO` | string | `generalPurpose` | no |
| provisioned_throughput_in_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode set to provisioned. | string | `0` | no |
| security_groups | AWS security group IDs to allow to connect to the EFS | list | - | yes |
| provisioned_throughput_in_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode set to provisioned | string | `0` | no |
| security_groups | Security group IDs to allow access to the EFS | list | - | yes |
| stage | Stage (_e.g._ `prod`, `dev`, `staging`) | string | `default` | no |
| subnets | AWS subnet IDs | list | - | yes |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | map | `<map>` | no |
| throughput_mode | Throughput mode for the file system. Defaults to bursting. Valid values: bursting, provisioned. When using provisioned, also set provisioned_throughput_in_mibps. | string | `bursting` | no |
| vpc_id | AWS VPC ID | string | - | yes |
| zone_id | Route53 dns zone ID | string | `` | no |
| subnets | Subnet IDs | list | - | yes |
| tags | Additional tags (e.g. `{ BusinessUnit = "XYZ" }` | map | `<map>` | no |
| throughput_mode | Throughput mode for the file system. Defaults to bursting. Valid values: bursting, provisioned. When using provisioned, also set provisioned_throughput_in_mibps | string | `bursting` | no |
| vpc_id | VPC ID | string | - | yes |
| zone_id | Route53 DNS zone ID | string | `` | no |

## Outputs

| Name | Description |
|------|-------------|
| arn | EFS ARN |
| dns_name | DNS name |
| host | Assigned DNS-record for the EFS |
| dns_name | EFS DNS name |
| host | Route53 DNS hostname for the EFS |
| id | EFS ID |
| mount_target_dns_names | List of DNS names for the given subnet/AZ per documented convention |
| mount_target_ids | List of IDs of the EFS mount targets (one per Availability Zone) |
| mount_target_ips | List of IPs of the EFS mount targets (one per Availability Zone) |
| network_interface_ids | The IDs of the network interface that Amazon EFS created when it created the mount target |
| mount_target_dns_names | List of EFS mount target DNS names |
| mount_target_ids | List of EFS mount target IDs (one per Availability Zone) |
| mount_target_ips | List of EFS mount target IPs (one per Availability Zone) |
| network_interface_ids | List of mount target network interface IDs |



Expand Down Expand Up @@ -250,9 +249,11 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

### Contributors

| [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sergey Vasilyev][s2504s_avatar]][s2504s_homepage]<br/>[Sergey Vasilyev][s2504s_homepage] | [![Mike Eirih][maokomioko_avatar]][maokomioko_homepage]<br/>[Mike Eirih][maokomioko_homepage] |
|---|---|---|---|
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sergey Vasilyev][s2504s_avatar]][s2504s_homepage]<br/>[Sergey Vasilyev][s2504s_homepage] | [![Mike Eirih][maokomioko_avatar]][maokomioko_homepage]<br/>[Mike Eirih][maokomioko_homepage] | [![Josh Myers][joshmyers_avatar]][joshmyers_homepage]<br/>[Josh Myers][joshmyers_homepage] |
|---|---|---|---|---|---|

[osterman_homepage]: https://github.com/osterman
[osterman_avatar]: https://github.com/osterman.png?size=150
[goruha_homepage]: https://github.com/goruha
[goruha_avatar]: https://github.com/goruha.png?size=150
[aknysh_homepage]: https://github.com/aknysh
Expand All @@ -261,6 +262,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[s2504s_avatar]: https://github.com/s2504s.png?size=150
[maokomioko_homepage]: https://github.com/maokomioko
[maokomioko_avatar]: https://github.com/maokomioko.png?size=150
[joshmyers_homepage]: https://github.com/joshmyers
[joshmyers_avatar]: https://github.com/joshmyers.png?size=150



Expand Down
13 changes: 9 additions & 4 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ related:
- name: "terraform-aws-efs-cloudwatch-sns-alarms"
description: "Terraform module that configures CloudWatch SNS alerts for EFS"
url: "https://github.com/cloudposse/terraform-aws-efs-cloudwatch-sns-alarms"

# Short description of this project
description: |-
Terraform module to provision an AWS [`EFS`](https://aws.amazon.com/efs/) Network File System.
Expand All @@ -59,14 +60,14 @@ usage: |-
```hcl
module "efs" {
source = "git::https://github.com/cloudposse/terraform-aws-efs.git?ref=master"
namespace = "global"
name = "app"
namespace = "eg"
stage = "prod"
name = "app"
attributes = ["efs"]
aws_region = "${var.aws_region}"
vpc_id = "${var.vpc_id}"
subnets = "${var.private_subnets}"
subnets = ["${var.private_subnets}"]
availability_zones = ["${var.availability_zones}"]
security_groups = ["${var.security_group_id}"]
Expand All @@ -80,11 +81,15 @@ include:

# Contributors to this project
contributors:
- name: "Erik Osterman"
github: "osterman"
- name: "Igor Rodionov"
github: "goruha"
- name: "Andriy Knysh"
github: "aknysh"
- name: "Sergey Vasilyev"
github: "s2504s"
- name: "Mike Eirih"
github: "maokomioko"
github: "maokomioko"
- name: "Josh Myers"
github: "joshmyers"
41 changes: 20 additions & 21 deletions docs/terraform.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| attributes | Additional attributes (e.g. `policy` or `role`) | list | `<list>` | no |
| attributes | Additional attributes (e.g. `1`) | list | `<list>` | no |
| availability_zones | Availability Zone IDs | list | - | yes |
| aws_region | AWS region ID | string | - | yes |
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| aws_region | AWS Region | string | - | yes |
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | string | `-` | no |
| enabled | Set to false to prevent the module from creating any resources | string | `true` | no |
| encrypted | If true, the disk will be encrypted. | string | `false` | no |
| mount_target_ip_address | The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target. | string | `` | no |
| name | Name (_e.g._ `app` or `wordpress`) | string | `app` | no |
| namespace | Namespace (_e.g._ `eg` or `cp`) | string | `global` | no |
| encrypted | If true, the disk will be encrypted | string | `false` | no |
| mount_target_ip_address | The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target | string | `` | no |
| name | Name (_e.g._ `app`) | string | `app` | no |
| namespace | Namespace (_e.g._ `eg` or `cp`) | string | `eg` | no |
| performance_mode | The file system performance mode. Can be either `generalPurpose` or `maxIO` | string | `generalPurpose` | no |
| provisioned_throughput_in_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode set to provisioned. | string | `0` | no |
| security_groups | AWS security group IDs to allow to connect to the EFS | list | - | yes |
| provisioned_throughput_in_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode set to provisioned | string | `0` | no |
| security_groups | Security group IDs to allow access to the EFS | list | - | yes |
| stage | Stage (_e.g._ `prod`, `dev`, `staging`) | string | `default` | no |
| subnets | AWS subnet IDs | list | - | yes |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | map | `<map>` | no |
| throughput_mode | Throughput mode for the file system. Defaults to bursting. Valid values: bursting, provisioned. When using provisioned, also set provisioned_throughput_in_mibps. | string | `bursting` | no |
| vpc_id | AWS VPC ID | string | - | yes |
| zone_id | Route53 dns zone ID | string | `` | no |
| subnets | Subnet IDs | list | - | yes |
| tags | Additional tags (e.g. `{ BusinessUnit = "XYZ" }` | map | `<map>` | no |
| throughput_mode | Throughput mode for the file system. Defaults to bursting. Valid values: bursting, provisioned. When using provisioned, also set provisioned_throughput_in_mibps | string | `bursting` | no |
| vpc_id | VPC ID | string | - | yes |
| zone_id | Route53 DNS zone ID | string | `` | no |

## Outputs

| Name | Description |
|------|-------------|
| arn | EFS ARN |
| dns_name | DNS name |
| host | Assigned DNS-record for the EFS |
| dns_name | EFS DNS name |
| host | Route53 DNS hostname for the EFS |
| id | EFS ID |
| mount_target_dns_names | List of DNS names for the given subnet/AZ per documented convention |
| mount_target_ids | List of IDs of the EFS mount targets (one per Availability Zone) |
| mount_target_ips | List of IPs of the EFS mount targets (one per Availability Zone) |
| network_interface_ids | The IDs of the network interface that Amazon EFS created when it created the mount target |
| mount_target_dns_names | List of EFS mount target DNS names |
| mount_target_ids | List of EFS mount target IDs (one per Availability Zone) |
| mount_target_ips | List of EFS mount target IPs (one per Availability Zone) |
| network_interface_ids | List of mount target network interface IDs |

2 changes: 1 addition & 1 deletion example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module "efs" {
aws_region = "${var.region}"
availability_zones = ["${var.availability_zones}"]
security_groups = ["${var.security_groups}"]
subnets = "${var.subnets}"
subnets = ["${var.subnets}"]
zone_id = "${var.zone_id}"
vpc_id = "${var.vpc_id}"

Expand Down
53 changes: 40 additions & 13 deletions example/variables.tf
Original file line number Diff line number Diff line change
@@ -1,38 +1,65 @@
variable "region" {
default = "us-east-1"
type = "string"
description = "AWS region"
default = "us-east-1"
}

variable "attributes" {
default = []
type = "list"
type = "list"
description = "Additional attributes (e.g. `1`)"
default = []
}

variable "namespace" {
default = "eg"
type = "string"
description = "Namespace (_e.g._ `eg` or `cp`)"
default = "eg"
}

variable "name" {
default = "efs"
type = "string"
description = "Name (_e.g._ `app`)"
default = "app"
}

variable "stage" {
default = "testing"
type = "string"
description = "Stage (_e.g._ `prod`, `dev`, `staging`)"
default = "testing"
}

variable "availability_zones" {
type = "list"
type = "list"
description = "Availability Zone IDs"
}

variable "provisioned_throughput_in_mibps" {}
variable "provisioned_throughput_in_mibps" {
description = "The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with `throughput_mode` set to `provisioned`"
default = 0
}

variable "security_groups" {
type = "list"
type = "list"
description = "Security Group IDs to allow access to the EFS"
}

variable "subnets" {
type = "list"
type = "list"
description = "Subnet IDs"
}

variable "throughput_mode" {
type = "string"
description = "Throughput mode for the file system. Defaults to `bursting`. Valid values: `bursting`, `provisioned`. When using `provisioned`, also set `provisioned_throughput_in_mibps`"
default = "bursting"
}

variable "throughput_mode" {}
variable "vpc_id" {}
variable "zone_id" {}
variable "vpc_id" {
type = "string"
description = "VPC ID"
}

variable "zone_id" {
type = "string"
description = "Route53 DNS zone ID"
}
28 changes: 14 additions & 14 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
output "arn" {
value = "${local.enabled ? join("", aws_efs_file_system.default.*.arn) : "" }"
value = "${join("", aws_efs_file_system.default.*.arn)}"
description = "EFS ARN"
}

output "id" {
value = "${local.enabled ? join("", aws_efs_file_system.default.*.id) : "" }"
value = "${join("", aws_efs_file_system.default.*.id)}"
description = "EFS ID"
}

output "host" {
value = "${local.enabled ? module.dns.hostname : "" }"
description = "Assigned DNS-record for the EFS"
value = "${module.dns.hostname}"
description = "Route53 DNS hostname for the EFS"
}

output "dns_name" {
value = "${local.enabled ? local.dns_name : "" }"
description = "DNS name"
value = "${local.dns_name}"
description = "EFS DNS name"
}

output "mount_target_dns_names" {
value = ["${local.enabled ? aws_efs_mount_target.default.*.dns_name : list("") }"]
description = "List of DNS names for the given subnet/AZ per documented convention"
value = ["${coalescelist(aws_efs_mount_target.default.*.dns_name, list(""))}"]
description = "List of EFS mount target DNS names"
}

output "mount_target_ids" {
value = ["${local.enabled ? aws_efs_mount_target.default.*.id : list("") }"]
description = "List of IDs of the EFS mount targets (one per Availability Zone)"
value = ["${coalescelist(aws_efs_mount_target.default.*.id, list(""))}"]
description = "List of EFS mount target IDs (one per Availability Zone)"
}

output "mount_target_ips" {
value = ["${local.enabled ? aws_efs_mount_target.default.*.ip_address : list("") }"]
description = "List of IPs of the EFS mount targets (one per Availability Zone)"
value = ["${coalescelist(aws_efs_mount_target.default.*.ip_address, list(""))}"]
description = "List of EFS mount target IPs (one per Availability Zone)"
}

output "network_interface_ids" {
value = ["${local.enabled ? aws_efs_mount_target.default.*.network_interface_id : list("") }"]
description = "The IDs of the network interface that Amazon EFS created when it created the mount target"
value = ["${coalescelist(aws_efs_mount_target.default.*.network_interface_id, list(""))}"]
description = "List of mount target network interface IDs"
}
Loading

0 comments on commit f4c8c73

Please sign in to comment.