sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 126 forks source link

CognitoUserPool customEmailSender trigger does not work #526

Open digitaltoad opened 3 weeks ago

digitaltoad commented 3 weeks ago

The customEmailSender and customSmsSender triggers for a CognitoUserPool require slightly different configurations from the other triggers and fails to deploy. I've only been able to get them to work by using a transform on the userpool and supplying the required configuration. I would be happy to submit a PR for this but I'm not sure how to handle KMS at the moment in a nice way.

const kms = new aws.kms.Key('KMS');

const customEmailSenderFunction = new sst.aws.Function('CustomEmailSender', {
    handler: 'customEmailSender.handler',
});

const userPool = new sst.aws.CognitoUserPool('UserPool', {
  transform: {
    userPool: {
      lambdaConfig: {
        kmsKeyId: kms.arn,
        customEmailSender: {
          lambdaArn: customEmailSenderFunction.arn,
          lambdaVersion: 'V1_0'
        }
      }
    }
  }
});