Closed Dogacel closed 7 months ago
@Dogacel thanks for your PR. I'll ship it in the next release soon!
@lgallard trying to use this, I am getting
│ Error: Too many pre_token_generation_config blocks
│
│ on .terraform/modules/cognito_user_pool/main.tf line 75, in resource "aws_cognito_user_pool" "pool":
│ 75: content {
│
│ No more than 1 "pre_token_generation_config" blocks are allowed
╵
I suspect this is due to having both pre_token_generation
and config,
pre_token_generation = lookup(var.lambda_config, "pre_token_generation", var.lambda_config_pre_token_generation)
dynamic "pre_token_generation_config" {
for_each = lookup(var.lambda_config, "pre_token_generation_config", var.lambda_config_pre_token_generation_config)
content {
lambda_arn = lookup(lookup(var.lambda_config, "pre_token_generation_config", var.lambda_config_pre_token_generation_config), "lambda_arn", null)
lambda_version = lookup(lookup(var.lambda_config, "pre_token_generation_config", var.lambda_config_pre_token_generation_config), "lambda_version", null)
}
}
Because I am pretty sure this is only a single config,
pre_token_generation_config = {
lambda_arn = data.aws_lambda_function.cognito_access_token_customization.arn
lambda_version = "V2_0"
}
Is there a way we can conditionally not generate pre_token_generation
if config doesn't exist?
@Dogacel can you test this PR https://github.com/lgallard/terraform-aws-cognito-user-pool/pull/139 ?
@Dogacel can you test this PR #139 ?
Sorry I was busy with meetings and missed the notification 😞 Checking now.
@Dogacel I released 0.27.2
which has another fix just in case!!
@lgallard Just realized another bug and opened a PR to fix it:
This time I found out how I can test this.
Please LMK if anything further needs to be done 🙂
This adds support for
pre_token_generation_config
which allows lambda to use V2 token customization.@lgallard