-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Hi... I was getting a 403 AccessDeniedException repeatedly when running nuclearpond in my environment.
I've successfully deployed via terraform and can test the lambda via CLI and Python boto3, getting expected results.
However, when running nuclearpond the invokeFunction was always failing and returning a 403 / AccessDenied.
I looked at https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/lambda-go-example-run-function.html and since I was getting desperate, I changed the code to more or less exactly match what was there.
I was a little surprised when that actually worked. I'm not sure the difference but using the following implementation for invokeFunction gave me no errors at all. Can anyone else reproduce this behavior or is this a "me" thing?
// Execute a lambda function and return the response
func invokeFunction(payload string, functionName string) (string, error) {
// Create a new session
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
// Create a Lambda service client.
svc := lambda.New(sess, &aws.Config{
Region: aws.String("us-east-1")},
)
// Create the input
input := &lambda.InvokeInput{
FunctionName: aws.String(functionName),
Payload: []byte(payload),
}