---
title: "Create a Lambda function"
canonical: "https://docs.infoblox.com/space/DeploymentGuideIntegratingB1TDwithAWSRoute53/664338670/Create%20a%20Lambda%20function"
format: markdown
---
To import TIDE feeds into the AWS Route 53 Domain list, API calls must be made. This is easily done via a previously created Python script which can be added to AWS as a Lambda function.

**Please note that the script replaces any existing domains in the domain list it is interacting with. If desired, you may alter the script to append instead of replace.**

To download this script, perform the following steps:

1. Navigate to [https://github.com/infobloxopen/outbound-notifications/blob/main/AWS/tide_to_r53_dnsfw.py](https://github.com/infobloxopen/outbound-notifications/blob/main/AWS/tide_to_r53_dnsfw.py)  in your web browser of choice.

![image](media://5f9a61b4-49fa-4497-a207-63973053cbfb)

2. **Copy** the Python script and** save** it to a text file.

![A screen shot of a computer

Description automatically generated with medium confidence](media://6c9959aa-4385-4cee-a8bd-bc2f745d493f)

1. Back in the AWS console, input **Lambda** into the *search bar* located at the top of the AWS interface.


![image](media://95c1562b-1dc9-4ab4-be2f-c47e4c83a0c9)

2. Locate and click on** Lambda** to navigate to the *Lambda* page.

![image](media://c4540f26-e517-49b2-b81b-721c51f6a164)

3. On the *AWS Lambda functions* page, click **Create function**.

![A screenshot of a computer

Description automatically generated with medium confidence](media://3b7891fc-0a02-4d1d-bf67-5194c290a520)

4. On the *Create function* page, configure the following settings:
  - Click the **Author from scratch **bubble.

![A picture containing text, font, line, number

Description automatically generated](media://18b1e13b-1e44-43ee-86bd-c2bcc1185ac4)

- Give the Function a **name**.

![image-20240414-192220.png](media://0ac5d8be-4a98-4303-b1fa-10441d4b85e0)

5. Select **Python 3.8** via the *Runtime* drop-down menu.

![image-20240414-192255.png](media://d9655530-090c-4f1a-adbd-057169330622)

6. Keep all other settings as their default and click **Create function**.

![A screenshot of a computer

Description automatically generated with low confidence](media://65b6f81f-11c8-41bb-834d-564fa5502565)

7. On the* Functions* page, locate and click the **Lambda function** you’ve just created.

![A screenshot of a computer

Description automatically generated with low confidence](media://4a2251e4-49b6-48a0-acda-753476521fc5)

8. Once on the Lambda function’s page, **delete** all text located in the code editor.

![A screenshot of a chat

Description automatically generated with low confidence](media://66b4aea0-ef76-4a17-9df5-c9f0e99f37eb)

9. **Paste** the code acquired previously in this section on page 36.


![A screenshot of a computer

Description automatically generated with low confidence](media://8f96cf9b-b172-4753-af46-c03fff592d3c)

10. To deploy the code, click the **Deploy** button located above the code editor.

![A screenshot of a computer

Description automatically generated with low confidence](media://12d00aa5-e479-446f-a8aa-9e2285a0527d)

11. On the Lambda function’s page, click the** Configuration** tab.

![image-20240414-192337.png](media://56f45a9d-3368-42d7-b03e-5bd0a25b7531)

12. On the *Configuration* page, click **Environment variables** in the navigation panel.

![A screenshot of a computer

Description automatically generated with medium confidence](media://e3e9655b-4c25-4c53-a06e-e2697a92c8cd)

13. Edit the *Environment Variables* by clicking the **Edit** button located in the middle of the Environment variables panel.

![image](media://0aa9b63d-2157-485c-a329-c7e86d67dcab)

14. On the Edit environment variables page, click** Add environment variable**.

![A screenshot of a computer

Description automatically generated with medium confidence](media://57a4ff58-10ca-4689-b158-6410ee315503)

15. In the first *Environment Variable*, input **CSP_API_KEY** in the** Key** text field.

![image-20240414-192704.png](media://a6c6f605-4645-4825-bfe3-cfd439bb1068)

16. Input the **CSP API key** that was acquired on <u>*[pages 35-36](https://docs.google.com/document/d/1Pj7QxwgJf_ko0bxtnYiN0NfRd2UE07ZR/edit#heading=h.3tbugp1)*</u> in the **Value** text field.

![A picture containing text, font, line, screenshot

Description automatically generated](media://9579c6cf-21a4-4a52-9786-ed1d0feb6e40)

17. Click **Add environment variable** to add an additional environment variable.

![image-20240414-192641.png](media://8bcb3144-29e6-4373-ab12-5c30dd4cb390)

18. In the second *Environment Variable*, input **DNSFW_LISTID** in the** Key** text field.

![A picture containing text, font, screenshot, line

Description automatically generated](media://4477b668-bf49-4802-8cc3-e75e2aa78cc6)

19. Input the **AWS Route 53 DNS Firewall domain list ID** that was acquired on <u>*[page 49](https://docs.google.com/document/d/1Pj7QxwgJf_ko0bxtnYiN0NfRd2UE07ZR/edit#heading=h.2grqrue)*</u> in the **Value** text field.

![A picture containing text, font, screenshot, line

Description automatically generated](media://d180e28c-6e80-43bf-9a2a-5c2a1dd095dd)

20. Click **Add environment variable** to add an additional environment variable.

![image-20240414-192641.png](media://8bcb3144-29e6-4373-ab12-5c30dd4cb390)

21. In the third *Environment Variable*, input **S3BUCKET** in the** Key** text field.

![A picture containing text, screenshot, font, line

Description automatically generated](media://65fa0596-6925-4bd3-837b-de3b68e84fa7)

22. Input the **S3 Bucket name** that was created on <u>*[page 43](https://docs.google.com/document/d/1Pj7QxwgJf_ko0bxtnYiN0NfRd2UE07ZR/edit#heading=h.32hioqz)*</u> in the **Value** text field.

![A close up of a name

Description automatically generated with low confidence](media://b06a6d92-f235-4ca2-b3d2-c3fd069562cc)

23. Click **Add environment variable** to add an additional environment variable.

![image-20240414-192641.png](media://8bcb3144-29e6-4373-ab12-5c30dd4cb390)

24. In the fourth *Environment Variable*, input **S3FILE** in the** Key** text field.

![A picture containing text, screenshot, font, line

Description automatically generated](media://941fb5dc-bf6d-4ce6-86ea-4bcea5e18476)

25. Input the **S3 file name** that was created on <u>*[page 45](https://docs.google.com/document/d/1Pj7QxwgJf_ko0bxtnYiN0NfRd2UE07ZR/edit#heading=h.32hioqz)*</u> in the **Value** text field.

![A picture containing text, font, screenshot, line

Description automatically generated](media://d6aff018-0da3-4c97-aba3-3336c392d251)

26. Click **Add environment variable** to add an additional environment variable.

![image-20240414-192641.png](media://8bcb3144-29e6-4373-ab12-5c30dd4cb390)

27. In the fifth *Environment Variable*, input **SEARCH** in the** Key** text field.

![A picture containing text, font, screenshot, line

Description automatically generated](media://ce4a9821-6b82-4cc3-ae16-273e31573322)

28. Input the **TIDE API call** that was created on <u>*[pages 46-48](https://docs.google.com/document/d/1Pj7QxwgJf_ko0bxtnYiN0NfRd2UE07ZR/edit#heading=h.41mghml)*</u> in the **Value** text field.


![A picture containing text, font, screenshot, white

Description automatically generated](media://606875a4-1cf3-486e-8016-1394eb9ecc33)

- After inputting all of your environment variables, they should look similar to this screenshot:

 

![A screenshot of a computer

Description automatically generated with medium confidence](media://0307752b-1e00-4381-9a5c-d1d0c7e7acdc)

29. Click** Save** to confirm the addition of the newly created environment variables.

![A screenshot of a computer

Description automatically generated with low confidence](media://deda4af3-628d-4e82-9357-4d566998cdd8)