1

I am trying to deploy lambda using the serverless framework in China AWS region - I am getting into below error.

Is there any workaround to pass variables in serverless.yaml?

CloudFormation - UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - aws-china-lambda-Test-Env Serverless: Operation failed! Serverless: View the full error output: https://cn-north-1.console.aws.amazon.com/cloudformation/home?region=cn-north-1#/stack/detail?stackId=arn%3Aaws-cn%3Acloudformation%3Acn-north-1%XXXXX%3Astack%2Faws-china-lambda-Test-Env%2Fc9228230-72e5-11e9-a846-XXXX Serverless 

Error --------------------------------------- 

An error occurred: QueueAlertLambdaFunction - EnvironmentVariablesFeature is not supported in cn-north-1 region. For more information, please visit the AWS Lambda documentation on Environment Variables. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: a19ca4e3-XXX-11e9-adef-XXXXX). 
Jijo John
  • 1,368
  • 2
  • 17
  • 31
  • If you temporarily remove the Lambda function from the serverless YAML, re-deploy the stack, then add the Lambda function back in, and re-deploy again, does it work? – jarmod May 10 '19 at 15:11

1 Answers1

3

Update 11/19/2019 It is now supported see AWS Lambda now supports Environment Variables in the AWS China (Beijing) Region, operated by Sinnet, and the AWS China (Ningxia) Region, operated by NWCD


This is indeed a limitation in the China regions (see AWS Lambda):

The AWS services in China implementation of AWS Lambda is unique in the following ways:

  • The following AWS Lambda features are unavailable in the Beijing and Ningxia Regions:

    • Lambda environment variables

One way to solve your problem is to use old serverless plugins that used to offer a solution for environment variables before this feature was available in Lambda, have a look at those:

Community
  • 1
  • 1
jogold
  • 6,667
  • 23
  • 41