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 Risposta
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
ESPERTO
iwasa
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande