sanfrancesco / prerendercloud-lambda-edge

Pre-render CloudFront with this Lambda@Edge function. Powered by https://headless-render-api.com (formerly named prerender.cloud from 2016 - 2022)
https://headless-render-api.com
MIT License
206 stars 35 forks source link

Missing required key 'Bucket' in params #15

Closed ali-v-1985 closed 5 years ago

ali-v-1985 commented 5 years ago

Base on step 9 of the README.md I should run this command. CLOUDFRONT_DISTRIBUTION_ID=whateverYourDistributionIdIs make deploy

When I do that I keep getting this error. Missing required key 'Bucket' in params

No idea where how I should pass this Bucket in params.

jotto commented 5 years ago

Can you paste the output of the make deploy command?

This might be due to insufficient AWS permissions for the account being used by the underlying serverless lib (from ~/.aws/credentials)

It may also require deleting the stack and starting over: ./node_modules/.bin/serverless remove

jotto commented 5 years ago

No idea where how I should pass this Bucket in params.

To answer this directly, there is no spot to pass this. This error typically means something went wrong with the CloudFormation stack that the serverless tool created, usually due to permission issues.

ali-v-1985 commented 5 years ago

I deleted the CloudFormation stack and gave enough privileges to the user and then it is solved.

The problem is that in step 9.4 it says

See the created Lambda function in CloudFront:

which are not created and I have to create the association of CloudFront and Lambda functions myself.

jotto commented 5 years ago

I deleted the CloudFormation stack and gave enough privileges to the user and then it is solved.

Thank you, I'll add this to the documentation

I have to create the association of CloudFront and Lambda functions myself

This should happen for you when you run make deploy (which also runs deploy.js)

ali-v-1985 commented 5 years ago

The problem was with the changing of service in servless.yml. With this modification I have to modify the function names in lambdaMappings constant in deploy.js.

There is 2 more things here. Firstly when I try to go to my website with domain name www.example.com it doesn't rout to index.html and instead of that the code below is showing up and I have to add index.html to url so it would be like this www.example.com/index.html

`

prerender-test.` Secondly I don't want my error pages show `404 - Not Found` and I want it to be redirect to index.html. Any suggestion?
ali-v-1985 commented 5 years ago

I dropped every thing and goes through tutorial steps again and it is all good. Works like a charm.