Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module "example_redis" {



## Examples

Review the [complete example](examples/simple) to see how to use this module.



## Makefile Targets
Expand Down Expand Up @@ -88,7 +92,7 @@ Available targets:
| 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 |
| notification_topic_arn | Notification topic arn | string | `` | no |
| port | Redis port | string | `6379` | no |
| security_groups | AWS security group ids | list | `<list>` | no |
| stage | Stage | string | `default` | no |
Expand Down
4 changes: 3 additions & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ usage: |-
}
```

examples: |-
Review the [complete example](examples/simple) to see how to use this module.

include:
- "docs/targets.md"
Expand All @@ -78,4 +80,4 @@ contributors:
- name: "Max Moon"
github: "MoonMoon1919"
- name: "Christopher Riley"
github: "christopherriley"
github: "christopherriley"
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
| 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 |
| notification_topic_arn | Notification topic arn | string | `` | no |
| port | Redis port | string | `6379` | no |
| security_groups | AWS security group ids | list | `<list>` | no |
| stage | Stage | string | `default` | no |
Expand Down
69 changes: 69 additions & 0 deletions examples/simple/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
terraform {
required_version = ">= 0.11.2"

backend "s3" {}
}

variable "aws_assume_role_arn" {}

provider "aws" {
assume_role {
role_arn = "${var.aws_assume_role_arn}"
}
}

variable "namespace" {}

variable "name" {}

variable "stage" {}

variable "region" {}

variable "availability_zones" {
type = "list"
}

variable "zone_id" {}

module "vpc" {
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.3.3"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "${var.name}"
}

module "subnets" {
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.3.5"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "${var.name}"
region = "${var.region}"
availability_zones = "${var.availability_zones}"
vpc_id = "${module.vpc.vpc_id}"
igw_id = "${module.vpc.igw_id}"
cidr_block = "10.0.0.0/16"
}

module "redis" {
source = "../../"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "${var.name}"
zone_id = "${var.zone_id}"
vpc_id = "${module.vpc.vpc_id}"
subnets = "${module.subnets.private_subnet_ids}"
maintenance_window = "wed:03:00-wed:04:00"
cluster_size = "2"
instance_type = "cache.t2.micro"
apply_immediately = "true"
availability_zones = "${var.availability_zones}"
automatic_failover = "false"

engine_version = "4.0.10"
family = "redis4.0"
port = "6379"
alarm_cpu_threshold_percent = "75"
alarm_memory_threshold_bytes = "10000000"
at_rest_encryption_enabled = "true"
}
6 changes: 6 additions & 0 deletions examples/simple/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace = "eg"
name = "redis"
stage = "testing"
zone_id = "Z3SO0TKDDQ0RGG"
region = "us-west-2"
availability_zones = ["us-west-2a", "us-west-2b"]
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ variable "transit_encryption_enabled" {
}

variable "notification_topic_arn" {
default = "10000000"
default = ""
description = "Notification topic arn"
}

Expand Down