Using Amazon ElastiCache for Redis as a Session Cache-Store - Part 2
This is the second and final part of our series on Using Amazon ElastiCache for Redis as a Session Cache-Store. The first article discussed what technol...
Dallin Rasmuson
2024-06-25
This is the second and final part of our series on Using Amazon ElastiCache for Redis as a Session Cache-Store. The first article discussed what technologies we will use, the prerequisites and architecture overview, and the configuration and setup process.

In this part two and final article, we will be working on these tasks.
- Configure access to Amazon EKS Cluster
- Build and deploy our Docker image to Amazon ECR
- Deploy supporting services to Kubernetes
- Deploy Python Flask Color application to Kubernetes
- Demonstrate how Session Cache works with our Python Flask Color application and Amazon ElastiCache
- Clean up apps and infrastructure
You can access all of the code used in my GitHub Repository.
All the commands are run from the root directory of the GitHub repo.
Configure access to Amazon EKS Cluster
Amazon EKS Cluster details can be extracted from terraform output or from the AWS Console to get the name of the cluster. This following command can be used to update the kubeconfig in your local machine where you run kubectl commands to interact with your EKS Cluster.
AWS_REGION=$(terraform output -raw aws_region)
EKS_CLUSTER_NAME=$(terraform output -raw eks_cluster_name)
aws eks --region $AWS_REGION update-kubeconfig --name $EKS_CLUSTER_NAME
Results of configuring kubeconfig.
Build the Docker image
Set the variables needed to build and push your Docker image. Navigate to the root of the directory of the GitHub repo and run the following commands:
AWS_REGION=$(terraform output -raw aws_region)
ECR_REPO=$(terraform output -raw ecr_repo_url)
To build the Docker image, run the following command:
docker build --platform linux/amd64 --no-cache --pull -t ${ECR_REPO}:latest ./color
Push the Docker image to Amazon ECR
To push the Docker image to Amazon ECR, authenticate to your private Amazon ECR registry. To do this, run the following command:
aws ecr get-login-password --region $AWS_REGION
Dallin Rasmuson
Solutions Architect
Read More
View all posts
Cloud Engineering
Automating API Information Storage with AWS - Introduction
APIs serve as the backbone of software development, enabling applications to communicate with one another seamlessly.

Todd Bernson
2024-06-25

Cloud Engineering
Automating API Information Storage with AWS - Technical Deep Dive into Automated API Information Storage System
Managing API information is a big challenge, demanding streamlined solutions for efficiency and reliability. My introduction to automating API informati...

Todd Bernson
2024-06-25

Cloud Engineering
AWS EKS Identity is Not Mapped Error
If you are using AWS IAM Identity Center and grant a role access to an AWS EKS (Elastic Kubernetes Service) and you are unable to access the cluster when you run a KubeCTL command. You have...
Mahmood
2024-06-25