TanaInt is a project to integrate my personal Tana workflow with other external services.
The project contains the following key components:
An AWS serverless app (SAM) that contains the core integration logic.
Handles incoming events, calls GCalService
to sync calendar, and returns response.
Also handles syncing events from GCal to Tana using Tana Input API.
An AWS Lambda function that contains the core integration logic. Handles incoming events, calls GCalService to sync calendar, and returns response.
The Lambda function is deployed as an executable assembly rather than a class library. The LambdaBootstrapBuilder
starts the Lambda runtime.
An ASP.NET Core web API and views for local testing and demoing the calendar integration. Calls the GCalService to sync calendar events.
Contains the TanaTaskDto
model representing calendar events. Used by both the API and Lambda function.
Implements the GCalService
for integrating with the Google Calendar API. Called by the API and Lambda function.
A simple console app for testing the Google Calendar integration works as expected.
The API and Lambda function use a service account for Google Calendar API authentication. The credentials.json
and token.json
files contain the credentials.
Currently we are only deploying zip manually
The Amazon.Lambda.Tools .NET Global Tool can be used to deploy the function from the command line.
Install the Amazon.Lambda.Tools:
dotnet tool install -g Amazon.Lambda.Tools
Login to aws cli
aws configure
Deploy the SAM app:
cd TanaInt.Sam
dotnet lambda deploy-serverless --region AWS_REGION
This will package and deploy the SAM app to AWS Lambda using the configuration in aws-lambda-tools-defaults.json.
The configuration includes the target Lambda runtime, handler mapping, memory size, timeout, and IAM role.
To update the configuration, edit aws-lambda-tools-defaults.json.
To invoke the function:
dotnet lambda invoke-function <function-name>
Logs and other commands are available through dotnet lambda help
.
The tana-template.json
file is for the template of the request from Tana.
- Lambda is hosted with root IAM user:
[email protected]
. - Function url, credentials.json, My google user token are stored in Prd Env secrets.