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
accountRepresentativeID
alone would be fine for that use case
federatedSignIn
?
Hey all! I'm trying to add the @key
directive to an existing model, but getting the following error:
✖ An error occurred when pushing the resources to the cloud
Attempting to edit the key schema of the ImageTable table in the Image stack.
An error occured during the push operation: Attempting to edit the key schema of the ImageTable table in the Image stack.
I'm not sure why that's happening?
My updated schema.graphql:
// amplify/backend/api/chainappterparty/schema.graphql
type Image @model @key(fields: ["createdAt"]) {
id: ID!
long: String!
lat: String!
image: String!
createdAt: String!
}
Previous schema.graphql:
type Image @model {
id: ID!
long: String!
lat: String!
image: String!
}