'deploy aws' not making cloudfront?

hi. I am newbie.

when I did try

yarn rw deploy aws

it does well. but not creating cloudfront.
I thought this command would create cloudfront, so I could connect to that url directly just as serverless framework did to next.js, But It seems like I had mistaken.
if it does not create cloudfront, yarn rw deploy aws is what for ? could I treat the static files (that is stored in s3) and serverless functions manually ?

I know It will be solved just using netlify. but in my experience, site performance is faster when deploying aws directly than deploying netlify (I don’t know why it is). the second reason is that now I’m modifying official document about AWS Serverless Deploy . I think this doc need to be more detail. If not, many user will be frustrated just like I did. but I couldn’t find any extra information about it.

thank you for reading and ask for your understanding for English (english is not my 1st language).

Hi @coleea Newbies are :100: welcome here!

You are correct. The current deploy aws implementation does not include deploying the web assets on Cloudfront, which means it is only for deploying the api/dist to AWS Lambdas.

It’s a community contribution and just didn’t get finished.

You can add the config for deploying the web/dist assets to Cloudfront. Under the hood, this deployment uses the serverless.com framework. Take a look at these docs:

If all that seems too complicated to get started but you still want to manage your own deployment on AWS, check out running Redwood in a traditional server via Docker (or otherwise). Some docs and threads about this:

thank you for great answer as before. :grinning:

I undertand what is going on now.

So I could write document referring your answer. I hope implementing 'deploy aws ’ will be completed in near future. if so, I assume quite a many people would join in this community. :+1:

1 Like

^^ This would be very welcome! And we could use your document to help finish the implementation.

Please keep me posted. Either here in the Forums or on GitHub Issues.

Have you made any progress on this @coleea ?

My app is a little disjointed being deployed on netilfy, but with a few extra endpoints deployed using serverless, to learn a thing or two from you if you got it working.

In the mean time if I wanted to have the backend deployed on aws with serverless but still have the client server with netlify’s CDN, is the main thing I need to be concerned with is changing the apiUrl in redwood.toml to be an absolute path to the serverless api endpoint @thedavid?

Have you seen the new config options?

Should be gtg!

Also, you can deploy static assets to Netlify via CLI!!

I tried few things but It didn’t work well.

I think it is needed to do reverse-engineering(?) about serverless framework because we want to mimic serveerless framework.

I did try some reverse-engineering but It was hard. It didn’t work well.

It will be good if you reference the link @thedavid mentioned below.

I hope you do it well :+1:

1 Like

Sorry it’s taken me a while to get back you on this one.

I think I’m at the point where a few pointers of where to investigate would be useful, regarding auth.

I’m happy that I’ve been able to get all of my endpoints, including the lambda-containers deployed all together.

service: cadhubapi
stage: dev
region: us-east-2
stack: cadhubapi-dev
resources: 46
api keys:
  None
endpoints:
  POST - https://9inkvuvxz5.execute-api.us-east-2.amazonaws.com/dev/openscad/preview
  POST - https://9inkvuvxz5.execute-api.us-east-2.amazonaws.com/dev/openscad/stl
  POST - https://9inkvuvxz5.execute-api.us-east-2.amazonaws.com/dev/cadquery/stl
  GET - https://uk5gegwopd.execute-api.us-east-2.amazonaws.com/.netlify/functions/check-user-name
  POST - https://uk5gegwopd.execute-api.us-east-2.amazonaws.com/.netlify/functions/check-user-name
  GET - https://uk5gegwopd.execute-api.us-east-2.amazonaws.com/.netlify/functions/graphql
  POST - https://uk5gegwopd.execute-api.us-east-2.amazonaws.com/.netlify/functions/graphql
functions:
  check-user-name: cadhubapi-dev-check-user-name
  graphql: cadhubapi-dev-graphql
  openscadpreview: cadhubapi-dev-openscadpreview
  openscadstl: cadhubapi-dev-openscadstl
  cadquerystl: cadhubapi-dev-cadquerystl

However I’m having trouble with auth. It’s a cors error, but I suspect it’s something else revealing itself as cors as other requests to the same endpoint (graphql) don’t have cors issues. Specifically the request of

query __REDWOOD__AUTH_GET_CURRENT_USER { redwood { currentUser } }

comes back as a cors error. Could having this deployed on a different domain cause issues here?

For reference the goTrue setup in the frontend still points at the main domain, and that seems to be working as far as fetching the token is concerned.

const goTrueClient = new GoTrue({
  APIUrl: 'https://cadhub.xyz/.netlify/identity',
  setCookie: true,
})

We definitely need docs about CORS. Try this for now:

There are some CORS docs for GraphQL here: Docs - GraphQL : RedwoodJS Docs

1 Like

Oh awesome, thanks @thedavid, @dthyresson, I’ve added that config to the handler but am still getting the same error. I’ve left a comment in the thread David posted to keep the CORS conversation together.