Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to retrieve a download URL for registry.opentofu.org/terraform-google-modules/github-actions-runners/google #209

Closed
KacperMalachowski opened this issue Feb 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@KacperMalachowski
Copy link

Thank you for reporting an issue.

Open tofu failed to retrieve download url for registry.opentofu.org/terraform-google-modules/github-actions-runners/google//modules/gh-oidc, even when error clearly state the location for the module.

Full error code:

registry.opentofu.org/terraform-google-modules/github-actions-runners/google//modules/gh-oidc 3.1.2 from 
registry.opentofu.org: failed to get download URL for
"registry.opentofu.org/terraform-google-modules/github-actions-runners/google": 200 OK resp:{
  "location": "git::https://github.com/terraform-google-modules/terraform-google-github-actions-runners?ref=v3.1.2"
}```

### OpenTofu Version

```shell
OpenTofu v1.6.0-dev
on darwin_arm64
+ provider registry.opentofu.org/alekc/kubectl v2.0.3
+ provider registry.opentofu.org/hashicorp/google v5.4.0
+ provider registry.opentofu.org/hashicorp/google-beta v5.5.0
+ provider registry.opentofu.org/hashicorp/kubernetes v2.22.0
+ provider registry.opentofu.org/integrations/github v5.45.0

OpenTofu Configuration Files

module "workload_identity_federation" {
  source = "terraform-google-modules/github-actions-runners/google//modules/gh-oidc"

  project_id  = data.google_client_config.gcp.id
  pool_id     = "project-pool"
  provider_id = "project-provider"
  issuer_uri  = "https://token.actions.githubusercontent.com"

  attribute_mapping = {
    "google.subject"                = "\"repository_id:\" + assertion.repository_id + \":repository_owner_id:\" + assertion.repository_owner_id + \":workflow:\" + assertion.workflow"
    "attribute.actor"               = "assertion.actor"
    "attribute.aud"                 = "assertion.aud"
    "attribute.repository_id"       = "assertion.repository_id"
    "attribute.repository_owner_id" = "assertion.repository_owner_id"
    "attribute.workflow"            = "assertion.workflow"
    "attribute.workflow_ref"        = "assertion.workflow_ref"
    "attribute.event_name"          = "assertion.event_name"
  }

  sa_mapping = {
    "terraform_prod" = {
      sa_name   = "projects/${data.google_client_config.gcp.project}/serviceAccounts/${google_service_account.terraform_executor.email}"
      attribute = "subject/repository_id:111111111:repository_owner_id:3333333:workflow:prod-terraform"
    }
  }
}
@KacperMalachowski KacperMalachowski added the bug Something isn't working label Feb 9, 2024
@KacperMalachowski KacperMalachowski changed the title Failed to retrieve a download URL for registry.opentofu.org/terraform-google-modules/github-actions-runners/google//modules/gh-oidc Failed to retrieve a download URL for registry.opentofu.org/terraform-google-modules/github-actions-runners/google Feb 9, 2024
@Yantrio
Copy link
Member

Yantrio commented Feb 9, 2024

Hi @KacperMalachowski, would you be able to share which version of OpenTofu you are using? I notice that it says -dev in your logs. Which is an indication that it's either built yourself or from homebrew

I believe this is an issue with older versions of OpenTofu (pre-GA release).

@KacperMalachowski
Copy link
Author

Hi @Yantrio. I queickly checked that and yes. I had locally 1.6.0-alpha5 opentofu version from homebrew. Upgrading to 1.6.1 fixed the issue.

Sorry for inconvinece and thanks for quick help!

@Yantrio
Copy link
Member

Yantrio commented Feb 9, 2024

No problem!

Glad to hear it's resolved 🙌

@Yantrio Yantrio closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants