How to pass and retrieve constant json data to lambda function

后端 未结 2 2154
误落风尘
误落风尘 2021-02-20 06:33

I have lambda function defined sth like :

def lambda_handler(event, context):

   #get constant json argument passed from cloudwatch event rule

   ...
         


        
2条回答
  •  清酒与你
    2021-02-20 07:19

    This is based on NodeJS, but it should be the same for Python. The Constant under Input is a simple JSON encoded object, which can then be accessed using the event variable.

    Input

    { "config": "uk" }
    

    Lambda

    console.log(event.config)
    

    Found this entry as one of the top Google results, so hopefully this will help someone else.

提交回复
热议问题