For support requests please search or create posts on Serverless Forum: https://forum.serverless.com
carlosandrebp on master
upload email icon (compare)
carlosandrebp on master
Icons update (compare)
carlosandrebp on master
updates animations (compare)
andrepiresbp on master
Updates (compare)
andrepiresbp on master
Update (compare)
```package main
import (
"context"
"log"
"os"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
// Handler is our lambda handler invoked by the lambda.Start
function call
func Handler(ctx context.Context, sqsEvent events.SQSEvent) error {
log.Println("SQS Event", sqsEvent)
for _, v := range sqsEvent.Records {
log.Println(v.Body)
}
return nil
}
func main() {
lambda.Start(Handler)
} ```
Error: Call argument for function sf-2-at-pipeline-2-dev-salesforce is not a valid JSON object
at Gaxios._request (/Users/eugene.aiken/sf_2_at_pipeline/node_modules/gaxios/build/src/gaxios.js:129:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async UserRefreshClient.requestAsync (/Users/eugene.aiken/sf_2_at_pipeline/node_modules/google-auth-library/build/src/auth/oauth2client.js:343:18)
Is Fargate still the best way to run long-running, resource intensive background tasks? I found this post, but it's from 2018.
How are people doing this today?
Would someone be able to provide more description for what the general provider setting "tracing" does?
tracing:
# Can only be true if API Gateway is inside a stack.
apiGateway: true
# Optional, can be true (true equals 'Active'), 'Active' or 'PassThrough'
lambda: true
Does this enable X-Ray on all lambdas and render the serverless-plugin-tracing unecessary? In fact, the plugin is not compatible with the new config format (alex-murashkin/serverless-plugin-tracing#23)
I am getting a schema validation error trying to do the following in the serverless.yml file:
environment: ${file(serverless/config/environment.yml)}
The error is Incorrect type. Expected "Aws.Environment"
The format of the external file is just a simple list of key: value
pairs. I tried nesting them under various keys such as additionalProperties
but the validation did not work. Is this possible?
I am struggling with CORS. Is there some common gotchas?
The end point in question in my serverless.yml
getAuctions:
handler: src/handlers/getAuctions.handler
events:
- http:
method: GET
path: /auctions
authorizer: ${self:custom.authorizer}
cors: true
in my authorizer
resources:
Resources:
GatewayResponse:
Type: "AWS::ApiGateway::GatewayResponse"
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: EXPIRED_TOKEN
RestApiId:
Ref: "ApiGatewayRestApi"
StatusCode: "401"
AuthFailureGatewayResponse:
Type: "AWS::ApiGateway::GatewayResponse"
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: UNAUTHORIZED
RestApiId:
Ref: "ApiGatewayRestApi"
StatusCode: "401"
and in my React front end i get the error:
Access to XMLHttpRequest at 'https://{{URL}}/dev/auctions' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I am fairly new to serverless, am I missing a well known issue here?