This Terraform module integrates the Awala Internet Endpoint with the Awala Pong server in a fully serverless environment on Google Cloud Platform and MongoDB Atlas.
- A GCP project with billing and the Cloud Resource Manager API enabled.
- A domain name with DNSSEC correctly configured.
- A MongoDB Atlas API key with the permissions
Organization Owner
on the project you wish to use.
- Initialise this module with the required variables. For example:
module "awala-pong" { source = "relaycorp/awala-endpoint/google//examples/pong" version = "<INSERT VERSION HERE>" google_project = "your-project" google_credentials_path = "/home/you/Desktop/google-credentials.json" mongodbatlas_public_key = "your-public-key-id" mongodbatlas_private_key = "your-private-key" mongodbatlas_project_id = "your-project-id" internet_address = "your-company.com" pohttp_server_domain = "awala-endpoint.your-company.com" }
- Run
terraform init
, followed byterraform apply
. - Execute the bootstrapping script as follows:
gcloud --project=PROJECT run jobs execute \ "$(terraform output -raw bootstrap_job_name)" \ --region=REGION \ --wait
- Create the following DNS records:
A
record for the load balancer, whose IPv4 address can be found in the output variablepohttp_server_ip_address
.SRV
record for the A record above, so that it can be used as an Awala Parcel-Delivery Connection (PDC) server. For example:_awala-pdc._tcp.your-company.com. 3600 IN SRV 0 0 443 pohttp-server.your-company.com.
- Install the Awala Ping app for Android or desktop.
- Download the connection parameters file from your Awala Internet Endpoint server. Its URL is
https://<POHTTP-SERVER-DOMAIN>/connection-params.der
. - Import the connection parameters file into the Awala Ping app.
- On Android, open the endpoints by tapping the respective icon in the top-right corner, then tap the
+
button in the bottom-right corner, then select "Public endpoint", and finally select the DER file above and save. - On desktop, run
awala-ping third-party-endpoints import-public
. For example:awala-ping third-party-endpoints import-public < /path/to/connection-params.der
- On Android, open the endpoints by tapping the respective icon in the top-right corner, then tap the
- Send a ping and wait for a pong.
- On Android, go back to the main screen and tap the "+ Ping" button. Then select the endpoint you just imported and tap the send button in to top-right corner.
- On desktop, run
awala-ping ping
. For example:awala-ping ping your-company.com
If you don't get a pong within a few seconds, check the logs and whether any errors were reported.
- This module does NOT restrict access to MongoDB from any particular IP address.