I want to create custom module via tfe_registry_module
.
But when I create this resource, I keep getting the error. There is absolutely no problem when creating from the Web Console.
resource "tfe_registry_module" "workspace" {
vcs_repo {
display_identifier = "MY_ORG/terraform-module-workspace"
identifier = "MY_ORG/terraform-module-workspace"
oauth_token_id = TOKEN
}
}
Error: Error creating registry module from repository MY_ORG/terraform-module-workspace: resource not found
with tfe_registry_module.workspace
on modules.tf line 1, in resource "tfe_registry_module" "workspace":
resource "tfe_registry_module" "workspace" {}
I experienced the same. However the token used for the tfe
provider is being used in several other workspaces, to manage pretty much all other aspects of Terraform Cloud - but still failed on tfe_registry_module
.
I replaced the organization API token with a team API token used for the tfe
provider, which solved my problem.
This is subtly documented in the bottom of this table: API Tokens - Terraform Cloud | Terraform | HashiCorp Developer, but there’s no mentioning of it on Terraform Registry.
Perhaps it would be a good idea to add a yellow “note” box at the top of the resource documentation? It could have saved me hours and lots of grey hair!
i still have this issue, regardless the type of token;
- try organization token : failed
- try team “owners” token : failed
- try myuser token : failed
i wonder if it’s a case of supported with Terraform Enterprise but not Terraform Cloud like the SAML configuration