On this page you will learn how to connect your AWS API Gateway to Obsidian step-by-step.
Overview of this Guide
Table of Contents | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Prerequisites
The following is required to proceed:
A running Obsidian instance
{tenant-id}.frontend.obsidian.local
Access to the Amazon API Gateway Service with at least one API deployed in a stage
Docker to use the image of our agent (that acts as an intermediary)
...
Create a new Environment in Obsidian
To get started, simply open your Obsidian instance and follow the instructions below.
Add an Environment for AWS
Navigate to “Environments” in the menu on the left side
Click on the “Create New Environment” button
...
Confirm by clicking on the "Create New Environment" button
Request an Environment Token
Click on the “Request Token” button
Copy & save the token that appears above (it will be needed later)
...
You’ve completed the first step!
...
Provide the Gateway Information
The following describes how to create the gateway configuration for an AWS API Gateway Agent.
Gateway Configuration
Create a new YAML file:
Code Block | ||
---|---|---|
| ||
type: AWS accessKey: {aws-access-key} secretAccessKey: {aws-secret-access-key} region: {aws-region} stage: {aws-stage} |
...
Note |
---|
Currently, each AWS agent is specific to one region and one stage. |
Example
Code Block | ||
---|---|---|
| ||
type: AWS accessKey: ABC123ABC123ABC123AB secretAccessKey: ABC123ABC123ABC123ABC123ABC123ABC123ABC1 region: eu-central-1 stage: test |
Q&A
Expand | ||
---|---|---|
| ||
|
...
You’ve completed the second step!
...
Create an Agent as Intermediary
The following describes how to create a Docker container for the agent. It is described using a Docker compose file so that additional agents can be easily added to your docker stack later.
Agent Configuration
Create a docker-compose.yml:
...
agentToken
: Insert the token that you’ve received in the first stepbackendUrl
: Insert your tenant id into the backend URLvolume
: Add the path to your gateway configuration (the file you’ve created in the second step)
Example
Code Block | ||
---|---|---|
| ||
version: '3.3' services: # AWS API Gateway Agent spring-aws-agent: image: ghcr.io/apiida/obsidian-agent:latest environment: - 'agentToken=1:751c5d80-ed45-4401-9594-8fe2f413b354' - 'backendUrl=wss://example.backend.obsidian.local/jsonRpc' - 'gateway-config=/workspace/awsConfig.yaml' volumes: - ./awsConfig.yaml:/workspace/awsConfig.yaml:rw |
...
You're ready to establish the connection between Obsidian and your AWS API Gateway.
...
Establish the connection
Establish the connection between Obsidian and your AWS API Gateway by starting the Agent (respectively the docker container that contains the agent).
Start your Agent
For example, execute the following command in the directory where the docker compose file is located to start the docker container that contains the agent you have just configured:
Code Block | ||
---|---|---|
| ||
docker-compose up -d |
Check the Agent's Status
Head over to your Obsidian instance
Select “Environments” in the menu on the left side
Your AWS API Gateway should now be connected to Obsidian
...