Open Robsonwd opened 1 year ago
Hey @Robsonwd :wave: thanks for raising this! The setup looks good! In between steps 2 and 3, you'll want to run amplify env checkout <current-env-name>
. This will lift the changes made to the git-tracked backend-config.json
file into the ignored amplify-meta.json
file, which will then pass the KmsKeyArn
output into the auth stack. To debug you can run amplify build
and inspect the auth CloudFormation template to ensure overrides are being applied as expected (this setup looks good so this shouldn't be an issue), and inspect the root stack's CloudFormation template in amplify/backend/awscloudformation/build/root-cloudformation-stack.json
or amplify/#current-cloud-backend/awscloudformation/build/root-cloudformation-stack.json
to ensure the parameter is passed from the custom resource to the auth stack.
Hey @josefaidt
I tried this as well but I've got the same error in the Cloudformation for AuthTriggerCustomLambdaStack
. Auth and user pools in the Cloudformation say "UPDATE_COMPLETE", the only AuthTriggerCustomLambdaStack
fails somehow.
There is:
{
"attributes": [
"KmsKeyArn"
],
"category": "custom",
"resourceName": "kms"
},
created in amplify-meta.json
There is also:
"customkmsKmsKeyArn": {
"Fn::GetAtt": [
"customkms",
"Outputs.KmsKeyArn"
]
},
in amplify/backend/awscloudformation/build/root-cloudformation-stack.json
for auth parameters and also for AuthTriggerCustomLambdaStack
parameters.
Hey @Robsonwd thanks for checking on that, and the snippets look good! What is the error coming from the AuthTriggerCustomLambdaStack
? You may need to view the error in the AWS CloudFormation console for this nested stack if it is not printed to the terminal
@josefaidt
Yea, I double-checked everything, names, values. All things look correct. For the AuthTriggerCustomLambdaStack
it's just the same error:
Parameters: [customkmsKmsKeyArn] do not exist in the template
I'm wondering if custom cognito triggers for PostConfirmation and PreSignup might breaking something here 🤔
Hey @Robsonwd apologies for the delay here but unfortunately I have not been able to find a suitable workaround for this. Here's what's happening:
amplify/backend/auth/my-auth/build
Furthermore, we are unable to modify this template with auth overrides, project overrides, or a post-build
hook (it does not appear to be invoked during the build that occurs on push
).
I'll mark this as a bug
Any updates on this bug?
In case it helps anyone, I've been playing around with a related issue and discovered something interesting:
auth.breakcirculardependency
determines whether the "sibling stack for auth triggers" (AuthTriggerCustomLambdaStack
) gets created and used.false
and delete the template for that stack from amplify/backend/auth/my-auth/build
, the config for the lambda triggers (and your overrides) are applied to the main template.Of course, the feature flag exists for a reason: if you have a circular dependency, you'll have to deal with it manually. E.g. in my case I had to remove the strong dependency the user pool has on the triggers, and then in your override add the trigger ARNs back as strings (rather than refs).
How did you install the Amplify CLI?
npm install -g @aws-amplify/cli
If applicable, what version of Node.js are you using?
v14.20.1
Amplify CLI Version
10.7.2
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
I am getting an error:
Parameters: [customkmsKmsKeyArn] do not exist in the template
on deployment. When I'm checking the AWS Cloudformation events, I see that this error in Cloudformation isAuthTriggerCustomLambdaStack
.I was following this issue to set this up: https://github.com/aws-amplify/amplify-cli/issues/11824
override.ts for auth category:
custom/kms/kms-cloudformation-template.json
backend-config.json
Many thanks for help solving this.
Expected behavior
AWS Amplify deployment works without issues and
customEmailSender
in lambda config is correctly set with KMS Key ID.Reproduction steps
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm: