We have decided that AppSync would be an excellent tool for our React Native app development. However, the problem is the scalability in development. Looking through Google entire day to find a way to do AppSync development offline so that anyone can freely create APIs and merge them, I realized that there is no such solution.
So how do large teams develop native apps using AppSync? Do you create AppSync app for every developer you have so that each person can change their own API freely then some how merge that back into production AppSync app?
I really wish there were a way to develop APIs locally and use git to merge them and upload the code directly to AppSync. As far as I know this is not possible but if you do know of a way or a different way, please let me know.
You can source control the entire AWS AppSync configuration including the endpoint, schema, resolvers, data sources, and any other AWS resources with AWS CloudFormation. Adrian's article walks thru the entire process. The ChatQL sample on GitHub contains a CloudFormation document and GraphQL schema that you can also use as a reference.
Once you've modeled AppSync and resources with CloudFormation, you can easily replicate your environment as many times as you want. Hence, you can either set up separate endpoints per developer or use a shared endpoint. I prefer the former since it provides isolation between developers.
You can also use the serverless framework to manage your AppSync endpoints with this plugin: https://github.com/sid88in/serverless-appsync-plugin
It also states, that it supports an offline mode for local development. Although, I didn't test it yet. But this can come in handy, when you want to pre-test your AppSync in a CI/CD environment.
Related
I have an AWS AppSync API (maybe like 80% done) and I'd like to create environments for staging, development, production, etc. My initial googling led me to using Amplify to create environments but I didn't see anything about making environments for existing APIs. I've been using the console to develop the API (in case this detail is important). I'm new to using AWS so I'm not really sure what to look for but my question is how do I create different environments for my existing AppSync API?
AWS Amplify and the "Applications" feature within AWS Lambda seem to have a few things in common:
Both seem to be a wrapper around several AWS resources
Both walk you through a guided setup to provision a working AWS stack
Both set up some CI/CD pipelines for you so that Git commits trigger a build and deploy
So what are the differences between these two services, and what are some scenarios where you might want to choose one over the other?
AWS Amplify is a toolchain for front-end developers to interact with AWS resources. It provides a cli program to manage resources and (JS/Android/iOS) libraries to integrate them into your front-end applications.
It doesn't 'wrap' resources, but is merely a convenience layer to manage them (it is somewhat similar to AWS SAM); Amplify generates CloudFormation templates, stores those locally, and uses aws-cli to provision them. Note that Amplify can also be used just as a front-end library to integrate resources that are already set up.
AWS Lambda Applications is an actual AWS service, or rather a feature of AWS Lambda. It groups related resources, so they can be managed and deployed as if it was a single resource.
... what are
some scenarios where you might want to choose one over the other?
Amplify is aimed at web- and mobile developers: it allows them to manage backend resources without much backend knowledge.
It is not a matter of 'using one over the other'; they can actually be used in conjunction with each other.
I'm having some confusion here and wanted to see if someone can set me straight.
I'm using Amplify for a Vue app. It calls API Gateway which calls Lambda and all of this is set up manually but I want to use the power of IaaS and do it with SAM.
Amplify CLI includes the ability to add APIs/Functions and in turn creates the CloudFormation Templates and Stack, which is nice. However this doesn't seem to create the Amplify app itself aside from creating an empty app connected to no repo and of course the CLI only stretches to so many services.
I see that it IS possible to configure an Amplify app in CloudFormation. And SAM comes with command line tools that'd be useful as well. What is the correct way to set all this up??
Can I create a SAM template for Amplify creation that works with the Stack created by Amplify to make API/Functions rather than manually building the SAM Template without auto generated assistance? Then if I add non-Amplify-supported Services later I can add them to the SAM as well.
I'm having a time trying to navigate SAM/CF/CDK/Amplify haha
I hope this helps. Lets start with your easier issues:
I'm having a time trying to navigate SAM/CF/CDK/Amplify haha
Yea.
AWS CF (Cloudformation) is aws's go at giving use a way to create(/rud) AWS resources using a templating engine. Its rather massive. And odd. Here's an example from the User Guide
Here is a JSON template to Create a simple DynamoDB table.
Here is that same template from the Designer Link next to it
Here is a pastebin version : 1QNXGTdZ
If the above brings up questions like, Why are both templates different? You are not alone. Overall, CF is massive but pretty neat as it lets you create/rud AWS resources
AWS SAM (Serverless Application Model) IMO is version of CF that is a lot simpler/easier. Here you can CRUD AWS Resources and organize them in a stack.
Note: SAM uses CF under the hood.
Amplify is a framework to make working with cognito (login) , aws js sdks, and more. It can take your vue/react app and add services such as, api, authentication, and document (dynamodb). For a node app, it stores config information in a file calls "aws-exports.js". Amplify can also help you deploy and store your codebase.
If you create any resources using the amplify cli, it uses CF under the hood. I believe all the files get stored in folder named ".amplify". IMO, its not fun as its hard to manage things later on using Amplify CLI or AWS console.
Can I create a SAM template for Amplify creation that works with the Stack created by Amplify to make API/Functions rather than manually building the SAM Template without auto generated assistance?
Yes. Just keep on using that Amplify CLI. Once that stops being fun use the AWS Console.
Then if I add non-Amplify-supported Services later I can add them to the SAM as well.
Also yes. You can create a new SAM stack any time with lambda's, userpools, etc and them connect to them with your Amplify applications new found AWS SDKs.
From my limited experience:
give AWS SAM a shot. Its simple and easier to get than CF
I never use the Amplify CLI anymore. It was neat in the start, but I've outgrown it as running the commands gives me a headache in comparsion to the SAM template defintions
I am currently looking into AWS Amplify as well as I am reading Serverless Stack. My goal is to create a simple ToDo list app. Both "Getting started" / Documentations seem to have the same goal. However, AWS Amplify guide seems to be way easier from the setup.
And that's where I am confused. As far as I understand AWS Amplify also uses DynamoDB and gets data via GraphQL. But where is the difference between these two documentations?
Serverless Stack is a resource providing guidance on how to create serverless applications with AWS. It was created by a company called Anomaly Innovations.
AWS Amplify is an open source framework maintained by AWS which helps developers integrate their applications with AWS resources.
AWS Amplify is a very confusing service and consists of many components. I would categorize as follow.
AWS Amplify Console
AWS Amplify CLI
AWS SDK&Libraries to integrate to your mobile or web
AWS Appsync Transformer
AWS Amplify Console gives you the ability to easily to setup Continous Deployment for your Amplify project. Amplify Console use together with AWS Amplify CLI for you to manage different environments.
Let's say you want to start the Todo App. You start on your local using Amplify CLI and create API Gateway/Lambda/DynamoDB stacks.
Amplify CLI lets you create the whole stack easily and push it to AWS to deploy the whole stack. Then you can create a different environment based on the same stacks, let's say you want your dev environment, and QA environment and production environment.
Amplify CLI gives you all the commands necessary for you to achieve this, then if you want to auto-deploy the change to AWS when someone push the code to your Git repository, you can use the Amplify Console to set up exactly that.
Amplify Console also integrate with AWS Domain so, you can easily point your own domain to any of the environment.
On top of these, Amplify also provides, GraphQL Transformer, which you can easily define the GraphQL schema in Amplify format and it will transform and deploy to AWS Appsync. And there is a Mobile SDK which you can sync data between AppSync and you're mobile and provides some UIs as well.
We used one of our web projects and we liked it for Continues Deployment aspect of the Amplify, but we didn't like the AppSync(GraphQL) aspect of Amplify just b/c it was not easy to implement layered resolver.
Also, keep in mind that Amplify CLI/SDK/Transformer is under one project and it's still very fragile. You can take a look at the version history from https://www.npmjs.com/package/#aws-amplify/cli and you will see few version bump just in a single month. There were many obvious bugs we encounter, even on the AWS Console.
I haven't use the Serverless yet, but as long as I know, Serverless provides No1 and No2 of Amplify with greater stability.
What's the best way to migrate from Firebase to AWS? I want to change the service because Ive read that AWS is way better than Firebase for apps that require a large user base. What would you recommend? I was using almost everything on Firebase (Login, Database, Storage).
As far as my knowledge, there is no straight forward solution to migrate the data from Firebase to AWS.
My suggestion would be export the data from Firebase and write a script in your favourite language and upload it in AWS.
See, Firebase is based on Google Cloud Platform(GCP) and you cannot just directly shift from Firebase to AWS. For this task, you may talk to Google Cloud support and ask them about this. Well, I don't think that this would even work as AWS and Firebase are a lot different and so, people are told to choose their first cloud service wisely.