Skip to content

Commit 02575c8

Browse files
committed
Rename
1 parent 8ec41e1 commit 02575c8

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

docs/examples/lambda-aws/serverless.yml renamed to docs/examples/aws-lambda/serverless.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ functions:
2020
- httpApi: '*'
2121
layers:
2222
- ${bref-extra:mongodb-php-83}
23-

docs/tutorial.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Tutorials
1616
/tutorial/encryption
1717
/tutorial/gridfs
1818
/tutorial/indexes
19-
/tutorial/lambda-aws
2019
/tutorial/tailable-cursor
2120
/tutorial/example-data
21+
/tutorial/aws-lambda
2222
/tutorial/modeling-bson-data
2323
/tutorial/stable-api

docs/tutorial/lambda-aws.txt renamed to docs/tutorial/aws-lambda.txt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
============================================
1+
==============================
22
Deploy to AWS Lambda with Bref
3-
============================================
3+
==============================
44

55
.. default-domain:: mongodb
66

@@ -15,28 +15,28 @@ Deploy to AWS Lambda with Bref
1515
Overview
1616
--------
1717

18-
`Bref <https://bref.sh>` allows to deploy serverless PHP applications on AWS Lambda.
18+
`Bref <https://bref.sh>`_ allows to deploy serverless PHP applications on AWS Lambda.
1919
In this tutorial, you will deploy a simple PHP application with the MongoDB PHP extension,
2020
and connect to an Atlas cluster using AWS IAM authentication.
2121

2222
Prerequisites
2323
--------------
2424

2525
Before you begin, you must install Bref on your machine. You can follow the
26-
`official documentation to setup bref <https://bref.sh/docs/setup>`_.
26+
`official documentation to setup Bref <https://bref.sh/docs/setup>`_.
2727

2828
Install the MongoDB extension
2929
-----------------------------
3030

3131
By default, the bref layer is compiled with PHP and a few extensions. Additional extensions
3232
are provided in additional layers.
3333

34-
Start by creating a new directory for your project and install the required mongodb
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
37-
your needs.
34+
Start by creating a new directory for your project and install the required MongoDB
35+
and Bref dependencies. This project will be a bare minimum PHP web application that
36+
connects to a MongoDB cluster.
3837

3938
.. code-block:: bash
39+
4040
mkdir bref-mongodb-app && cd bref-mongodb-app
4141
composer init
4242
composer require bref/bref bref/extra-php-extensions
@@ -47,10 +47,12 @@ The file ``index.php`` has been created. To validate the deployment, you can sta
4747
by deploying this default application.
4848

4949
.. code-block:: bash
50+
5051
serverless deploy
5152

53+
5254
Bref provides a Lambda layer with PHP and some very common extensions.
53-
Additional extensions are provided by the package `bref/extra-php-extension <https://github.com/brefphp/extra-php-extensions>`.
55+
Additional extensions are provided by the package `bref/extra-php-extension <https://github.com/brefphp/extra-php-extensions>`_.
5456

5557
.. code-block:: yaml
5658

@@ -67,16 +69,17 @@ Additional extensions are provided by the package `bref/extra-php-extension <htt
6769

6870

6971
Let's try to use the MongoDB driver with this simple web page that list planets
70-
from the `sample dataset <https://www.mongodb.com/docs/atlas/sample-data/>`.
72+
from the `sample dataset <https://www.mongodb.com/docs/atlas/sample-data/>`_.
7173
Replace the contents of ``index.php`` with the following:
7274

73-
.. literalinclude:: /examples/lambda-aws/index.php
75+
.. literalinclude:: /examples/aws-lambda/index.php
7476
:language: php
7577

7678

7779
Deploy the application
7880

7981
.. code-block:: bash
82+
8083
serverless deploy
8184

8285

@@ -89,7 +92,7 @@ Atlas supports passwordless authentication with AWS credentials. In any Lambda f
8992
AWS sets environment variables that contains the access token and secret token with
9093
the role assigned to deployed function.
9194

92-
Set up `unified AWS Access <https://www.mongodb.com/docs/atlas/security/set-up-unified-aws-access/>`
95+
Set up `unified AWS Access <https://www.mongodb.com/docs/atlas/security/set-up-unified-aws-access/>`_
9396

9497
1. Open the Lambda function in the AWS console
9598
2. In "Configuration > Permission", copy the "Role name"
@@ -113,7 +116,7 @@ Update the ``serverless.yml`` file to pass the environment variable ``MONGODB_UR
113116

114117

115118
The value can be found in "Atlas > Deployment > Database > Connect". Select "3. AWS IAM".
116-
You can remove the ``<AWS access key>:<AWS secret key>`` part from the URI, the credentials
119+
Remove the ``<AWS access key>:<AWS secret key>`` part from the URI, the credentials
117120
will be read from environment variables.
118121

119122
.. code-block:: bash

0 commit comments

Comments
 (0)