Setting up AWS Lambda¶
Requires an AWS account
You will need an AWS account with access (and capacity) to manage AWS Lambda layers and functions.
Create a base layer¶
Begin by setting up your environment with the base SDK you want to use for event handling:
We publish a lambda-layer
artifact with the Java SDK, bundled and ready-to-use as a base layer for any Java-based Lambda functions.
- Download the latest
lambda-layer
artifact. - Open the AWS Lambda layers console .
- In the upper-right, click the Create layer button, and then:
- Enter a Name for the layer, such as
atlan-java-sdk
. - Upload the file you downloaded in (1).
- For Compatible architectures select x86_64.
- For Compatible runtimes select Java 17.
- In the lower-right, click the Create button to create the layer.
- Enter a Name for the layer, such as
We publish a lambda-layer
artifact with the Python SDK, bundled and ready-to-use as a base layer for any Python-based Lambda functions.
- Download the latest
lambda-layer
artifact. - Open the AWS Lambda layers console .
- In the upper-right, click the Create layer button, and then:
- Enter a Name for the layer, such as
atlan-python-sdk
. - Upload the file you downloaded in (1).
- For Compatible architectures select x86_64.
- For Compatible runtimes select Python 3.10.
- In the lower-right, click the Create button to create the layer.
- Enter a Name for the layer, such as
Create a function¶
Now you are ready to create an AWS Lambda function:
- Open the AWS Lambda functions console .
- In the upper-right, click the Create function button, and then:
- Use the default Author from scratch option.
- Enter a Function name for your function, something that briefly describes its purpose.
- For Runtime select Java 17.
- For Architecture select x86_64.
- In the lower-right, click the Create function button to create the function.
- Open the AWS Lambda functions console .
- In the upper-right, click the Create function button, and then:
- Use the default Author from scratch option.
- Enter a Function name for your function, something that briefly describes its purpose.
- For Runtime select Python 3.10.
- For Architecture select x86_64.
- In the lower-right, click the Create function button to create the function.
Configure the function¶
Now you need to configure the function. Begin by opening your function in the AWS console, if it is not already open.
Set the base layer¶
On the Code tab of your function:
- At the bottom of the page in the Layers table, click the Add a layer button.
- For Layer source choose Custom layers.
- From the Custom layers drop-down, select the layer you created in the steps above.
- From the Version drop-down, select the most recent version (the one with the highest number).
- In the lower-right, click the Add button.
Enable function URL¶
To be able to receive webhooks, your Lambda function must be exposed on a URL. You can do this be enabling its function URL:
- Change to the Configuration tab of your function.
- From the left, click Function URL.
- To the right, click the Create function URL button:
- For Auth type choose NONE.
- In the lower-right, click the Save button.
- Copy the URL listed under Function URL - you will use this URL to configure the webhook in Atlan.
Won't this be insecure?
Your Lambda will be publicly accessible at this URL; however, we will show you later how you can verify all incoming requests before taking any action on them, by using Atlan's signing secret.
Set environment variables¶
- Still within the Configuration tab of your function...
- From the left, click Environment variables.
- To the right, click the Edit button.
-
Click the Add environment variable button to add each of these:
Key Value ATLAN_API_KEY
an Atlan API token your code should use for any further interaction with Atlan ATLAN_BASE_URL
the base URL of your tenant (for example https://example.atlan.com
)SIGNING_SECRET
for now fill in any value, we will replace it later -
In the lower-right, click the Save button.