Use the aws_elasticache_cluster_node InSpec audit resource to test the properties of a single AWS ElastiCache cluster node.
An aws_elasticache_cluster_node resource block declares the tests for a single AWS ElastiCache cluster node by cache_cluster_id and node_id.
describe aws_elasticache_cluster_node(cache_cluster_id: 'my-cluster-123', node_id: '0001') do
it { should exist }
end
The ElastiCache cluster ID and node ID must be provided.
The ID of the ElastiCache cluster:
It can be passed either as a string or as a cache_cluster_id: 'value' key-value entry in a hash.
The ID of the node must be a string containing 4 digits. It can be passed as a node_id: 'value' key-value entry in a hash.
| Property | Description |
|---|---|
| id | The cache node identifier, e.g. 0001. |
| port | The port number that the cache engine is listening on. |
| address | The DNS hostname of the cache node. |
| status | The current state of the cache node. One of the following values: available, creating, rebooting, or deleting. |
| create_time | The date and time when the cache node was created. |
There are also additional properties available. For a comprehensive list, see the API reference documentation.
describe aws_elasticache_cluster_node(cache_cluster_id: "my-cluster-123", node_id: "0001") do
its("status") { should eq 'available' }
end
11211
describe aws_elasticache_cluster_node(cache_cluster_id: "my-cluster-123", node_id: "0001") do
its("port") { should cmp 11211 }
end
us-east-2b
describe aws_elasticache_cluster_node(cache_cluster_id: "my-cluster-123", node_id: "0001") do
its("customer_availability_zone") { should cmp "us-east-2b" }
end
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our matchers page.
describe aws_elasticache_cluster_node(cache_cluster_id: "my-cluster-123", node_id: "0001") do
it { should exist }
end
Your Principal will need the elasticache:DescribeCacheClusters action set to allow.
You can find detailed documentation at Actions, Resources, and Condition Keys for Amazon ElastiCache, and Actions, Resources, and Condition Keys for Identity And Access Management.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/aws_elasticache_cluster_node/