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 年前684 查看次数
1 回答
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
专家
iwasa
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则