I'm working with Amplify Auth lambda triggers, and looking at the documentation
Errors thrown by Lambda triggers will be visible directly to your end users if they are using Amazon Cognito Hosted UI as query parameters in the Callback URL. As a recommended best practice, end user facing errors should be thrown from the Lambda triggers and any sensitive or debugging information should be logged in the Lambda trigger itself.
I don't understand what that means. I'm looking at the example files, and they all do different things, some console.warn
, some callback("error text");
, some callback(new Error("error text", event);
Can someone explain in simpler language what an end user facing error is?
aws-amplify
is the full sdk, the@aws-amplify/***
is just the relevent bits. So if all you are using is api then you can just import that.
Thanks @quickliketurtle
When I import API from @aws-amplify/api and import Auth from @aws-amplify/auth, I get 'No credentials available, the request will be unsigned'
when using API to send a post request to an API Gateway endpoint.
callback(new Error(Invalid email domain: ${domain}), event);
so I guess that's the style I'm going to go with, though I wonder if I should do a console.log
as well
Can anyone point me in the right direction to more information about how to use the ModelTodoFilterInput
? @dantasfiles provided some links to Query and Scan, but I wasn't able to put it together.
What I have is a Storage.list -operation that returns an array of 5 object. Each of these has a key-value pair. I would like to filter the response, so that I only get the 4 objects where the value partially matches a given string.
Eg.
// Given string: "filename1"
{
key: "path/filename1.jpg" // match
...
key: "path/filename2.jpg" // no match
...
key: "path2/filename1.jpg" // match
}
Expected response:
{
key: "path/filename1.jpg",
key: "path2/filename1.jpg"
}
amplify publish
as you have no frontend to publish to s3. So you should be using amplify push
to deploy your backend.
Hi everyone, I'm building a webapp with Amplify and I need a bucket with multiple folders.
Each folder must be accessible only by a specific Cognito group.
For example
Mybucket/firstClient
Mybucket/secondClient
And I have firstClient and secondClient cognito groups with multiple users inside.
Is there a way to model such a policy? Or is there another way to accomplish this?
/private/${cognito-identity.amazonaws.com:sub}/
could be ok, but I forgot to mention that the cognito admin group must be able to write in both of those "folders".I have the documentation schema.graphql
type Customer @model @key(fields: ["email"]) {
email: String!
username: String
}
I run amplify mock api
and run the mutation
createCustomer(input: {email: "bob@bob.com", username: "bob"}) {
email
username
}
I get the result:
Error while executing Local DynamoDB
...
ValidationException: One of the required keys was not given a value
amplify mock api
gets confused if you change tables and keys too often, I had to manually delete the mock dynamodb table file and let amplify mock api
rebuild a new one
in the example from the GraphQL transform documentation:
type Customer @model
@key(name: "byRepresentative", fields: ["accountRepresentativeID", "id"], queryField: "byRepresentative") {
id: ID!
accountRepresentativeID: ID!
...
}
Is there any difference between that and this different GSI (with no sort key "id")?
type Customer @model
@key(name: "byRepresentative", fields: ["accountRepresentativeID"], queryField: "byRepresentative") {
id: ID!
accountRepresentativeID: ID!
...
}
@key
directive