- Node.js 14.15.0 or later
- Clone this repository
- Create an AWS account
- Install AWS CLI
- Configure AWS CLI
aws configure
npm install
to install the required dependencies- Bootstrap your environment
cdk bootstrap aws://ACCOUNT-NUMBER/REGION
aws sts get-caller-identity
to get your AWS account numberaws configure get region
to get your AWS region
To self-host LiteralAI you will need to be registered as described in the documentation. Depending on the option you select, you will receive either :
- A Literal Client ID and Authorization Token to run the public image
- Or a Docker PAT to run the private image
If you opted for the public image, you should add the required env variables then run :
npx cdk deploy --all
If you opted for the private image, just run :
npx cdk deploy --all --parameters EcsStack:dockerPat=LITERAL_DOCKER_PAT
You should now be able to see the Literal sign in page.
AWS load balancers are not using HTTPs by default. To enable HTTPs (best practice and needed for OAuth):
- Create a certificate on AWS (you will have to update your domain DNS)
- Add an HTTPs listener to the load balancer using that certificate
- Allow port 443 in the security group
- Add a CNAME record redirecting your subdomain to the Load Balancer public URL.
You should now be able to access Literal with HTTPs through your subdomain.
Create a new task revision with NEXTAUTH_URL
set to your HTTPs endpoint (like https://literalai.mydomain.com
).
Then add the required env variables specific to your OAuth provider.
Do not forget to allow the OAuth redirect url on your OAuth provider (like https://literalai.mydomain.com/api/auth/callback/google
)
Finally, update your container with the latest revision.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template