amazon-elasticache

Setting up a NAT gateway with VPC using Serverless framework

风格不统一 提交于 2019-12-10 13:40:20
问题 I'm trying to use the serverless framework to create a Lambda function that can access an Elasticache cluster, as well as call out to the internet. I've got as far as configuring serverless.yml to create the Lambda function, create the Elasticache cluster (memcached engine), and finally to create a VPC and place both the Lambda function and Elasticache cluster within it (otherwise, they cannot communicate). I understand that things within a VPC do not have access to the internet, and from

Closing DAX Client in Lambda Function

北城以北 提交于 2019-12-08 00:00:06
问题 I have a node.js functon that I want to deploy as a AWS Lambda function. I have noticed that when I use redis Elasticache, I must close the connection I opened with redis.createClient or else the Lambda function times out. I do this by simply calling the client's quit() method. If I do this prior to issuing the Lambda callback, the Lambda function ends as expected. If I do not, the Lambda function times out at whatever timeout interval I set. In a test setting, I have a Lambda function that

Setting up ElastiCache Redis with Elastic BeanStalk + Django

我与影子孤独终老i 提交于 2019-12-07 15:10:01
问题 Another stackoverflow answer says you need to set up a elasticache.config file to create Redis servers with ElastiCache automatically. However, can I just create a Redis instance on AWS (Elasticache) and add its endpoint into Django settings? Eg, with Django-redis: CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://<REDIS AWS ENDPOINT AND PORT HERE>", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } } } I suspect the above could cause

Export existing AWS Lambda and API Gateway to Cloudformation template

ⅰ亾dé卋堺 提交于 2019-12-06 21:30:06
问题 How to export existing configured and tested infrastructure (including AWS Lambda functions, API Gateways, ElastiCache clusters, Cloudwatch rules) to Cloudformation template? I know about Cloudformer tool, but it supports limited number of AWS services (Amazon VPC, DynamoDB, etc) and don't supports some of services which we use. Which tools and approaches can I use in my case for generating Cloudformation template? 回答1: Partial solution: there is ability to export Lambda function to AWS SAM

Closing DAX Client in Lambda Function

六眼飞鱼酱① 提交于 2019-12-06 09:55:16
I have a node.js functon that I want to deploy as a AWS Lambda function. I have noticed that when I use redis Elasticache, I must close the connection I opened with redis.createClient or else the Lambda function times out. I do this by simply calling the client's quit() method. If I do this prior to issuing the Lambda callback, the Lambda function ends as expected. If I do not, the Lambda function times out at whatever timeout interval I set. In a test setting, I have a Lambda function that operated on the cache and terminates in 30 milliseconds. Without the call to the redis client quit()

AWS VPC Lambda Function keeps losing internet access

て烟熏妆下的殇ゞ 提交于 2019-12-06 07:25:34
问题 Hope someone can help enlighten me on this issue. I am currently working on a lambda function that utilizes the cloud watch scheduler to check various devices and it is using elasticache to maintain a simple database on the readings. My problem is that after I shut down my testing at night. I fire up the lambda function in the morning and the function has lost access to the internet. Which is represented by the function timing out. Regularly after a few hour of messing around with my routes

Connect to AWS ElastiCache with In-Transit Encryption

倖福魔咒の 提交于 2019-12-06 01:30:02
问题 ElastiCache with encryption uses TLS to communicate with redis client, yet as I've seen redis clients in all languages (ioredis, predis, go-redis) require a pem file when configuring the client to us TLS. How can I connect to Elasticache with in-transit encryption without given the ceritificate for the TLS? 回答1: solution - no certificate is needed, just to enable TLS in the client (ioredis for example is just to have tls: {} 回答2: Here is my working demo code using Predis. $servers = ['tls:/

Setting up ElastiCache Redis with Elastic BeanStalk + Django

别说谁变了你拦得住时间么 提交于 2019-12-05 18:37:36
Another stackoverflow answer says you need to set up a elasticache.config file to create Redis servers with ElastiCache automatically. However, can I just create a Redis instance on AWS (Elasticache) and add its endpoint into Django settings? Eg, with Django-redis : CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://<REDIS AWS ENDPOINT AND PORT HERE>", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } } } I suspect the above could cause trouble with multiple beanstalk server instances. Given this, I am tempted to use MemCache and not

Cant connect dynamo Db from my vpc configured lambda function

ぃ、小莉子 提交于 2019-12-05 13:18:11
问题 i need to connect elastic cache and dynamo db from a single lambda function. My code is exports.handler = (event, context, callback) => { var redis = require("redis"); var client; function connectRedisClient() { client = redis.createClient(6379, "dgdfgdfgdfgdfgdfgfd.use1.cache.amazonaws.com", { no_ready_check: true }); } connectRedisClient(); client.set('sampleKey', 'Hello World', redis.print); console.log("set worked"); client.quit(); var AWS = require("aws-sdk"); var docClient = new AWS

Is it possible to stop nodes in AWS ElastiCache cluster

扶醉桌前 提交于 2019-12-05 08:21:00
I have an AWS account which is used for development. Because the developers are in one timezone, we switch off the resources after hours to conserve usage. Is it possible to temporarily switch off nodes in elasticache cluster? all i found in cli reference was 'delete cluster': http://docs.aws.amazon.com/cli/latest/reference/elasticache/index.html At this time there is not a way to STOP and EMR cluster in the same sense you can with EC2 instances. The EMR cluster uses instance-store volumes and the EC2 start/stop feature relies on the use of EBS volumes which are not appropriate for high