I recently set up a Cognito user pool and associated app client via the AWS console. Throughout this process, I elected to use the new “Managed Login,” in place of the “Hosted UI.”
It worked okay, so now I decided to put this into code. This is where things fell apart. I cannot figure out how to create a style, or just use the default one programmatically. Not in CloudFormation, Terraform or Pulumi. Did AWS really release this and not provide an API for it or am I missing something. At this point I can have it use the new managed login via IaC but I have to manually go in and create the style via the AWS Console.
Any help would be appreciated here. If the answer is simply, there is no way to do this programmatically, then that is fine, I’ll revert to the Hosted UI.
I can’t find the exact AWS documentation that I used as reference, but the way it works is you create the managed login resource through IaC, setting use_cognito_provided_values to true, then query the resource for the JSON template to customise on top of. You can then pass them in as assets and settings, and set use_cognito_provided_values back to false.
How are you doing this with the old hosted UI and IaC? I’m using the CLI/API to customize the CSS and logo because I couldn’t find a CFN-base way to do it. Plumi/TF/etc are using the APIs, so should be able to automate it (ie. it’s just a coverage issue).
This is Pulumi, but it should be conceptually identical in TF/CF. In this case css is mandatory but by setting it to a blank string I avoid it and it gives the not-so-pretty default.
Thanks! This may do it. I use Pulumi and they don’t have this in their AWS provider quite yet. But AWS has it in their Cloud Control API, so I can reference it like aws-native.cognito.ManagedLoginBranding.