by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jeff Finley
    @quickliketurtle
    @RoniFinTech seeing the related schema would help. But I’d look at the data you are writing with each request and make sure the unique ids are different. With dynamo that is the partition and sort key. The condition expression could be failing it a record with the same key already exists.
    @dantasfiles when you use the @key directive a GSI is created on the dynamo table. So new operations are created that target the GSI rather than the table itself.
    Radu
    @raduoprea
    @aftabahmed1286 Hey AfyGit! Did you find a solution for the "API category is not configured" error?
    Daniel S. Dantas
    @dantasfiles
    @quickliketurtle Amplify creates a gsi if it's a named key. if the @key directive doesn't have a name, then it specifies the primary key of the underlying table.
    In both those examples, the primary key is just id, and the underlying dynamodb table Todo is the same, but the graphql schema and resolvers that are generated by Amplify are different, which drives my spider-sense crazy
    Jeff Finley
    @quickliketurtle
    @dantasfiles Sorry I didn’t catch that in your question… So just to cleafiy if you generate queried is the first scheme, then seperatly generate queries with the second schema, you’d expect them to be exactly the same right? But your seeing differences?
    Jeff Finley
    @quickliketurtle
    @dantasfiles Glad you found the reason for the differences.
    Do you have an Idea of what would be less clumsy?
    Daniel S. Dantas
    @dantasfiles
    @quickliketurtle nope, it's a hard problem, and anyone who cares enough to mess with the keys of their underlying dynamodb tables can certainly modify their resolvers to do whatever they want
    eliasericsson
    @eliasericsson
    @dantasfiles Thanks, what I gather from the queries.js is that I have to provide an ID of the record I want. Here I'm looking for something like select ID where GUID like '<my-provided-guid>'
    @dantasfiles I guess what I'm after is to replace the ID that was generated for the records with one that I set, namely my GUID.
    Daniel S. Dantas
    @dantasfiles
    @eliasericsson when you create a Todo, you can specify an id, or, if you omit an id, the createTodo resolver that amplify generates will put a uuid into the id field of the created Todo, so I'm not sure what you mean by "replace the ID that was generated for the records with one that I set"
    eliasericsson
    @eliasericsson

    @dantasfiles Ok, here are the fields:
    id: ID!
    status: String!
    guid: String!
    region: String!
    upload_bucket: String
    upload_key: String

    Instead if using the ID as the key, I think I wan't to use my own guid. The ID can be dropped as it isn't used

    All in all, this is my schema:
    type Upload
      @model
      @auth(
        rules: [
          {
            allow: owner
            queries: [get, list]
            mutations: [create, update, delete]
          }
          {
            allow: groups
            groups: ["Director"]
            queries: null
            mutations: [create, update, delete]
          }
          {
            allow: groups
            groups: ["Audience"]
            queries: [get, list]
            mutations: null
          }
        ]
      )
      @key(
        fields: [
          "guid"
        ]
      )
      {
      id: ID!
      status: String!
      guid: String!
      region: String!
      upload_bucket: String
      upload_key: String
    }
    Daniel S. Dantas
    @dantasfiles

    if you have

    type Todo @model {
      id: ID!
      status: String!
      region: String!
      upload_bucket: String
      upload_key: String
    }

    then the following creation graphql operation gets generated by amplify:

    input CreateTodoInput {
      id: ID
      status: String!
      region: String!
      upload_bucket: String
      upload_key: String
    }
    type Mutation {
      createTodo(input: CreateTodoInput!, condition: ModelTodoConditionInput): Todo
    }

    which is what you want, you can specify the id when you create the Todo, or if you leave it out, amplify will create one for you

    eliasericsson
    @eliasericsson
    I'm kicking myself a little :) If I can just put in my guid as the ID then I'll be fine :)
    Daniel S. Dantas
    @dantasfiles
    @eliasericsson 🎉
    eliasericsson
    @eliasericsson
    @dantasfiles Thanks!
    Clay Mitchell
    @claym
    anybody have a good explanation on how to sort app sync query results using dynamodb?
    Waldo Lavaut
    @waldothedeveloper
    @waldothedeveloper
    Quick question: I need to use Twilio to send SMS, so using Amplify I created a lambda function, and API Gateway, and a React frontend...I sort of adapted this: https://github.com/serverless/examples/tree/master/aws-node-twilio-send-text-message but I'm getting this error:
    ERROR: aws-serverless-express error
    TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Object
    exports.handler = (event, context) => { console.log(`EVENT ON BACK_END HANDLER FUNC: ${JSON.stringify(event)}`); awsServerlessExpress.proxy(server, event, context); };
    Obviously the handler function event is getting an Object
    so that's why I gess is complaining
    Waldo Lavaut
    @waldothedeveloper
    Nevermind...I figured it out
    CWEBCONSULTANTS
    @cWebCo
    Hello
    i am using aws amplify, i did everything correct
    i had a problem in showing loader when click on signin or any other button
    .
    rathoregee
    @rathoregee
    morning all, is there a way to skip OCID (azure ad) /Auth.federatedSignIn() button? i meant i want to be redirect to with out pressing button. thanks
    Erich L Timkar
    @erich-team
    I added a reference to an API to a lambda function and then later removed it. Now, when I try to push to the environment, I’m receiving Parameters: [apilogsApiName] do not exist in the template
    Jeff Finley
    @quickliketurtle
    @frank-amplify_gitlab Just heard back for the SF Loft, they said registration is not open yet and to check back in a week or two.
    Erich L Timkar
    @erich-team
    Anyone know of a fix for this. I’m kind of stuck
    Jeff Finley
    @quickliketurtle
    @erich-team Sounds like there is some left over references in the cloudformation templates. Try searching the amplify/backendfolder for that reference.
    Erich L Timkar
    @erich-team
    @quickliketurtle Yeah, I even did a grep of file system looking for references to no avail. Ultimately, I re-added it and it pushes now, but it seems kind of hacky to hacky to have vestigial config lying around. Still not sure what went wrong, but I’ll try again at some point.
    Jeff Finley
    @quickliketurtle
    Totally shouldn’t leave config lying around. I’ll try to duplicate it and see if I can figure out what’s happening. If I can I’ll open a issue on github.
    Erich L Timkar
    @erich-team
    Ah, that would be really cool.
    rathoregee
    @rathoregee
    amplyfy is not stroing any thing (tokens) in local storage after successful login to azure idp via cogntio
    Taha Saleh
    @Tee88

    Hello Everyone
    I am currently working on a serverless backend using AWS Lambda and API Gateway. On the frontend side there are two developers, iOS and Android. I decided to use Cognito for our Auth and I am trying to provide the app developers with the correct documentation for them to follow. Also, I am trying to have minimum friction between the app developers and the backend.

    Anyways, when I visit the AWS Mobile SDK Documentation page https://docs.aws.amazon.com/mobile-sdk/ , both the SDKs for iOS and Android redirect me to the AWS Amplify framework's website. I have previously used Amplify for a web based app and loved it. However, when I visit the iOS and Android "getting started" pages I find a note saying that Amplify iOS and Android are "in preview mode and not intended for production usage at this time". That said, When I went to the "Android/iOS SDK 2.0" pages I realised that one of the prerequisites is "installing and configuring Amplify CLI" .

    My questions are:

    I would also appreciate if anyone could share a production-supported step-by-step tutorial for integrating iOS/Android with Cognito?

    Thanks

    Daniel S. Dantas
    @dantasfiles

    @Tee88

    I would also appreciate if anyone could share a production-supported step-by-step tutorial for integrating iOS/Android with Cognito?

    https://github.com/awslabs/aws-sdk-ios-samples
    https://github.com/awslabs/aws-sdk-android-samples

    Jun
    @Jun711
    Hi, should I import API using import API from '@aws-amplify/api'; or import API from 'aws-amplify';?
    Jeff Finley
    @quickliketurtle
    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.
    Brandon Shega
    @BrandonShega
    Does anyone here use SAML via Okta for the federated login? I'm trying to log users in, I get a token back but when I try to call Auth.federatedSignIn() I'm getting an error: NotAuthorizedException: "Invalid login token. Issuer doesn't match providerName"

    This is how I'm calling it

          const user = {
            name: 'test',
            email: 'test@test.com'
          };
          await Auth.federatedSignIn('okta', { token: token, expires_in: expires_in }, user);

    where okta is the name of the provider that is in the token.

    token is the idtoken from okta
    Taha Saleh
    @Tee88
    @dantasfiles Thank you, I will take a look at it :)
    Daniel S. Dantas
    @dantasfiles

    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?

    Jun
    @Jun711

    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.

    Jeff Finley
    @quickliketurtle
    You’ll need to add Auth.configure(); as well.
    Jun
    @Jun711
    @quickliketurtle Yes, I have Auth.configure({ Auth: { identityPoolId: ... }}; and API.configure({ API: { endpoints: [...]}});
    Daniel S. Dantas
    @dantasfiles
    the PreSignup example uses 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
    Jeff Finley
    @quickliketurtle
    @dantasfiles I generally do both, so user friendly messsage in callback, and console.log developer friendly message / error message / stack tracks / etc…
    Daniel S. Dantas
    @dantasfiles
    @quickliketurtle ok, thanks!
    Nick Bagley
    @timeconsumer_gitlab
    Anyone else ever run into an issue where the amplify build when hooked into a git repo overwrites the environment variables specified in PreSignup, CustomMessage, ...etc lambdas on the build?
    Kristine Olberg
    @krisolberg_gitlab
    Does the Amplify custom auth challenge support reCAPTCHA version 3? It wouldn't seem to since the documentation says, "VerifyAuthChallengeResponse will run when the Auth.sendCustomChallenge function is called with the data that is returned when the user interacts with the Google reCaptcha component." With reCAPTCHA version 3 there is no explicit user interaction with the component--it works behind the scenes. But am I missing something?