How to control resources conditional on which environment Amplify is deploying to #13860
Labels
feature-request
Request a new feature
platform-config
Issues related to configuring project settings
Amplify CLI Version
12.12.4
Question
Hi there,
I've got a multi-environment project built with Amplify 12.12.4, Gen 1. Each environment (dev, sandbox, prod) deploys into it's own AWS account.
The project is basically hosting an s3-and-cloudfront site with cognito auth. The project is hooked up to be using amplify hosting/CI just like in this guide https://docs.amplify.aws/gen1/react/deploy-and-host/deployment/deploy-static-site-github/#deploy-your-app-to-aws-amplify
We have a requirement for a cognito pre-authentication lambda trigger to run some custom check before sign-in, but we only need this in prod.
I have successfully configured the lambda, but on all 3 environments; I only need it on prod. I can't find an straightforward way of configuring this through code.
It seems like based on answers such as #4875 that the answer relies on running amplify commands with the
--restore
flag, but this obviously isn't a persistent, source-control-backed change that will survive through CI etc.How can this environment-specific behvaiour be represented through code?
TL;DR: How can I configure, through commitable code, for cognito auth to have a trigger lambda, but in one amplify environment only
Thanks
The text was updated successfully, but these errors were encountered: