Ricky Fontaine
09/23/2025, 8:01 PMaws-github-repository component.
I'm trying to get started with the component by importing a couple repos. When I run atmos terraform plan on my local machine, where I'm logged into GitHub, the plan runs without issue. For CI / CD, we use the GitHub Actions provided by atmos. When I raise a PR, the workflow fails with the following error:
Planning failed. Terraform encountered an error while generating this plan.
Error: Cannot import non-existent remote object
While attempting to import an existing object to
"module.repository.github_repository.default[0]", the provider detected that
no object exists with the given id. Only pre-existing objects can be
imported; check that the id is correct and that it is associated with the
provider's configured region or endpoint, or use "terraform apply" to create
a new remote object for this resource.
# Error
exit status 1
Looking elsewhere online, I think this is due to how the GitHub Token is configured. Since I started getting this error, I've tried passing in the GITHUB_TOKEN secret as an environment variable to the action. Is there any guidance on how to authenticate the Atmos GitHub Actions workflows with the Terraform GitHub provider?
Let me know if you need more info, config files, etc. Thanks!Wacey
09/23/2025, 8:11 PMWacey
09/23/2025, 8:14 PMaws-github-repository component lolRicky Fontaine
09/23/2025, 8:22 PMWacey
09/23/2025, 8:28 PMGITHUB_APP_XXX environment variables
}
https://github.com/suzuki-shunsuke/ghtkn?tab=readme-ov-fileWacey
09/23/2025, 8:31 PMname: "Terraform"
on:
workflow_call:
...
secrets:
GH_TOKEN_RW:
required: false
GH_TOKEN_RO:
required: false
...
- name: Terraform Plan
id: plan
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_RW }}
TF_CLI_ARGS_plan: "-lock-timeout=10m -no-color -input=false -var-file=envs/${{ inputs.environment }}.tfvars -out=tfplan_${{ inputs.environment }}"
run: |
terraform plan
continue-on-error: trueErik Osterman (Cloud Posse)
09/23/2025, 8:42 PMWacey
09/23/2025, 8:44 PMDan Miller (Cloud Posse)
09/23/2025, 8:56 PMDan Miller (Cloud Posse)
09/24/2025, 1:35 PMenv.GITHUB_TOKEN before running TerraformDan Miller (Cloud Posse)
09/24/2025, 1:39 PMRicky Fontaine
09/25/2025, 1:46 PM