Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Multiple tenants #509

Closed
bourbonfgiles opened this issue Jan 31, 2022 · 4 comments
Closed

Multiple tenants #509

bourbonfgiles opened this issue Jan 31, 2022 · 4 comments
Labels
question Further information is requested

Comments

@bourbonfgiles
Copy link

Hello,

I was looking at your provider.tf and I see you specify the tenant. Could I specify multiple tenants in separate provider blocks or is only one per repo supported?

Thanks,
Ben.

@bourbonfgiles bourbonfgiles added the question Further information is requested label Jan 31, 2022
@Jno21
Copy link

Jno21 commented Feb 9, 2022

Hello,

You can totally specify multiple tenants in separate provider blocks, it is a Terraform feature so it is not link to the provider itself.

For example:

provider "auth0" {
  domain = "<domain_one>"
  client_id = "<client_id_one>"
  client_secret = "<client_secret_one>"
}

provider "auth0" {
  alias = "second"

  domain = "<domain_two>"
  client_id = "<client_id_two>"
  client_secret = "<client_secret_two>"
}

resource "auth0_prompt" "this" {
  universal_login_experience = "classic"
  identifier_first           = false
}

resource "auth0_prompt" "this" {
  provider = auth0.second

  universal_login_experience = "new"
  identifier_first           = false
}

But I think it is important to think about how you want to do things.
If your different tenant should have the same configuration I will advice against this method since it implies to duplicate resources.

@bourbonfgiles
Copy link
Author

Thanks @Jno21 ! The reason I ask is I'm trying to write a module write now to encompass two domains, each referenced in its own tfvars file.

@bourbonfgiles
Copy link
Author

@Jno21 As for the above, is it possible to not specify the domain in the provider, so as to accommodate multiple domains inside one terraform module?

@sergiught
Copy link
Collaborator

We have moved this issue over at auth0/terraform-provider-auth0#62 as this repo is now maintained at https://github.com/auth0/terraform-provider-auth0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants