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

Use fusionauth with for_each #293

Open
jandroav opened this issue Oct 7, 2024 · 0 comments
Open

Use fusionauth with for_each #293

jandroav opened this issue Oct 7, 2024 · 0 comments

Comments

@jandroav
Copy link

jandroav commented Oct 7, 2024

I am trying to create multiple tenants as follows:

locals {
  tenants = [
    {
      tenant_name = "test"
      env         = "xyz"
    },
  ]
}

module "tenant" {
  for_each                       = { for tenant in local.tenants : tenant.tenant_name => tenant }
  source                         = "../../../../../modules/tenant"
  env                              = each.env
  client                           = "test"
  tenant                         = each.tenant_name
  fusionauth_api_key             = var.fusionauth_api_key
  fusionauth_host                = var.fusionauth_host
....
}

../../../../../modules/tenant contains fusion terraform code.

I am getting:

The module at module.premier_xyz.module.tenant.module.fusionauth is a
│ legacy module which contains its own local provider configurations, and so
│ calls to it may not use the count, for_each, or depends_on arguments.

│ If you also control the module "./fusionauth", consider updating this
│ module to instead expect provider configurations to be passed by its
│ caller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant