question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to create PROD environment from my DEV environment?

See original GitHub issue

@ericclemmons @RossWilliams Currently happily using aws-amplify v1.1.29, other versions have left my project shaky so i am happy in this one. I’m almost at a stage where i’m ok to have my amplify project (which i believe i set up with a DEV denomination), to a PROD one.

Could someone let me know, step by step how i can safely make a duplicate/replica PROD environment of my DEV environment? Also, how, when i’m happy with updates in DEV, how do i safely make these changes available in the PROD environment?

p.s. i’m not using GitHub

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
RossWilliamscommented, Jul 29, 2020

You can create many environments at practically zero cost as long as you don’t use the @searchable directive. The cli command is: amplify env add and follow the prompts to create a new environment. Then you can push to that environment amplify push --yes and switch back and forth between environments amplify env checkout DEV|PROD|TEST|NEXT

For my iOS app I switch back and forth between environments by using a ENV files that holds information about user pool ids, client ids, endpoints, etc. I then setup a schema in XCode for each environment and set the ENVFILE environment variable for the run process. I also change the bundle ID and display name for each environment so that i can have 4 versions of my app on a phone at once.

What you need to remember about deploying to production - after the initial deployment, you can’t modify more than 1 GSI at a time on each DynamoDB table. You need to be aware that if you schema evolves greatly, you then need to plan out multiple deploys.

For production you need to consider a few other items. These are some random things to check that I can remember off the top of my head. You likely want to consult a more general “how to manage an AWS account” guide:

  1. Cloudwatch alarms. Do you have proper alerting setup for all of your componenents? You may want to run a filter across logs, or just use existing metrics to create alarms.
  2. Cloudtrail alarms. Very similar to cloudwatch, make sure nothing strange is going on.
  3. Guard Duty monitoring.
  4. Cognito limits - you need to request service limit increases if you are using things like SMS MFA, by default the limit is just $1.
  5. Setup an email address to send email from rather than using the Cognito default. If you do use your own domain for email sending, make sure things like SPF, DKIM, DMARC are setup.
  6. Billing alerts - consider setting up multiple alerts to keep an eye on spend.
  7. Check you Lambda memory size, the default of 128MB might not have great performance.
  8. Set an alert when production is updated to catch any production updates you aren’t expecting.
  9. Lock your root account away and don’t use it. Consider creating a base console login that is readonly. You don’t want to be in the habit of changing resources through the console.
  10. Remember if your app is behind a login Apple will need an account to test your app.
  11. If you need to seed your database with data, you may want to create a Lambda that does this and setup a custom resource in cloudformation for it to run when you create a new environment.
  12. Update your cloudwatch log expiry time. you don’t want to pay for piles of log data you don’t need.
1reaction
ttngocthaocommented, Jan 18, 2021

Hi there, I’ve got a question regarding to this. How can i replicate/copy data (data from DynamoDB, user data from Cognito) from the dev environment to the pro environment? Is there a way? How can i do it? Could anyone please to advise me?( Sorry if my question is silly because i’m new to this field.!)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building & Releasing to Deployment Environments - Harness
Leverage multiple deployment environments to thoroughly validate changes before pushing them to production. Make sure that your pre-prod or ...
Read more >
Create target environment - Azure Pipelines - Microsoft Learn
Create an environment ... Select Pipelines > Environments > Create environment. ... Enter information for the environment, and then select Create.
Read more >
How to create a development environment - SashiDo.io
All you need to do is navigate to your SashiDo dashboard and click on the “Create New App” button at the bottom right...
Read more >
Create Production and Development Environments on AWS
main.tf – configures the resources that make up your infrastructure. · variables.tf- declares variables to mark the dev and prod environments, along with...
Read more >
Set up projects for development and production environments
Create a project for your development environment. · Implement the snippet in the head tag for that environment. · Add the collaborators who...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found