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개 답변
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠