Google Chrome Extension POST to AWS DynamoDB? - amazon-web-services

I'm trying to set up a simple Google Chrome Extension that will pop up a form.
The form will collect first name, last name, career title, and other informations when the user uses the extension on a particular page.
Upon submit of the pop up form, the form will reach API Gateway that trigger Lambda to write data to DynamoDB.
I can't seem to find any documentations/guides/tutorials around how to connect Chrome Extensions to AWS services.
I was wondering if I setup a React Chrome Extension, and then install AWS Amplify. Upon build by Chrome, will the AWS Amplify work..?

I can't seem to find any documentations/guides/tutorials around how to connect
Chrome Extensions to AWS services.
From AWS perspective Chrome Extension is the same as real user, web site or any other client. Depending on a technical stack of you extension, you can use AWS API or SDK inside your extension to work with AWS.

Related

Find latest AWS API version for locking the version

AWS themselves mention that it's important to lock the API version you use to prevent any unexpected changes to API from breaking your code (see Locking API Versions).
However, I can't seem to find the latest API version for AWS Lambda. I want to pass this to AWS Boto3 (docs here). Where do I find the latest API version?
The page you referenced says:
Getting API Versions
To get the API version for a service, see the Locking the API Version section on the service's reference page, such as https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html for Amazon S3.
Therefore, the API version for Lambda can be found on:
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html
AWS's docs are terrible about including info for previous versions, or even what versions exist, or at least it sure seems that way for the AWS RDS API anyways.
This site seems to be the best way to find info about versions of the different AWS APIs:
AWS API Changes
Sadly, that site's home page doesn't seem to include anyway to filter for a specific service.
Thankfully, it does seem like you can do it 'manually':
Open AWS API Changes in your browser.
Perform an in-page search (via your browser) for the relevant service, e.g. "RDS".
Click on the header for any 'changes entry' for the relevant service. [Here is an example change entry for RDS.]
On the changes entry details page, there should be 'breadcrumb' links at the top, ex. "API Changes / Services / Amazon Relational Database Service / 2021-09-10".
Click the breadcrumb link for the service, e.g. "Amazon Relational Database Service".
Example for RDS API changes:
Amazon Relational Database Service – AWS API Changes

How to authenticate users with Aws Cognito and Aws Amplify

We are building an application with mobile authentication and we decided to use Aws. I searched a little and decided to use Aws Cognito. I read the documentation and while reading I noticed that, for the application side I need to use Aws Amplify. I tried some examples but I am not sure I understand the concept right.
Can you give me some insight about this model.
Amazon Cognito is a managed Identity Provider in the cloud, it provides you with a user repository, federation, GUI for signin, signup, lost password and other user flows, it supports OTP, email address verification etc ...
It can be integrated into your app through the provided UI or through its API if you want to control the look and feel of theusre interfaces.
Amplify is a command line tool and client library to make it easy to provision and to use cloud services, including Cognito, from your web or mobile application.
The Amplify CLI will help you to provision Cognito in the cloud, without requiring you to click through all the options in the console. The Amplify client side library will provide high level programming constructs to make it easy to access cloud based services, such as Cognito, from your apps.
You can watch this 45 minute talk that shows Amplify in action : https://www.youtube.com/watch?v=QxOcvOMnAuQ and this github repo with a sample application : https://github.com/sebsto/amplify-react-workshop

Is it necessary to use Amazon SNS when using Firebase Cloud Messaging (FCM) on AWS to send notifications?

I have an existing mobile app that can receive push notifications and I have an existing backend application that exposes an API for sending notifications to the app. The backend application uses Firebase Cloud Messaging (FCM), so it could be considered a wrapper around FCM. My backend application uses the Firebase Admin SDK to create messages and send them to Firebase. My customers hit an API exposed by my backend application (so, if we assume that the customer is using Postman, then the flow for sending a message is: Postman->My backend application->Firebase->Mobile app).
Until now I have been running my backend application on a local server, and it works fine. But now I need to deploy this on AWS. My question is: is it necessary to use Amazon SNS or not? I don't really need any additional functionality from AWS, I just want AWS to permit the required communication.
For example, I dont need to go to an AWS interface to enter the token to send messages to my phone. I already have an API exposed through my backend for sending messages. So, should I even bother to set up SNS?
I know that at a minimum I will have to make my firebase project google credentials available to my instance on AWS (in a file located at the path specified using GOOGLE_APPLICATION_CREDENTIALS). What other configuration steps would be needed? Thanks a lot.
After some investigation I found that it is not necessary to use Amazon SNS to achieve what I wanted to achieve.
I was able to deploy my server application (which uses Firebase Cloud Message) to AWS, and the messages arrive on the mobile phones without any problem.
I initialized my backend application using the steps described on the Google Firebase site: https://firebase.google.com/docs/admin/setup

AWS Mobile Hub: Sample code for web application

I like the friendly interface that AWS Mobile Hub provides to disparate Amazon services, but I'd like to use it to create a web application, rather than a native iOS or Android app.
It's not clear to me how to do so, since there's no option for javascript sample code or any mention of web applications:
Am I missing something? Is there documentation for this use-case elsewhere?
All of the resources that are configured by various features in Mobile Hub (e.g., NoSQL Database, Cloud Logic APIs) are usable directly from a web app in the browser. For example, you can turn on the App Content Delivery feature, enable web hosting on your Amazon S3 bucket, download/copy the AWS JavaScript SDK into your Amazon S3 bucket, and start writing your web app. The JavaScript SDK will allow you to interact with your Mobile Hub resources (found on the "Resources" page in the left Nav menu in Mobile Hub's console).
However, we do realize these steps are tedious and we have had similar feedback from other customers. So, we are actively working to make these steps easier.
In the meantime, you can get the AWS JavaScript SDK here:
https://aws.amazon.com/sdk-for-browser/
And, you may find some of our github samples are a good starting point, like this one:
https://github.com/awslabs/lambda-refarch-webapp
For those looking to build web apps, AWS has a JavaScript library called AWS Amplify that makes building cloud web apps easy: https://aws.github.io/aws-amplify/

Cannot create AWS-SNS GCM account, showing invalid credentials message

I have looked for resources on this particular problem with little luck so far so I thought I would try here.
I am attempting to create an Amazon Web Service Simple Notification Service app in the AWS-SNS console using GCM. I have created the APNS app for the iOS version with no troubles, however, when attempting to create the GCM version I receive the error: "The credentials you entered are invalid. Please enter valid credentials and try again."
In the Google APIs - API Access dashboard I have created both a key for server app and a key for android app. Below are a few screenshots to illustrate the problem.
Any suggestions as to what the problem may be or any instructional documentation recommendations would be tremendously appreciated.
More on what Rohan has said, it would be on Google's end rather than Amazon's.
Delete the Server API Key in the Google API Console, and create a new one, allowing all IP addresses. Add the new key in AWS SNS, and you should be good to go!
Amazon documentation is very old and not accurate anymore.
When you created your Application and the Credentials on Google Developers Console, from the left menu on Google developer console select:
APIs & auth -> APIs -> Google Cloud Messaging for Android -> Enable API
Google recently migrated a lot of the GCM service/credential handling to Firebase. As a result you need to create a Server Key in the Firebase Console now.
See: Amazon SNS: "Platform credentials are invalid" when re-entering a GCM API key that previously worked
You need to use the API key listed under Key for server apps (with IP locking) in the Google Console. The key listed under Android app will not work.
The Amazon SNS Getting Started with GCM documentation provides step-by-step guidance on setting up your app. If you are still having issues, please contact us via AWS Support or the Amazon SNS forum and we can troubleshoot further.
full disclosure: I am an Amazon SNS engineer.