Last active
May 4, 2018 18:41
-
-
Save phunehehe/9657cb33d7ba0ab48a113e9c3bc54475 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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