Skip to content

Commit 7ef009a

Browse files
committed
MM PR fixes 1
1 parent 8ee82a1 commit 7ef009a

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

source/aws-lambda.txt

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Deploy to AWS Lambda
2020
Overview
2121
--------
2222

23-
In this guide, you can learn how to use the tool `Bref
24-
<https://bref.sh>`__ to deploy serverless PHP applications on AWS
23+
In this guide, you can learn how to use `Bref
24+
<https://bref.sh>`__ to deploy serverless PHP applications to AWS
2525
Lambda. This guide demonstrates how to deploy a PHP application built by
2626
using the {+library-short+} and connect to an Atlas cluster by using AWS
2727
IAM authentication.
@@ -43,9 +43,9 @@ Install Dependencies
4343

4444
Bref uses `Lambda layers
4545
<https://docs.aws.amazon.com/lambda/latest/dg/chapter-layers.html>`__ to
46-
provide the PHP runtime. The ``bref`` layer is compiled with PHP and a
47-
few extensions. You can install extensions, such as ``mongodb``,
48-
in other layers.
46+
provide the PHP runtime. The ``bref`` layer integrates Bref into your
47+
application and is compiled with PHP and a few other extensions. You can
48+
install the other necessary extensions, such as ``mongodb``, in other layers.
4949

5050
The following commands create a new project directory and install the
5151
MongoDB and Bref dependencies:
@@ -69,23 +69,13 @@ After the commands complete, your project contains the following files:
6969
- ``index.php``: Defines a sample webpage
7070
- ``serverless.yml``: Configures the deployment
7171

72-
To validate your setup, try to deploy the default application. The
73-
following command deploys the application and returns a URL that renders
74-
a webpage that shows the Bref logo:
75-
76-
.. code-block:: bash
77-
78-
serverless deploy
79-
8072
Add the MongoDB Extension to Your Configuration
8173
-----------------------------------------------
8274

8375
After you initialize the project, you can add the ``mongodb`` extension.
8476
Locate the ``Serverless config`` name in the list of extensions provided
8577
by the :github:`bref/extra-php-extension <brefphp/extra-php-extensions>`
86-
package.
87-
88-
Add it to the ``layers`` of the function in the ``serverless.yaml``
78+
package. Add it to the ``layers`` of the function in the ``serverless.yaml``
8979
file, as shown in the following code:
9080

9181
.. code-block:: yaml
@@ -133,7 +123,8 @@ The following steps demonstrate how to set the role in your Atlas
133123
cluster:
134124

135125
1. Open the Lambda function in the AWS console.
136-
#. Enter :guilabel:`Configuration > Permission`, then copy the :guilabel:`Role name`.
126+
#. Navigate to :guilabel:`Configuration > Permission`, then copy the
127+
:guilabel:`Role name`.
137128
#. Add this role to your Atlas cluster in the :guilabel:`Database
138129
Access` section. Select the :guilabel:`AWS IAM` authentication method
139130
and set the built-in role ``Read and write any database``.
@@ -152,15 +143,17 @@ the Atlas documentation.
152143

153144
.. note::
154145

155-
Using VPC Peering is recommended to isolate your Atlas
156-
cluster from the internet. This requires the Lambda function to be
157-
deployed in this AWS VPC.
146+
Using Virtual Private Cloud (VPC) Peering is recommended to isolate
147+
your Atlas cluster from the internet. This requires the Lambda
148+
function to be deployed in the AWS VPC. To learn more, see
149+
:atlas:`Set Up a Network Peering Connection </security-vpc-peering>`
150+
in the Atlas documentation.
158151

159152
Next, copy your connection string and remove the ``<AWS access key>:<AWS
160153
secret key>`` section, as your credentials are read from environment variables.
161154

162-
Update the ``serverless.yml`` file in your project to set the
163-
environment variable ``MONGODB_URI`` to your connection string:
155+
In your project's ``serverless.yml`` file, set the
156+
``MONGODB_URI`` environment variable to your connection string:
164157

165158
.. code-block:: yaml
166159

0 commit comments

Comments
 (0)