The callback_urls
under aws_cognito_user_pool_client
is List of allowed callback URLs for the identity providers.
So, here for non-prod and “Techno” application, I need http://localhost:3000/auth
as well along with the other one created by values of the var. I added the square brackets for all values as not doing it gave me this error : The true and false result expressions must have consistent types
. But with adding the square brackets, I am getting this error:
Inappropriate value for attribute callback_urls: element 0: string required."
callback_urls = [var.target_infra == "prod" ? (var.application_name == "techno" ? ["https://${local.domain_name}.${local.pe_subdomain_name[var.target_infra]}/auth"] : ["https://${local.domain_name}.${local.pe_subdomain_name[var.target_infra]}/setup/auth"]) : (var.application_name == "techno" ? ["https://${local.domain_name}.${var.environment}.${local.pe_subdomain_name[var.target_infra]}/auth", "http://localhost:3000/auth"] : ["https://${local.domain_name}.${var.environment}.${local.pe_subdomain_name[var.target_infra]}/setup/auth"])]
Is there a way to achieve this with a possibly cleaner code?