Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-elasticache-redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-elasticache-redis
Commits
ffc8b5f8
Commit
ffc8b5f8
authored
Aug 27, 2017
by
aknysh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assign `attributes` and `tags` from `variables.tf` to `label` module
parent
7fbc5129
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
18 deletions
+35
-18
.gitignore
.gitignore
+3
-0
main.tf
main.tf
+17
-16
variables.tf
variables.tf
+15
-2
No files found.
.gitignore
View file @
ffc8b5f8
...
...
@@ -4,3 +4,6 @@
# Module directory
.terraform/
.idea
*.iml
main.tf
View file @
ffc8b5f8
# Define composite variables for resources
module
"label"
{
source
=
"git::https://github.com/cloudposse/tf_label.git?ref=tags/0.1.0"
namespace
=
"
${
var
.
namespace
}
"
name
=
"
${
var
.
name
}
"
stage
=
"
${
var
.
stage
}
"
source
=
"git::https://github.com/cloudposse/tf_label.git?ref=tags/0.2.0"
namespace
=
"
${
var
.
namespace
}
"
name
=
"
${
var
.
name
}
"
stage
=
"
${
var
.
stage
}
"
delimiter
=
"
${
var
.
delimiter
}
"
attributes
=
"
${
var
.
attributes
}
"
tags
=
"
${
var
.
tags
}
"
}
#
...
...
@@ -26,11 +29,7 @@ resource "aws_security_group" "default" {
cidr_blocks
=
[
"0.0.0.0/0"
]
}
tags
{
Name
=
"
${module
.
label
.
id
}
"
Namespace
=
"
${
var
.
namespace
}
"
Stage
=
"
${
var
.
stage
}
"
}
tags
=
"
${module
.
label
.
tags
}
"
}
resource
"aws_elasticache_subnet_group"
"default"
{
...
...
@@ -57,7 +56,7 @@ resource "aws_elasticache_replication_group" "default" {
maintenance_window
=
"
${
var
.
maintenance_window
}
"
notification_topic_arn
=
"
${
var
.
notification_topic_arn
}
"
tags
=
"
${module
.
label
.
tags
}
"
tags
=
"
${module
.
label
.
tags
}
"
}
#
...
...
@@ -73,14 +72,15 @@ resource "aws_cloudwatch_metric_alarm" "cache_cpu" {
period
=
"300"
statistic
=
"Average"
threshold
=
"
${
var
.
alarm_cpu_threshold_percent
}
"
threshold
=
"
${
var
.
alarm_cpu_threshold_percent
}
"
dimensions
{
CacheClusterId
=
"
${module
.
label
.
id
}
"
}
alarm_actions
=
[
"
${
var
.
alarm_actions
}
"
]
depends_on
=
[
"aws_elasticache_replication_group.default"
]
alarm_actions
=
[
"
${
var
.
alarm_actions
}
"
]
depends_on
=
[
"aws_elasticache_replication_group.default"
]
tags
=
"
${module
.
label
.
tags
}
"
}
resource
"aws_cloudwatch_metric_alarm"
"cache_memory"
{
...
...
@@ -93,14 +93,15 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {
period
=
"60"
statistic
=
"Average"
threshold
=
"
${
var
.
alarm_memory_threshold_bytes
}
"
threshold
=
"
${
var
.
alarm_memory_threshold_bytes
}
"
dimensions
{
CacheClusterId
=
"
${module
.
label
.
id
}
"
}
alarm_actions
=
[
"
${
var
.
alarm_actions
}
"
]
depends_on
=
[
"aws_elasticache_replication_group.default"
]
alarm_actions
=
[
"
${
var
.
alarm_actions
}
"
]
depends_on
=
[
"aws_elasticache_replication_group.default"
]
tags
=
"
${module
.
label
.
tags
}
"
}
...
...
variables.tf
View file @
ffc8b5f8
...
...
@@ -31,12 +31,10 @@ variable "cluster_size" {
default
=
"1"
}
variable
"port"
{
default
=
"6379"
}
variable
"instance_type"
{
default
=
"cache.t2.micro"
}
...
...
@@ -80,3 +78,18 @@ variable "availability_zones" {
}
variable
"zone_id"
{}
variable
"delimiter"
{
type
=
"string"
default
=
"-"
}
variable
"attributes"
{
type
=
"list"
default
=
[]
}
variable
"tags"
{
type
=
"map"
default
=
{}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment