Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-47690: aws lambda tutorial #207

Merged
merged 7 commits into from
Feb 20, 2025

Conversation

rustagir
Copy link
Contributor

@rustagir rustagir commented Feb 19, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-47690
Staging - https://deploy-preview-207--docs-php-library.netlify.app/aws-lambda/

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for docs-php-library ready!

Name Link
🔨 Latest commit 72ab637
🔍 Latest deploy log https://app.netlify.com/sites/docs-php-library/deploys/67b73d44aaaf400008d2fc9d
😎 Deploy Preview https://deploy-preview-207--docs-php-library.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@mcmorisi mcmorisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Commented with some open threads and suggestions.

Comment on lines 23 to 24
In this guide, you can learn how to use the tool `Bref
<https://bref.sh>`__ to deploy serverless PHP applications on AWS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S: Would suggest changing this to either the attached suggestion or just "how to use Bref"

Suggested change
In this guide, you can learn how to use the tool `Bref
<https://bref.sh>`__ to deploy serverless PHP applications on AWS
In this guide, you can learn how to use the `Bref
<https://bref.sh>`__ tool to deploy serverless PHP applications on AWS


Bref uses `Lambda layers
<https://docs.aws.amazon.com/lambda/latest/dg/chapter-layers.html>`__ to
provide the PHP runtime. The ``bref`` layer is compiled with PHP and a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to confirm that the bref layer (monospaced, lowercase) is different than Bref the tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ill reword to make this more clear

Comment on lines 83 to 89
After you initialize the project, you can add the ``mongodb`` extension.
Locate the ``Serverless config`` name in the list of extensions provided
by the :github:`bref/extra-php-extension <brefphp/extra-php-extensions>`
package.

Add it to the ``layers`` of the function in the ``serverless.yaml``
file, as shown in the following code:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Would combine this into one paragraph since it's discussing a single process.

Suggested change
After you initialize the project, you can add the ``mongodb`` extension.
Locate the ``Serverless config`` name in the list of extensions provided
by the :github:`bref/extra-php-extension <brefphp/extra-php-extensions>`
package.
Add it to the ``layers`` of the function in the ``serverless.yaml``
file, as shown in the following code:
After you initialize the project, you can add the ``mongodb`` extension.
Locate the ``Serverless config`` name in the list of extensions provided
by the :github:`bref/extra-php-extension <brefphp/extra-php-extensions>`
package. Add it to the ``layers`` of the function in the ``serverless.yaml``
file, as shown in the following code:

Comment on lines 114 to 123
Redeploy the application with the new ``index.php`` by running the
following command:

.. code-block:: bash

serverless deploy

The application page displays an error message because the ``MONGODB_URI``
environment variable is not set. The following section explains how to
set your connection string in an environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicted on this – I think it's helpful to tell readers to redeploy using the serverless deploy command once they update their index file, but I'm also unsure of telling readers to redeploy into a situation where they'll receive an error. You do have a section at the end that instructs readers to redeploy, so I think I lean towards cutting this part out. Let me know what you think!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed- can remove

cluster:

1. Open the Lambda function in the AWS console.
#. Enter :guilabel:`Configuration > Permission`, then copy the :guilabel:`Role name`.
Copy link
Contributor

@mcmorisi mcmorisi Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: When you say "Enter" is there a text entry field, or does Configuration > Permission refer to a page? If so, should this be "Navigate to Configuration > Permission"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Navigate is probs more appropriate

Comment on lines 155 to 157
Using VPC Peering is recommended to isolate your Atlas
cluster from the internet. This requires the Lambda function to be
deployed in this AWS VPC.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (also do you know what "this VPC" refers to?)

Suggested change
Using VPC Peering is recommended to isolate your Atlas
cluster from the internet. This requires the Lambda function to be
deployed in this AWS VPC.
We recommend using VPC Peering to isolate your Atlas
cluster from the internet. You must deploy Lambda function to this AWS VPC
to use VPC Peering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some context

Comment on lines 162 to 163
Update the ``serverless.yml`` file in your project to set the
environment variable ``MONGODB_URI`` to your connection string:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Update the ``serverless.yml`` file in your project to set the
environment variable ``MONGODB_URI`` to your connection string:
Update the ``serverless.yml`` file in your project to set the ``MONGODB_URI`` environment variable to your connection string:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reworded

@rustagir rustagir requested a review from mcmorisi February 19, 2025 20:19
Copy link
Contributor

@mcmorisi mcmorisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one callout!

Comment on lines 104 to 113
Redeploy the application with the new ``index.php`` by running the
following command:

.. code-block:: bash

serverless deploy

The application page displays an error message because the ``MONGODB_URI``
environment variable is not set. The following section explains how to
set your connection string in an environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part got left in, just checking you didn't mean to delete it instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird , yes meant to delete

@bisht2050
Copy link
Collaborator

LGTM, the only suggestion I have is to add "Bref" in the title of the page for SEO, since this tutorial (PHPLIB-1163) was focused towards Bref.
Something like Deploy to AWS Lambda with Bref

@rustagir rustagir merged commit 8ed8dde into mongodb:master Feb 20, 2025
5 of 7 checks passed
rustagir added a commit that referenced this pull request Feb 20, 2025
* DOCSP-47690: aws lambda tutorial

* fixes

* fixes

* fixes

* MM PR fixes 1

* remove section

* RB small fix

(cherry picked from commit 8ed8dde)
rustagir added a commit that referenced this pull request Feb 20, 2025
* DOCSP-47690: aws lambda tutorial

* fixes

* fixes

* fixes

* MM PR fixes 1

* remove section

* RB small fix

(cherry picked from commit 8ed8dde)
rustagir added a commit that referenced this pull request Mar 6, 2025
* use sharedincludes in compat page

* add source constants for versions

* delete files for old build system

(cherry picked from commit 55daa82)

* adds more info to v1.20 whats new

(cherry picked from commit 302bcd5)

* Fix compatibility table

(cherry picked from commit 4fba22f)

* (DOCSP-44298) Removed EOL'd v1.16 and earlier. (#165) (#166)

* DOCSP-44903 Shorten TOC Labels (#176)

* DOCSP-44903 Shorten TOC Labels

* rest of pages

* angle brackets

* fixes

* internal review

* updates based on Mike's PR

* review comments and consistency

(cherry picked from commit b9fda16)

* PHPLIB-1278: FAQ entry on connection persistence

* Address vale lint checks on word usage

* Docs edits

* Merge pull request #181 from mcmorisi/DRIVERS-2658-hint

DOCSP-45139: Add Hint option for Distinct operation

* (DOCSP-45749) Denests last phase 1 nested components (#182)

* (DOCSP-45749) Denests last phase 1 nested components

* Update build

* DOCSP-45100: Delete and rename by name (#187)

* DOCSP-45100: Delete and rename by name

* edits

* JM feedback

(cherry picked from commit 343f339)

* bring master changes into v1.21

* DOCSP-44644: db/coll accessor methods

* fix spacing

* vale action dependency

* vale action dependency

* DOCSP-45100: GridFS methods api docs (#196)

* DOCSP-45100: GridFS methods api docs

* edits

* RR feedback

* JT feedback

* DOCSP-45100: GridFS methods api docs (#196)

* DOCSP-45100: GridFS methods api docs

* edits

* RR feedback

* JT feedback

(cherry picked from commit 1442347)

* DOCSP-43365: type specification for createSearchIndex(es)

* indentation fix

* indentation fix

* add whats new entry

* indentation fix

* SA PR fixes 1

* DOCSP-43365: type specification for createSearchIndex(es)

(cherry picked from commit e09b124)

* indentation fix

(cherry picked from commit cd6a586)

* indentation fix

(cherry picked from commit 3b3ec37)

* add whats new entry

(cherry picked from commit f821030)

* SA PR fixes 1

(cherry picked from commit 7d9bfe8)

* DOCSP-43457: builderEncoder option (#200)

* DOCSP-43457: builderEncoder option

* fix

* fix type

* go back

* codec

* JT feedback

* DOCSP-43457: builderEncoder option (#200)

* DOCSP-43457: builderEncoder option

* fix

* fix type

* go back

* codec

* JT feedback

(cherry picked from commit e1ed056)

* DOCSP-44237 flags Option deprecation on v2.21 (#201)

* DOCSP-44237 flags Option deprecation on v2.21

* add what's new note

* Rea review comments

* DOCSP-45770: atlas search queries (#197)

* DOCSP-45770: atlas search queries

* fix indentation

* fix indentation

* fix indentation

* fix indentation

* snooty landing page

* snooty landing page

* indentation fix

* netlify trigger

* whats new

* RM PR fixes 1

* comments

* small fix

* JT tech review 1

* indentation fix

* fix

* small fixes

* small fixes

* remov Pipeline type

* DOCSP-45878: Transactions parallelism note (#204)

* DOCSP-45878: Transactions parallelism note (#204)

(cherry picked from commit ba91a37)

* DOCSP-43919: aggregation builder (#203)

* DOCSP-43919: aggregation builder

* indentation fix

* remov Pipeline type

* LM PR fixes 1

* fp fixes

* todo fixes

* small fixes

* JM tech review 1

* DOCSP-46127: Update manual link (#205)

* DOCSP-46127: Update manual link

* MW feedback

* DOCSP-46127: Update manual link (#205)

* DOCSP-46127: Update manual link

* MW feedback

(cherry picked from commit bf6ac8a)

* DOCSP-47690: aws lambda tutorial (#207)

* DOCSP-47690: aws lambda tutorial

* fixes

* fixes

* fixes

* MM PR fixes 1

* remove section

* RB small fix

* DOCSP-47690: aws lambda tutorial (#207)

* DOCSP-47690: aws lambda tutorial

* fixes

* fixes

* fixes

* MM PR fixes 1

* remove section

* RB small fix

(cherry picked from commit 8ed8dde)

* add redirect for aws lambda page

* change title to avoid duplicate

* change toc

* change url and add redirects

* add back old ref based on rea's feedback

* change redirect

* fix merge issues

* use regular includes on master

* DOCSP-47970: v1.21 release (#212)

* DOCSP-47970: v1.21 release

* JM combine v's

* JT small fix (#209)

* DOCSP-43464: operations with builders (#206)

* DOCSP-43464: operations with builders

* fix desc

* shared include fix?

* shared include fix?

* revert

* netlify trigger

* small fix

* LM PR fixes 1

* LM PR fixes 2

* link fix

* reformat comments

* JT tech review 2

* fix code example

* JT tech review comments

---------

Co-authored-by: Jordan Smith <[email protected]>
Co-authored-by: Elyse Foreman <[email protected]>
Co-authored-by: lindseymoore <[email protected]>
Co-authored-by: Jeremy Mikola <[email protected]>
Co-authored-by: Michael Morisi <[email protected]>
Co-authored-by: Sarah Simpers <[email protected]>
Co-authored-by: Nora Reidy <[email protected]>
Co-authored-by: Angela <[email protected]>
Co-authored-by: shuangela <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants