Skip to content

Instantly share code, notes, and snippets.

@phunehehe phunehehe/main.tf
Last active May 4, 2018

Embed
What would you like to do?
resource aws_elasticache_replication_group single {
node_type = "cache.m3.medium"
number_cache_clusters = 1
port = 6379
replication_group_description = "single-test"
replication_group_id = "single-test"
subnet_group_name = "staging"
}
resource aws_elasticache_replication_group cluster {
automatic_failover_enabled = true
node_type = "cache.m3.medium"
number_cache_clusters = 2
port = 6379
replication_group_description = "cluster-test"
replication_group_id = "cluster-test"
subnet_group_name = "staging"
}
resource aws_elasticache_replication_group native_cluster {
cluster_mode {
replicas_per_node_group = 1
num_node_groups = 1
}
automatic_failover_enabled = true
node_type = "cache.m3.medium"
port = 6379
replication_group_description = "native-cluster-test"
replication_group_id = "native-cluster-test"
subnet_group_name = "staging"
}
resource aws_elasticache_replication_group native_single {
cluster_mode {
replicas_per_node_group = 0
num_node_groups = 1
}
node_type = "cache.m3.medium"
port = 6379
replication_group_description = "native-single-test"
replication_group_id = "native-single-test"
subnet_group_name = "staging"
}
resource aws_elasticache_replication_group sharding {
cluster_mode {
replicas_per_node_group = 0
num_node_groups = 2
}
automatic_failover_enabled = true
node_type = "cache.m3.medium"
port = 6379
replication_group_description = "sharding-test"
replication_group_id = "sharding-test"
subnet_group_name = "staging"
}
#!/usr/bin/env bash
for group in single cluster native_cluster native_single sharding
do
for attribute in primary_endpoint_address configuration_endpoint_address
do
if echo aws_elasticache_replication_group.$group.$attribute | terraform console >/dev/null 2>&1
then
result=yes
else
result=no
fi
printf '%s\t%s\t%s\n' $group $attribute $result
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.