Skip to content

Commit 1cace2d

Browse files
committed
Use :atlas: links
1 parent 99cebe4 commit 1cace2d

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

docs/tutorial/aws-lambda.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To deploy to AWS Lambda by using Bref, you must have the following components se
2323
- AWS account with access keys
2424
- Serverless Framework
2525

26-
To learn how to set these up, follow the `Setup tutorial<https://bref.sh/docs/setup>`__
26+
To learn how to set these up, follow the `Setup tutorial <https://bref.sh/docs/setup>`__
2727
in the Bref official documentation.
2828

2929
Install the MongoDB extension
@@ -49,9 +49,14 @@ Then initialize the serverless configuration using the ``bref`` command.
4949
$ vendor/bin/bref init
5050

5151

52-
This series of commands creates a file named ``index.php``. To validate your
53-
setup, try deploying this default application. This outputs a
54-
URL that renders a webpage with the Bref logo:
52+
After this series of commands, you should have this files:
53+
54+
- ``composer.json`` for PHP dependencies installed in the ``vendor`` directory
55+
- ``index.php`` a sample webpage
56+
- ``serverless.yml`` for the configuration of the deployment
57+
58+
To validate your setup, try deploying this default application. This outputs
59+
a URL that renders a webpage with the Bref logo:
5560

5661
.. code-block:: none
5762

@@ -78,8 +83,9 @@ will look like this:
7883
- ${bref-extra:mongodb-php-83}
7984

8085

86+
8187
Let's use the MongoDB driver with a web page that list planets from the Atlas
82-
`sample dataset <https://www.mongodb.com/docs/atlas/sample-data/>`__.
88+
:atlas:`sample dataset </sample-data/>`.
8389
Replace the contents of ``index.php`` with the following:
8490

8591
.. literalinclude:: /examples/aws-lambda/index.php
@@ -108,15 +114,14 @@ the role assigned to deployed function.
108114
2. In :guilabel:`Configuration > Permission`, copy the "Role name"
109115
3. Add this role to your Atlas cluster with the built-in Role: "Read and write any database"
110116

111-
To learn how to set up unified AWS access, see `Set Up Unified AWS Access
112-
<https://www.mongodb.com/docs/atlas/security/set-up-unified-aws-access/>`__ in the
113-
MongoDB Atlas documentation.
117+
To learn how to set up unified AWS access, see :atlas:`Set Up Unified AWS Access
118+
</security/set-up-unified-aws-access/>` in the MongoDB Atlas documentation.
114119

115120
Now that the permissions have been configured, the Lambda function is allowed to access
116121
your Atlas cluster. You can configure your application with the Atlas endpoint.
117122

118123
Access to Atlas clusters is also restricted by IP address. Since the range of IP that comes
119-
from AWS is very wide, you can `allow access from everywhere <https://www.mongodb.com/docs/atlas/security/ip-access-list/>`__.
124+
from AWS is very wide, you can :atlas:`allow access from everywhere </security/ip-access-list/>`__.
120125

121126
.. note::
122127

@@ -136,8 +141,8 @@ Update the ``serverless.yml`` file to pass the environment variable ``MONGODB_UR
136141
environment:
137142
MONGODB_URI: "mongodb+srv://cluster0.example.mongodb.net/?authSource=%24external&authMechanism=MONGODB-AWS&retryWrites=true&w=majority"
138143

139-
Finally, deploy with the new configuration. After deployment completes, you can access the function URL
140-
and see the list of planets from your Atlas cluster.
144+
Finally, deploy with the new configuration. After deployment completes, you can
145+
access the function URL and see the list of planets from your Atlas cluster.
141146

142147
.. code-block:: none
143148

0 commit comments

Comments
 (0)