- Newest
- Most votes
- Most comments
The issue you're experiencing with Lambda function configurations and environment variables resetting to default values after using Amplify pull is a known challenge when managing Amplify projects across different environments or codebases.
When you use Amplify pull, it synchronizes your local environment with the cloud backend. However, this process can sometimes overwrite custom configurations that were set outside of the Amplify CLI, such as manually adjusted timeout values in the AWS Console or through other means.
By default, Lambda functions in Amplify have a timeout of 3 seconds. The fact that you're seeing it reset to 25 seconds suggests that this might be a custom default set in your project's configuration files.
To prevent this issue from occurring, you have a few options:
-
Use Amplify CLI to set the timeout: Instead of modifying the timeout in the AWS Console, use the Amplify CLI to update the function configuration. This ensures that the changes are tracked in your local Amplify configuration files.
-
Custom resource overrides: You can create custom resource overrides in your Amplify project to specify Lambda function configurations, including timeouts. These overrides will be respected during Amplify pull operations.
-
Use environment-specific configurations: Amplify allows you to set up different configurations for different environments (dev, prod, etc.). Ensure that you're using the correct environment when pulling changes.
-
Version control your Amplify configuration files: Keep your Amplify configuration files (like amplify/backend/function/<function-name>/<function-name>-cloudformation-template.json) in version control. This way, you can track changes and restore custom configurations if they get overwritten.
To maintain consistency across your app and admin dashboard projects, consider using a shared Amplify backend that both projects can reference. This approach can help ensure that your Lambda function configurations remain consistent across different parts of your application.
Remember, when making changes to your backend configuration, it's crucial to communicate these changes to all team members and ensure that everyone is working with the most up-to-date backend setup.
Sources
Amplify Functions: Create serverless functions using TypeScript, powered by AWS Lambda | Front-End Web & Mobile
Troubleshooting Lambda configurations - AWS Lambda
Configure Lambda function timeout - AWS Lambda
AWS Amplify | Extensible Web & Mobile Apps | Amazon Web Services
answered 2 years ago
Hello,
After reviewing the above response, I would recommend you to try the above suggested solution and prevention methods. If you are still facing issues post performing the troubleshooting steps mentioned above then reach out to us via a support case and we can investigate your concern further.
answered 2 years ago
Relevant content
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 5 years ago
