Skip to content

Commit

Permalink
Use README.yaml (#4)
Browse files Browse the repository at this point in the history
* Use README.yaml to generate README

* update gitignore

* add hcl language to codeblock

* add travis yml
  • Loading branch information
sarkis authored Jun 21, 2018
1 parent 7c67cc9 commit ec7151e
Show file tree
Hide file tree
Showing 7 changed files with 348 additions and 84 deletions.
18 changes: 11 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
# Compiled files
*.tfstate
*.tfstate.*
*.tfstate.backup
.terraform.tfstate.lock.info

# Module directory
.terraform/
.idea
*.iml

# .tfvars files
*.tfvars
# Build Harness
.build-harness
build-harness/
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
addons:
apt:
packages:
- git
- make
- curl

install:
- make init

script:
- make terraform/install
- make terraform/get-plugins
- make terraform/get-modules
- make terraform/lint
- make terraform/validate
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SHELL := /bin/bash

# List of targets the `readme` target should call before generating the readme
export README_DEPS ?= docs/targets.md docs/terraform.md

-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)

## Lint terraform code
lint:
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
243 changes: 166 additions & 77 deletions README.md

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions README.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#

# Name of this project
name: terraform-aws-alb

# Logo for this project
#logo: docs/logo.png

# License of this project
license: "APACHE2"

# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-alb

# Badges to display
badges:
- name: "Build Status"
image: "https://travis-ci.org/cloudposse/terraform-aws-alb.svg?branch=master"
url: "https://travis-ci.org/cloudposse/terraform-aws-alb"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-alb.svg"
url: "https://github.com/cloudposse/terraform-aws-alb/releases"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"

related:
- name: "terraform-aws-alb-ingress"
description: "Terraform module to provision an HTTP style ingress rule based on hostname and path for an ALB"
url: "https://github.com/cloudposse/terraform-aws-alb-ingress"

# Short description of this project
description: |-
Terraform module to create an ALB, default ALB listener(s), and a default ALB target and related security groups.
# How to use this project
usage: |-
Include this module in your existing terraform code:
```hcl
module "alb" {
source = "git::https://github.com/cloudposse/terraform-aws-alb.git?ref=tags/0.2.0"
namespace = "eg"
name = "app"
stage = "dev"
vpc_id = "xxxxxxxxx"
ip_address_type = "ipv4"
subnet_ids = ["xxxxxxxx", "xxxxxxxx"]
access_logs_region = "us-west-2"
}
```
# Other files to include in this README from the project folder
include:
- "docs/targets.md"
- "docs/terraform.md"

# Contributors to this project
contributors:
- name: "Erik Osterman"
homepage: "https://github.com/osterman"
avatar: "http://s.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb?s=144"
github: "osterman"
- name: "Igor Rodionov"
homepage: "https://github.com/goruha"
avatar: "http://s.gravatar.com/avatar/bc70834d32ed4517568a1feb0b9be7e2?s=144"
github: "goruha"
- name: "Andriy Knysh"
homepage: "https://github.com/aknysh"
avatar: "https://avatars0.githubusercontent.com/u/7356997?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144"
github: "aknysh"
- name: "Sarkis Varozian"
homepage: "https://github.com/sarkis"
avatar: "https://avatars3.githubusercontent.com/u/42673?s=144&v=4"
github: "sarkis"
9 changes: 9 additions & 0 deletions docs/targets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Makefile Targets
```
Available targets:
help This help screen
help/all Display help for all targets
lint Lint terraform code
```
55 changes: 55 additions & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| access_logs_enabled | A boolean flag to enable/disable access_logs | string | `true` | no |
| access_logs_prefix | The S3 bucket prefix | string | `` | no |
| access_logs_region | The region for the access_logs S3 bucket | string | `us-east-1` | no |
| attributes | Additional attributes, e.g. `1` | list | `<list>` | no |
| certificate_arn | The ARN of the default SSL certificate for HTTPS listener | string | `` | no |
| cross_zone_load_balancing_enabled | A boolean flag to enable/disable cross zone load balancing | string | `true` | no |
| deletion_protection_enabled | A boolean flag to enable/disable deletion protection for ALB | string | `false` | no |
| delimiter | Delimiter to be used between `namespace`, `name`, `stage` and `attributes` | string | `-` | no |
| deregistration_delay | The amount of time to wait in seconds before changing the state of a deregistering target to unused | string | `15` | no |
| health_check_healthy_threshold | The number of consecutive health checks successes required before considering an unhealthy target healthy | string | `2` | no |
| health_check_interval | The duration in seconds in between health checks | string | `15` | no |
| health_check_matcher | The HTTP response codes to indicate a healthy check | string | `200-399` | no |
| health_check_path | The destination for the health check request | string | `/` | no |
| health_check_timeout | The amount of time to wait in seconds before failing a health check request | string | `10` | no |
| health_check_unhealthy_threshold | The number of consecutive health check failures required before considering the target unhealthy | string | `2` | no |
| http2_enabled | A boolean flag to enable/disable HTTP/2 | string | `true` | no |
| http_enabled | A boolean flag to enable/disable HTTP listener | string | `true` | no |
| http_ingress_cidr_blocks | List of CIDR blocks to allow in HTTP security group | list | `<list>` | no |
| http_ingress_prefix_list_ids | List of prefix list IDs for allowing access to HTTP ingress security group | list | `<list>` | no |
| http_port | The port for the HTTP listener | string | `80` | no |
| https_enabled | A boolean flag to enable/disable HTTPS listener | string | `false` | no |
| https_ingress_cidr_blocks | List of CIDR blocks to allow in HTTPS security group | list | `<list>` | no |
| https_ingress_prefix_list_ids | List of prefix list IDs for allowing access to HTTPS ingress security group | list | `<list>` | no |
| https_port | The port for the HTTPS listener | string | `443` | no |
| idle_timeout | The time in seconds that the connection is allowed to be idle | string | `60` | no |
| internal | A boolean flag to determine whether the ALB should be internal | string | `false` | no |
| ip_address_type | The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`. | string | `ipv4` | no |
| name | Solution name, e.g. `app` | string | - | yes |
| namespace | Namespace, which could be your organization name, e.g. `cp` or `cloudposse` | string | - | yes |
| security_group_ids | A list of additional security group IDs to allow access to ALB | list | `<list>` | no |
| stage | Stage, e.g. `prod`, `staging`, `dev`, or `test` | string | - | yes |
| subnet_ids | A list of subnet IDs to associate with ALB | list | - | yes |
| tags | Additional tags (e.g. `map(`BusinessUnit`,`XYZ`) | map | `<map>` | no |
| vpc_id | VPC ID to associate with ALB | string | - | yes |

## Outputs

| Name | Description |
|------|-------------|
| access_logs_bucket_id | The S3 bucket ID for access logs |
| alb_arn | The ARN of the ALB |
| alb_arn_suffix | The ARN suffix of the ALB |
| alb_dns_name | DNS name of ALB |
| alb_zone_id | The ID of the zone which ALB is provisioned |
| default_target_group_arn | The default target group ARN |
| http_listener_arn | The ARN of the HTTP listener |
| https_listener_arn | The ARN of the HTTPS listener |
| listener_arns | A list of all the listener ARNs |
| security_group_id | The security group ID of the ALB |

0 comments on commit ec7151e

Please sign in to comment.