CloudFormation is expecting JSONObject but it finds a string

0

Hi all,

I'm trying to follow this guide on setting up AWS Cognito -> Sendgrid instead of AWS Cognito -> SES as we are having issues with comcast domain with SES.

Guide: https://www.maxivanov.io/send-aws-cognito-emails-with-3rd-party-esps/

However, following the guide, it hits an error with the LambdaTrigger resource, specifically throwing:

"ResourceType": "AWS::CloudFormation::Stack",
            "Timestamp": "2022-12-07T21:53:49.981000+00:00",
            "ResourceStatus": "UPDATE_ROLLBACK_COMPLETE"
        },
        {
            "StackId": "arn:aws:cloudformation:us-west-2:654225271480:stack/simplehuman-iot-sendgrid/bb0cfdc0-74ca-11ed-b
f3b-0247adce45f9",
            "EventId": "LambdaTrigge

I even tried returning a random JSON object but that doesnt change anything either. I added this at the end of the index.js file:

return {
        statusCode: 200,
        body: "body of JSON response",
        headers: {
            'Content-Type': `application/json`,
            'Access-Control-Allow-Origin': `*`,
            'Access-Control-Allow-Headers': `Origin, X-Requested-With, Content-Type, Accept, Authorization`
        },
        isBase64Encoded: false
    }

Any advice on how I could send it as a JSONObject?

1 Answer
0

Hi.

Why should you return a JSONObject?
I think the target function is for sending emails to SendGrid.

Could you please elaborate why you're trying to return a JSONObject ?

I don't understand the relationship between the error of the LambdaTrigger resource and the return value of the function.

profile picture
EXPERT
iwasa
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions