1
1
============================================
2
- Deploy to Serverless AWS Lambda with BrefPHP
2
+ Deploy to AWS Lambda with Bref
3
3
============================================
4
4
5
5
.. default-domain:: mongodb
@@ -19,21 +19,21 @@ Overview
19
19
In this tutorial, you will deploy a simple PHP application with the MongoDB PHP extension,
20
20
and connect to an Atlas cluster using AWS IAM authentication.
21
21
22
- Pre-requisites
22
+ Prerequisites
23
23
--------------
24
24
25
- Before you begin, you must install bref on your machine. You can follow the
25
+ Before you begin, you must install Bref on your machine. You can follow the
26
26
`official documentation to setup bref <https://bref.sh/docs/setup>`_.
27
27
28
- Install the mongodb extension
28
+ Install the MongoDB extension
29
29
-----------------------------
30
30
31
31
By default, the bref layer is compiled with PHP and a few extensions. Additional extensions
32
32
are provided in additional layers.
33
33
34
34
Start by creating a new directory for your project and install the required mongodb
35
35
and bref dependencies. This project will be a bare minimum PHP web application that
36
- connects to a MongoDB cluster, no framework is used, but you can adapt the code to
36
+ connects to a MongoDB cluster. No framework is used, but you can adapt the code to
37
37
your needs.
38
38
39
39
.. code-block:: bash
@@ -43,7 +43,7 @@ your needs.
43
43
vendor/bin/bref init
44
44
45
45
46
- A very simple web page have been created. To validate the deployment, you can start
46
+ The file ``index.php`` has been created. To validate the deployment, you can start
47
47
by deploying this default application.
48
48
49
49
.. code-block:: bash
@@ -89,9 +89,9 @@ Atlas supports passwordless authentication with AWS credentials. In any Lambda f
89
89
AWS sets environment variables that contains the access token and secret token with
90
90
the role assigned to deployed function.
91
91
92
- Set Up `unified AWS Access <https://www.mongodb.com/docs/atlas/security/set-up-unified-aws-access/>`
92
+ Set up `unified AWS Access <https://www.mongodb.com/docs/atlas/security/set-up-unified-aws-access/>`
93
93
94
- 1. Open the lambda function in the AWS console
94
+ 1. Open the Lambda function in the AWS console
95
95
2. In "Configuration > Permission", copy the "Role name"
96
96
3. Open the MongoDB Atlas project
97
97
4. Go to "Security > Database Access"
@@ -109,7 +109,7 @@ Update the ``serverless.yml`` file to pass the environment variable ``MONGODB_UR
109
109
110
110
provider:
111
111
environment:
112
- MONGODB_URI: "mongodb+srv://cluster0.abcdefg .mongodb.net/"
112
+ MONGODB_URI: "mongodb+srv://cluster0.example .mongodb.net/"
113
113
114
114
115
115
The value can be found in "Atlas > Deployment > Database > Connect". Select "3. AWS IAM".
0 commit comments