Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to ElastiCache cluster using Api Gateway

I need to communicate elasticache(Redis engine) using AWS API gateway. I successfully connected the ElastiCache from lambda function in the same VPC. I cant connect from outside VPC.

So I tried to create an API gateway, and select integration type as AWS Service Proxy and AWS Service as ElastiCache.

This is the screenshot for creating an API gateway

screenshot

But I don't know, how to test this created API for executing Redis commands.

eg: SET A FOO

is it possible to communicate ElastiCache using API gateway?

like image 817
Abdul Manaf Avatar asked Jun 21 '16 12:06

Abdul Manaf


People also ask

How do I access my ElastiCache cluster?

Sign in to the AWS Management Console and open the ElastiCache console at https://console.aws.amazon.com/elasticache/ . To see a list of your clusters running the Memcached engine, in the left navigation pane, choose Memcached.

How do I connect to Redis cluster?

Open the Command Prompt and change to the Redis directory and run the command c:\Redis>redis-cli -h Redis_Cluster_Endpoint -p 6379 . Run Redis commands. You are now connected to the cluster and can run Redis commands like the following.

Can Lambda Access ElastiCache?

For more information about Amazon ElastiCache, see Amazon ElastiCache . Create a Lambda function to access the ElastiCache cluster. When you create the Lambda function, you provide subnet IDs in your Amazon VPC and a VPC security group to allow the Lambda function to access resources in your VPC.


1 Answers

API Gateway service proxy is for proxying the AWS API, not the Redis API, so that's not going to work for you. You will have to create a Lambda function and use API Gateway Lambda integration.

like image 133
Mark B Avatar answered Sep 17 '22 15:09

Mark B