2

I added a cloudwatch event target input in the json format

{ "config": us}

And I tried to get this event as a input in my Lambda function as

def lambda_handler(event, context):

      con = event['config']

But this is not working , actually when I print just event , I am not getting any values

I tried con = event.config

def lambda_handler(event, context):

    con = event.config
    con1 = event['config']
    print (con)
    print (con1)

1 Answer 1

4

This should work:

def lambda_handler(event, context):

    con1 = event['config']
    print (con1)

Maybe the problem is that { "config": us} is not a valid json. Try with { "config": "us"}

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks , that fixed the issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.