Duffy Gillman
09/19/2025, 8:59 PMcloudposse-terraform-components . I'm running into a snag when I try to pass the OIDC provider ARN to the OIDC role module. I'm not sure if this is an atmos bug or a configuration problem on my end. Here are the details:
two vendored modules: aws-github-oidc-provider, and aws-github-oidc-role
I have included these in my dev stack with these configurations:
./stacks/dev/dev-github-oidc-provider.yaml
import:
- ./_defaults
components:
terraform:
dev-github-oidc-provider:
metadata:
component: "github-oidc-provider"
vars:
name: "dev-github-oidc-provider"
.stacks/dev/cicd-platform-oidc-role.yaml
import:
- ./_defaults
components:
terraform:
cicd-platform-oidc-role:
metadata:
component: "github-oidc-role"
vars:
github_oidc_provider_id: !terraform.output dev-github-oidc-provider oidc_provider_arn
organization: "REDACTED"
github_actions_allowed_repos: ["REDACTED"]
iam_policy:
- version: "2012-10-17"
statements:
- effect: "Allow"
actions:
- "ecr:CompleteLayerUpload"
- "ecr:GetAuthorizationToken"
- "ecr:UploadLayerPart"
- "ecr:InitiateLayerUpload"
- "ecr:BatchCheckLayerAvailability"
- "ecr:PutImage"
resources:
- !terraform.output ecr-platform-api global repository_arn
when I try to run atmos terraform apply cicd-platform-oidc-role -s dev, the Terraform apply fails with this message:
Terraform has been successfully initialized!
Switched to workspace "dev-cicd-platform-oidc-role".
ā·
ā Error: Failed to read variables file
ā
ā Given variables file dev-github-oidc-provider.terraform.tfvars.json does not exist.Andriy Knysh (Cloud Posse)
09/19/2025, 9:02 PMdev-github-oidc-provider.terraform.tfvars.json file?Duffy Gillman
09/19/2025, 9:03 PM!terraform.output call which is trying to get the OIDC provider ARN to set github_oidc_provider_id. It feels like (perhaps) atmos expects the output to have been captured in a file named after the source componentDuffy Gillman
09/19/2025, 9:03 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:03 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:03 PMstacks section from atmos.yamlDuffy Gillman
09/19/2025, 9:04 PMdev-github-oidc-provider. maybe this is causing an issue...?Duffy Gillman
09/19/2025, 9:04 PMstacks:
base_path: "stacks"
included_paths:
- "deploy/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_pattern: "{stage}"Andriy Knysh (Cloud Posse)
09/19/2025, 9:05 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:05 PMdev-dev-github-oidc-provider.terraform.tfvars.jsonDuffy Gillman
09/19/2025, 9:05 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:05 PMatmos describe component cicd-platform-oidc-role -s dev --process-functions to check the variablesAndriy Knysh (Cloud Posse)
09/19/2025, 9:06 PM!terraform.output you can use !terraform.state if you are using s3 backendAndriy Knysh (Cloud Posse)
09/19/2025, 9:07 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:07 PM!terraform.outputAndriy Knysh (Cloud Posse)
09/19/2025, 9:10 PMatmos describe component cicd-platform-oidc-role -s dev --process-functionsDuffy Gillman
09/19/2025, 9:10 PMDuffy Gillman
09/19/2025, 9:11 PMDuffy Gillman
09/19/2025, 9:12 PMgithub_oidc_provider_id:
final_value: arn:aws:iam::REDACTED:oidc-provider/token.actions.githubusercontent.com
name: github_oidc_provider_id
stack_dependencies:
- dependency_type: inline
stack_file: deploy/dev/cicd-platform-oidc-role
stack_file_section: components.terraform.vars
variable_value: arn:aws:iam::REDACTED:oidc-provider/token.actions.githubusercontent.com
so it appears that it is able to resolve the valueAndriy Knysh (Cloud Posse)
09/19/2025, 9:13 PMgithub_oidc_provider_id: !terraform.output dev-github-oidc-provider oidc_provider_arnDuffy Gillman
09/19/2025, 9:13 PM-varfile argument being passed to terraform which is not correct... ?Duffy Gillman
09/19/2025, 9:13 PMfinal_value aboveAndriy Knysh (Cloud Posse)
09/19/2025, 9:14 PMdev-github-oidc-provider to maybe github-oidc-provider and try again?Duffy Gillman
09/19/2025, 9:14 PMDuffy Gillman
09/19/2025, 9:14 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:15 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:15 PMDuffy Gillman
09/19/2025, 9:19 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:20 PMdev- from the component name solves the problem, let me know (might be an interesting bug in Atmos when the stack name is already included in the component name). If not, let me know anyway šDuffy Gillman
09/19/2025, 9:21 PMDuffy Gillman
09/19/2025, 9:21 PMDuffy Gillman
09/19/2025, 9:24 PMcomponents/terraform/github-oidc-provider
then in stacks/catalog/github-oidc-provider.yaml, I have this:
components:
terraform:
github-oidc-provider:
metadata:
component: github-oidc-provider
How can I create two providers in the same stack? Can I do this?
import:
- catalog/github-oicd-provider
components:
terraform:
my-custom-name1:
metadata:
component: github-oidc-provider
my-custom-name2:
metadata:
component: github-oidc-providerDuffy Gillman
09/19/2025, 9:25 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:25 PMDuffy Gillman
09/19/2025, 9:25 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:25 PMmetadata.component is a pointer to the Terraform component (code)Andriy Knysh (Cloud Posse)
09/19/2025, 9:26 PMatmos terraform plan cicd-platform-oidc-role -s dev --logs-level=DebugDuffy Gillman
09/19/2025, 9:32 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:34 PMatmos terraform plan dev-github-oidc-provider -s dev --logs-level=DebugAndriy Knysh (Cloud Posse)
09/19/2025, 9:35 PMExecuting command:Duffy Gillman
09/19/2025, 9:35 PMAndriy Knysh (Cloud Posse)
09/19/2025, 9:35 PMatmos terraform generate varfile dev-github-oidc-provider -s dev --logs-level=DebugDuffy Gillman
09/19/2025, 9:36 PMDuffy Gillman
09/19/2025, 9:37 PMDuffy Gillman
09/19/2025, 9:38 PMDuffy Gillman
09/19/2025, 9:41 PMterraform shell and have not realized itDuffy Gillman
09/19/2025, 9:41 PMDuffy Gillman
09/19/2025, 9:42 PM