2. Verify necessary Security Group and Subnets are created
While the EKS cluster is being created, open up another terminal.
Run the following until you are able to find a matching security group:
Next, run the command below until you are able to find several EC2 subnets created:
3. Create an AWS ElastiCache subnet group
In order to network your AWS ElastiCache cluster with the EKS cluster in its Virtual Private Cloud environment, you'll need to create a cache subnet group that links to each of your EKS cluster's subnets. This will launch the ElastiCache cluster in the same VPC.
Run the following to create the subnet group:
4. Create an AWS ElastiCache cluster
Next, run the following to create an AWS ElastiCache cluster backed with Redis 6.x, running with a single node on a small t2.micro server (you can upgrade later on in a live deployment).
Note the command flags specify the gm-config-subnet-group you created in the previous step as well as the same Security Group you found in step 2. This Security Group is the same one used to authorize communication between all nodes in the same VPC environment.
5. Retrieve the AWS ElastiCache cache node endpoint
You'll need to wait a while for the cluster to be created before you can access its endpoint. Run the following until the output is no longer null:
When the output prints out cache node information, copy the Endpoint.Address value (it should end with cache.amazonaws.com).
5. Configure Grey Matter to point to AWS ElastiCache
Open the global.yaml file in the root directory and find the external_redis section. Update the disabled value to false and set host to be the endpoint address you copied in the previous step.
When Grey Matter is fully installed, mesh configurations will be persisted in your AWS ElastiCache cluster.
To confirm that your AWS ElastiCache cluster is being used, [log in to the AWS Management Console and view metrics in Cloudwatch](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=%28);query='*7bAWS*2fElastiCache*2cCacheClusterId*2cCacheNodeId*7d*20gm-config-store>)
Afterwards, run the following commands to delete the AWS ElastiCache cluster:
You'll need to wait a while for AWS ElastiCache to clean up all of the cluster's underlying resources. Then run the following to delete the cache subnet group: