And, append the following adapter configuration to the end of the file. Make sure to replace ${{GITHUB_TOKEN}} with the environment variable containing your token.
baseUrl: Points to the GitHub API's base URL. This should only change if you are running GitHub enterprise or using the EU version of GitHub.
accessToken: Your provisioned GitHub access token. If formatted as ${{ GITHUB_TOKEN }}, Atlas will look for the secrets in an environment variable, GITHUB_TOKEN.
discoverySchedule: This field is optional. It is the cron schedule for how frequently Atlas should discover and cache service information. The default is hourly on the 0th minute.
Configuring Github repositories with moment.yml files
In order for Atlas to discover service information, moment.yml Yaml files must be configured for services.
We will use the following repository directory structure as an example:
In moment/app/moment.yml, the contents may look like:
apiVersion: moment.dev/servicecatalog/v1alpha1
kind: Service
metadata:
name: "app"
description: "Single page web application written in TypeScript that runs the Moment frontend."
tags:
- "TIER-0"
spec:
lifecycle: "production"
owners:
- kind: Group
name: "engineering"
contact:
- type: "slack"
workspace: "moment-eng"
channels:
- channel: "engineering-chat"
id: "C01SFSM39EC"
oncall:
- type: "pagerduty"
serviceId: "PJPVT5U"
domain: "moment.pagerduty.com"
repos:
- type: "github"
org: "moment-eng"
repo: "moment"
path: "/app"
environments:
production:
"datadog.com/tags": ["env:production", "service:app"]
"aws.amazon.com/regions": ["us-west-2"]
"aws.amazon.com/ecsServiceTags": ["env:production"]
staging:
"datadog.com/sloTags": ["env:staging", "service:app"]
"aws.amazon.com/regions": ["us-west-2"]
"aws.amazon.com/ecsServiceTags": ["env:staging"]
Note that this is a recommended structure, but Atlas offers flexibility in how you want to structure your Yaml files. Similar to Kubernetes, Atlas only cares about Resource definitions and not the paths at which the manifests are defined. As long as the ServiceCatalog entity is defined at a moment.yml file in the root of the repository, other resource definitions can be declared in any subpath.
Testing your integration with Moment
Once your setup is done, you can test your integration with a Moment canvas. Create a cell in a Moment canvas with the following code.