Commit d7b57edc authored by Vadim Hleif's avatar Vadim Hleif Committed by GitHub

Migrate to README.yaml format, add travis (#13)

parent cd1b042a
......@@ -6,3 +6,6 @@
.terraform
.idea
*.iml
**/.build-harness
**/build-harness
\ No newline at end of file
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
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
\ No newline at end of file
This diff is collapsed.
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-aws-elasticache-redis
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-elasticache-redis
# Badges to display
badges:
- name: "Build Status"
image: "https://travis-ci.org/cloudposse/terraform-aws-elasticache-redis.svg?branch=master"
url: "https://travis-ci.org/cloudposse/terraform-aws-elasticache-redis"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-elasticache-redis.svg"
url: "https://travis-ci.org/cloudposse/terraform-aws-elasticache-redis/releases"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
# Short description of this project
description: |-
Terraform module to provision an [`ElastiCache`](https://aws.amazon.com/elasticache/) Redis Cluster
# How to use this project
usage: |-
Include this repository as a module in your existing terraform code:
```hcl
module "example_redis" {
source = "git::https://github.com/cloudposse/terraform-aws-elasticache-redis.git?ref=master"
namespace = "general"
name = "redis"
stage = "prod"
zone_id = "${var.route53_zone_id}"
security_groups = ["${var.security_group_id}"]
vpc_id = "${var.vpc_id}"
subnets = "${var.private_subnets}"
maintenance_window = "wed:03:00-wed:04:00"
cluster_size = "2"
instance_type = "cache.t2.micro"
engine_version = "3.2.4"
alarm_cpu_threshold_percent = "${var.cache_alarm_cpu_threshold_percent}"
alarm_memory_threshold_bytes = "${var.cache_alarm_memory_threshold_bytes}"
apply_immediately = "true"
availability_zones = "${var.availability_zones}"
automatic_failover = "false"
}
```
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors:
- name: "Erik Osterman"
github: "osterman"
- name: "Igor Rodionov"
github: "goruha"
- name: "Andriy Knysh"
github: "aknysh"
- name: "Daren Desjardins"
github: "darend"
- name: "Max Moon"
github: "MoonMoon1919"
- name: "Christopher Riley"
github: "christopherriley"
\ No newline at end of file
## Makefile Targets
```
Available targets:
help This help screen
help/all Display help for all targets
lint Lint terraform code
```
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| alarm_actions | Alarm action list | list | `<list>` | no |
| alarm_cpu_threshold_percent | CPU threshold alarm level | string | `75` | no |
| alarm_memory_threshold_bytes | Ram threshold alarm level | string | `10000000` | no |
| apply_immediately | Apply changes immediately | string | `true` | no |
| attributes | Additional attributes (_e.g._ "1") | list | `<list>` | no |
| automatic_failover | Automatic failover (Not available for T1/T2 instances) | string | `false` | no |
| availability_zones | Availability zone ids | list | `Availability zone ids` | no |
| cluster_size | Count of nodes in cluster | string | `1` | no |
| delimiter | Delimiter between `name`, `namespace`, `stage` and `attributes` | string | `-` | no |
| enabled | Set to false to prevent the module from creating any resources | string | `true` | no |
| engine_version | Redis engine version | string | `4.0.10` | no |
| family | Redis family | string | `redis4.0` | no |
| instance_type | Elastic cache instance type | string | `cache.t2.micro` | no |
| maintenance_window | Maintenance window | string | `wed:03:00-wed:04:00` | no |
| name | Name | string | `redis` | no |
| namespace | Namespace | string | `global` | no |
| notification_topic_arn | Notification topic arn | string | `10000000` | no |
| port | Redis port | string | `6379` | no |
| security_groups | AWS security group ids | list | `<list>` | no |
| stage | Stage | string | `default` | no |
| subnets | AWS subnet ids | list | `<list>` | no |
| tags | Additional tags (_e.g._ map("BusinessUnit","ABC") | map | `<map>` | no |
| vpc_id | AWS VPC id | string | `REQUIRED` | no |
| zone_id | Route53 DNS Zone id | string | `false` | no |
## Outputs
| Name | Description |
|------|-------------|
| host | Redis host |
| id | Redis cluster id |
| port | Redis port |
| security_group_id | Security group id |
output "id" {
value = "${join("", aws_elasticache_replication_group.default.*.id)}"
value = "${join("", aws_elasticache_replication_group.default.*.id)}"
description = "Redis cluster id"
}
output "security_group_id" {
value = "${join("", aws_security_group.default.*.id)}"
value = "${join("", aws_security_group.default.*.id)}"
description = "Security group id"
}
output "port" {
value = "${var.port}"
value = "${var.port}"
description = "Redis port"
}
output "host" {
value = "${module.dns.hostname}"
value = "${module.dns.hostname}"
description = "Redis host"
}
variable "namespace" {
default = "global"
default = "global"
description = "Namespace"
}
variable "enabled" {
......@@ -8,93 +9,119 @@ variable "enabled" {
}
variable "stage" {
default = "default"
default = "default"
description = "Stage"
}
variable "name" {
default = "redis"
default = "redis"
description = "Name"
}
variable "security_groups" {
type = "list"
type = "list"
default = []
description = "AWS security group ids"
}
variable "vpc_id" {
default = ""
default = "REQUIRED"
description = "AWS VPC id"
}
variable "subnets" {
type = "list"
default = []
type = "list"
description = "AWS subnet ids"
default = []
}
variable "maintenance_window" {
default = "wed:03:00-wed:04:00"
default = "wed:03:00-wed:04:00"
description = "Maintenance window"
}
variable "cluster_size" {
default = "1"
default = "1"
description = "Count of nodes in cluster"
}
variable "port" {
default = "6379"
default = "6379"
description = "Redis port"
}
variable "instance_type" {
default = "cache.t2.micro"
default = "cache.t2.micro"
description = "Elastic cache instance type"
}
variable "family" {
default = "redis4.0"
default = "redis4.0"
description = "Redis family "
}
variable "engine_version" {
default = "4.0.10"
default = "4.0.10"
description = "Redis engine version"
}
variable "notification_topic_arn" {
default = ""
default = "10000000"
description = "Notification topic arn"
}
variable "alarm_cpu_threshold_percent" {
default = "75"
default = "75"
description = "CPU threshold alarm level"
}
variable "alarm_memory_threshold_bytes" {
# 10MB
default = "10000000"
default = "10000000"
description = "Ram threshold alarm level"
}
variable "alarm_actions" {
type = "list"
default = []
type = "list"
description = "Alarm action list"
default = []
}
variable "apply_immediately" {
default = "true"
default = "true"
description = "Apply changes immediately"
}
variable "automatic_failover" {
default = "false"
default = "false"
description = "Automatic failover (Not available for T1/T2 instances)"
}
variable "availability_zones" {
type = "list"
type = "list"
description = "Availability zone ids"
default = "Availability zone ids"
}
variable "zone_id" {}
variable "zone_id" {
default = "false"
description = "Route53 DNS Zone id"
}
variable "delimiter" {
type = "string"
default = "-"
type = "string"
default = "-"
description = "Delimiter between `name`, `namespace`, `stage` and `attributes`"
}
variable "attributes" {
type = "list"
default = []
type = "list"
description = "Additional attributes (_e.g._ \"1\")"
default = []
}
variable "tags" {
type = "map"
default = {}
type = "map"
description = "Additional tags (_e.g._ map(\"BusinessUnit\",\"ABC\")"
default = {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment