AWS Cloud demo refresh

This commit is contained in:
SheetJS 2024-06-13 22:37:39 -04:00
parent 04d513b889
commit 5c895ea38b
5 changed files with 34 additions and 21 deletions

@ -33,7 +33,7 @@ will be available in the future.
:::note Tested Deployments
This demo was last tested on 2023 October 01.
This demo was last tested on 2024 June 13.
:::
@ -234,63 +234,70 @@ free requests per month and 400 thousand GB-seconds of compute resources.
#### Create Project ZIP
1) Create a new folder and download [`index.js`](pathname:///aws/index.js):
1) Create a new project folder:
```bash
mkdir -p SheetJSLambda
cd SheetJSLambda
```
2) Download [`index.js`](pathname:///aws/index.js):
```bash
curl -LO https://docs.sheetjs.com/aws/index.js
```
2) Install dependencies in the project directory;
3) Install the SheetJS NodeJS module and `busboy` dependency:
<CodeBlock language="bash">{`\
mkdir -p node_modules
npm i https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz busboy`}
</CodeBlock>
3) Create a .zip package of the contents of the folder:
4) Create a .zip package of the contents of the folder:
```bash
yes | zip -c ../SheetJSLambda.zip -r .
zip -c ../SheetJSLambda.zip -r .
```
#### Lambda Setup
4) Sign into the [AWS Management Console](https://aws.amazon.com/console/) with
5) Sign into the [AWS Management Console](https://aws.amazon.com/console/) with
a root user account.
5) Type "Lambda" in the top search box and click Lambda (under Services).
6) Type "Lambda" in the top search box and click Lambda (under Services).
6) Open "Functions" in the left sidebar.
![AWS search for "Lambda"](pathname:///aws/lambda.png)
7) Open "Functions" in the left sidebar.
If the left sidebar is not open, click the `≡` icon in the left edge of the page.
7) Click the "Create function" button in the main panel.
8) Click the "Create function" button in the main panel.
8) Select the following options:
9) Select the following options:
- In the top list, select "Author from scratch" (default choice)
- Type a memorable "Function Name" ("SheetJSLambda" when last tested)
- In the "Runtime" dropdown, look for the "Latest supported" section and select
"Node.js" ("Node.js 18.x" when last tested)
"Node.js" ("Node.js 20.x" when last tested)
- Expand "Advanced Settings" and check "Enable function URL". This will display
a few sub-options:
+ "Auth type" select "NONE" (disable IAM authentication)
+ Check "Configure cross-origin resource sharing (CORS)"
9) Click "Create function" to create the function.
10) Click "Create function" to create the function.
#### Upload Code
10) In the Interface, scroll down and select the "Code" tab.
11) In the Interface, scroll down and select the "Code" tab.
11) Click the "Upload from" dropdown and select ".zip file".
12) Click the "Upload from" dropdown and select ".zip file".
12) Click the "Upload" button in the modal. With the file picker, select the
13) Click the "Upload" button in the modal. With the file picker, select the
`SheetJSLambda.zip` file created in step 3. Click "Save".
:::note pass
@ -299,21 +306,21 @@ editor will load the package.
:::
13) In the code editor, double-click `index.js` and confirm the code editor
14) In the code editor, double-click `index.js` and confirm the code editor
displays JavaScript code.
#### External Access
14) Click "Configuration" in the tab list.
15) Click "Configuration" in the tab list.
15) In the sidebar below the tab list, select "Function URL" and click "Edit".
16) In the sidebar below the tab list, select "Function URL" and click "Edit".
16) Set the "Auth type" to "NONE" and click Save. The page will redirect to the
17) Set the "Auth type" to "NONE" and click Save. The page will redirect to the
Function properties.
17) Select the "Configuration" tab and select "Permissions" in the left sidebar.
18) Select the "Configuration" tab and select "Permissions" in the left sidebar.
18) Scroll down to "Resource-based policy statements" and ensure that
19) Scroll down to "Resource-based policy statements" and ensure that
`FunctionURLAllowPublicAccess` is listed.
If no policy statements are defined, select "Add Permission" with the options:
@ -469,6 +476,8 @@ a root user account.
2) Type "S3" in the top search box and click S3 (under Services).
![AWS search for "S3"](pathname:///aws/S3.png)
3) Open "Buckets" in the left sidebar.
If the left sidebar is not open, click the `≡` icon in the left edge of the page.
@ -491,6 +500,8 @@ If the left sidebar is not open, click the `≡` icon in the left edge of the pa
7) Type "IAM" in the top search box and click IAM (under Services).
![AWS search for "iam"](pathname:///aws/iam.png)
8) Open "Users" in the left sidebar.
If the left sidebar is not open, click the `≡` icon in the left edge of the page.
@ -517,6 +528,8 @@ Click "Next".
17) In the "Permissions policies" section, search for "AmazonS3FullAccess".
There should be one entry.
![AWS search for "AmazonS3FullAccess"](pathname:///aws/perm.png)
18) Check the checkbox next to "AmazonS3FullAccess" and click the "Next" button.
19) In the "Review" screen, click "Add permissions"

BIN
docz/static/aws/S3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
docz/static/aws/iam.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
docz/static/aws/lambda.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
docz/static/aws/perm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB