Deploying AWS chatbot without the use of the S3 Bucket - amazon-web-services

Im trying to integrate an AWS chatbot to my Website with the help from this github repository https://github.com/aws-samples/aws-lex-web-ui , and im trying to get this deployed completely locally which means the S3 bucket will not be used, only the "cognito id" will be used,is that possible?

Yes, that is possible. Take a look at the methods of integration:
Only Method 1 uses S3 Bucket. You probably want method 3 to create a stand-alone page or an embedded iframe. Here are the links to those directions:
Stand-alone Page
Embeddable iframe
Note that method 3 says to use the libraries from the dist folder. That is commonly overlooked.

Related

Which way I should choose for aws s3 bucket my website project by using nuxtjs

i really confused about using ssr or spa to my website. I'm planing publish on s3 bucket by static.
So my first quesiton is do i need nodejs or not for ssr on s3 bucket?
Second question is nuxtjs is using ssr for i know but and see on opitons 'spa'. Just I'dont understand i can use spa with vuejs why i need nuxtjs for spa?
Last question is when i choose the spa on options, see two options more.
*>Server (Node.js hosting)
*>Static (Static/Jamstack hosting)
and I notice on ssr mode these two options avaible there. So I can publish my nuxt project with ssr but static?
I really need your help people. Thanks

How can I hide an API key in a GitHub public repo?

I am doing a simple front-end project where I (or a user) make an API call to the openweathermap api, fetch weather info and display it on a website.
Simple HTML, CSS and vanilla JS
So I want to keep the repo public & host the site with GitHub Pages... but my js file contains the API key which is required at runtime.
Extra Info:
(all this I found when I searched)
I know there is a way to keep an API key in a GitHub secret, then reference it in a yml file as an environmental variable in GitHub Actions.
But how can I put that secret in js code at runtime for any user who access my website?
Please note that what you're attempting to do is not secure. Even if there was a way to get GH Pages to inject the secret API key into the js file at the time of the request, every web client would then have a copy of that js file with the cleartext key embedded.
You will need some sort of minimal backend which stores the API key securely and relays calls from your static web page to the openweathermap API.
There are many ways to set up such a backend. The older question linked in the comments discusses some approaches. Note that nowadays, you could use a serverless FaaS service such as AWS Lambda or Azure Functions.
This is a perfectly valid question by the way and you're certainly not "too dumb". Good luck!

How to correctly upload photos/files in a Django + Angular decoupled application to S3?

I have a decoupled applications build with Django 2, an API with DRF and an Angular 6 frontend application. I want to enable users to upload photos for their profiles, and probably in the future some pdfs, and after some research I figured out that the most convenient thing to do would be to store these files in an Amazon S3 bucket.
I have found numerous resources about how to upload files to an S3 bucket on both, Angular and Django, and now I was wondering what would be the best approach to do this in my decoupled application: should I manage it on the frontend and not use my backend at all? or should I pass the file from my angular to my Django app and then upload it to the bucket from there?
Some pros and cons of both approaches? It's my first time doing this and I haven't been able to find many resources for decoupled applications.
Any help is welcome! thanks!
The best practice
Anything related to data must be managed by your backend i.e Django, Angular is just a client.
You should pass the file from angular to Django app and then upload it
to the s3 bucket from there
Cons using client
Suppose in future, if you will develop mobile apps to consume your rest APIs then you need to rewrite the whole management there also.
You have to keep your s3 bucket API keys on the client and it is easily accessible to hackers.
dist folder size will be going to increase that will affect the load time of your site
If you are uploading files from client to S3 bucket, it will use the user's internet and in most of the cases it is slower than your sever's internet

optimising aws hosted app that generates and serves files using caching

I have an app composed of several microservices, all running as separate python lambda functions. The user-interface is a react app hosted on s3. The user inputs several variables which feed in to the serverless backend via API gateway, which generates a powerpoint file.
For a given set of variables the powerpoint output will be identical each time. As such, it makes no sense to regenerate and store the file each time. I looked into https://aws.amazon.com/elasticache/ but am unsure on how to integrate it here. Should I be storing these powerpoint files in s3 and only generating if the file is not already present, then serve a link pointing to the s3 bucket? This seems slow and cumbersome. What would be the most efficient way to serve up these powerpoint files repetitively?
You can use API gateway caching to cache data.
Goto api gateway => Click on "Stages" => stage_name => "Settings" tab => "Enable API caching"
More details here: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html
see below image

React Native AWS image upload

I am making an app in React native and will be using Amazon Web Services for image upload, I was wondering if the AWS node SDK can be used in my React Native app because I have read multiple outdated blogposts that said they were having issues, any one tried it out? (Node version: 4)
Thanks
The AWS Node SDK relies on several Node libraries like http that don't exist in React Native and are likely hard to reimplement faithfully. What I'd do is either use the native AWS SDKs and bridge them to JS, or write a small JS client just for S3 and look at the AWS Node SDK to see how they do authentication.
there is existing node packages like react-native-aws-signature that can help you do the authentication for AWS request for React-Native.
There is also a new library that has just been released to the official AWS repository which has full React Native support including a Storage module for interacting with S3 using signed requests: https://github.com/aws/aws-amplify