Hi there, I recently got Atlantis up and running i...
# atlantis-community
n
Hi there, I recently got Atlantis up and running in ECS using terraform-aws-atlantis via a github token. I am switching to a github app, but it's not working. Here is my secrets block
Copy code
secrets = [
  {
    name      = "ATLANTIS_GH_APP_ID"
    valueFrom = module.secrets_manager["gh-app-id"].secret_arn
  },
  {
    name      = "ATLANTIS_GH_APP_KEY"
    valueFrom = module.secrets_manager["gh-app-private-key"].secret_arn
  },
  {
    name      = "ATLANTIS_GH_WEBHOOK_SECRET"
    valueFrom = module.secrets_manager["gh-webhook-secret"].secret_arn
  },
but I'm getting this error in my logs:
Copy code
--gh-user/--gh-token or --gh-app-id/--gh-app-key-file or --gh-app-id/--gh-app-key or --gitlab-user/--gitlab-token or --bitbucket-user/--bitbucket-token or --azuredevops-user/--azuredevops-token must be set[39m
any ideas what I'm doing wrong here?
👍 1
p
is the entrypoint receiving those secrets?
that is all you get from the logs?
n
The only other entry in the logs is
Copy code
No files found in /docker-entrypoint.d/, skipping
p
no no, I mean are the secrets actually being populated correctly
and passed down to the container at tun time
n
The task definition appears to have them
I'm a little unclear how they get utilized though
I'm using the same configuration as when the github token method was working. Only difference is I no longer set ATLANTIS_GH_USER in environment and no longer set ATLANTIS_GH_TOKEN in secrets
oh I see, those are turned into environment variables and atlantis gets them from the environment. 🤔
hm, tried setting debug output. Now getting a slightly different error
Copy code
[31mError: initializing server: error initializing github authentication transport: wrong number of installations, expected 1, found 0[39m
p
I think you need the app name too
this is what I have in mine
Copy code
map_secrets:
  ATLANTIS_GH_APP_KEY: atlantis/ATLANTIS_GH_APP_KEY
  ATLANTIS_GH_WEBHOOK_SECRET: atlantis/ATLANTIS_GH_WEBHOOK_SECRET
map_environment:
  ATLANTIS_GH_APP_ID: "111111"
  ATLANTIS_GH_APP_SLUG: "runatlantis-atlantis"
  ATLANTIS_REPO_ALLOWLIST: "<http://github.com/runatlantis/atlantis|github.com/runatlantis/atlantis>"
  ATLANTIS_WRITE_GIT_CREDS: true
  ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT: true
  ATLANTIS_SILENCE_VCS_STATUS_NO_PLANS: true
  ATLANTIS_HIDE_PREV_PLAN_COMMENTS: true
  ATLANTIS_LOG_LEVEL: info
  ATLANTIS_ATLANTIS_URL: <https://atlantis.runatlantis.io>
  ATLANTIS_REPO_CONFIG_JSON: '{"repos":[{"id":"/.*/", "allowed_overrides":["apply_requirements","workflow","delete_source_branch_on_merge"], "allow_custom_workflows":true ,"apply_requirements": ["mergeable"]}]}'
those all map to ENV vars
you do not need this :
Copy code
ATLANTIS_GH_WEBHOOK_SECRET: atlantis/ATLANTIS_GH_WEBHOOK_SECRET
n
Can
ATLANTIS_GH_APP_SLUG
be an arbitrary value or is it mapping to something?
p
it maps to the name you put in the app
✅ 1
when you create it in github
n
looks like adding
ATLANTIS_GH_APP_SLUG
and
ATLANTIS_WRITE_GIT_CREDS
got it running. Thanks @PePe Amengual!
👍🏽 1