James Parsons
James Parsons

Reputation: 925

Using AWS Amplify allow access to an owner restricted model from a Lambda function using an API key

I have a model that is restricted to an owner currently. We need to be able to access and update all models from a background lambda process. This is currently possible when the model is set to public using and API key.

In production it has to be owner restricted. I have the below code that I have adapted from the docs.

https://docs.amplify.aws/lib/datastore/setup-auth-rules/q/platform/ios/#multiple-authorization-types-priority-order

Can anyone see any issues here or help with the best way to proceed?

type YourModel
 @model
  @auth(
    rules: [
        { allow: owner }
        { allow: private, provider: apiKey }
    ]
) {
}

Thank you

Upvotes: 1

Views: 77

Answers (0)

Related Questions