Package: aws-solutions-constructs.aws-lambda-elasticachememcached
aws-lambda-elasticachememcached module---Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_lambda_elasticachememcachedTypescript@aws-solutions-constructs/aws-lambda-elasticachememcachedJavasoftware.amazon.awsconstructs.services.lambdaelasticachememcachedOverviewThis AWS Solutions Construct implements an AWS Lambda function connected to an Amazon Elasticache Memcached cluster.Here is a minimal deployable pattern definition :Typescriptimport{Construct}from'constructs';import{Stack,StackProps}from'aws-cdk-lib';import{LambdaToElasticachememcached}from'@aws-solutions-constructs/aws-lambda-elasticachememcached';import*aslambdafrom'aws-cdk-lib/aws-lambda';newLambdaToElasticachememcached(this,'LambdaToElasticachememcachedPattern',{lambdaFunctionProps:{runtime:lambda.Runtime.NODEJS_16_X,handler:'index.handler',code:lambda.Code.fromAsset(`lambda`)}});Pythonfromaws_solutions_constructs.aws_lambda_elasticachememcachedimportLambdaToElasticachememcachedfromaws_cdkimport(aws_lambdaas_lambda,Stack)fromconstructsimportConstructLambdaToElasticachememcached(self,'LambdaToCachePattern',lambda_function_props=_lambda.FunctionProps(code=_lambda.Code.from_asset('lambda'),runtime=_lambda.Runtime.PYTHON_3_9,handler='index.handler'))Javaimportsoftware.constructs.Construct;importsoftware.amazon.awscdk.Stack;importsoftware.amazon.awscdk.StackProps;importsoftware.amazon.awscdk.services.lambda.*;importsoftware.amazon.awscdk.services.lambda.Runtime;importsoftware.amazon.awsconstructs.services.lambdaelasticachememcached.*;newLambdaToElasticachememcached(this,"LambdaToCachePattern",newLambdaToElasticachememcachedProps.Builder().lambdaFunctionProps(newFunctionProps.Builder().runtime(Runtime.NODEJS_16_X).code(Code.fromAsset("lambda")).handler("index.handler").build()).build());Pattern Construct PropsNameTypeDescriptionexistingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, providing both this andlambdaFunctionPropswill cause an error.lambdaFunctionProps?lambda.FunctionPropsOptional user provided props to override the default props for the Lambda function.existingVpc?ec2.IVpcAn optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon Elasticache. If an existing VPC is provided, thedeployVpcproperty cannot betrue. This usesec2.IVpcto allow clients to supply VPCs that exist outside the stack using theec2.Vpc.fromLookup()method.vpcProps?ec2.VpcPropsOptional user provided properties to override the default properties for the new VPC.subnetConfigurationis set by the pattern, so any values for those properties supplied here will be overridden.cacheEndpointEnvironmentVariableName?stringOptional Name for the Lambda function environment variable set to the cache endpoint. Default: CACHE_ENDPOINTcacheProps?cache.CfnCacheClusterPropsOptional user provided props to override the default props for the Elasticache Cluster. Providing both this andexistingCachewill cause an error.existingCache?cache.CfnCacheClusterExisting instance of Elasticache Cluster object, providing both this andcachePropswill cause an error. If you provide this, you must provide the associated VPC in existingVpc.Pattern PropertiesNameTypeDescriptionlambdaFunctionlambda.FunctionReturns an instance of the Lambda function used by the pattern.vpcec2.IVpcReturns an interface on the VPC used by the pattern. This may be a VPC created by the pattern or the VPC supplied to the pattern constructor.cachecache.CfnCacheClusterThe Elasticache Memcached cluster used by the construct.Default settingsOut of the box implementation of the Construct without any override will set the following defaults:AWS Lambda FunctionConfigure limited privilege access IAM role for Lambda functionEnable reusing connections with Keep-Alive for NodeJs Lambda functionEnable X-Ray TracingAttached to self referencing security group to grant access to cacheSet Environment Variables(default) CACHE_ENDPOINTAWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)Amazon Elasticache Memcached ClusterCreates multi node, cross-az cluster by default2 cache nodes, type: cache.t3.mediumSelf referencing security group attached to cluster endpointArchitecture© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.