Amplify-cli: How to setup prod and dev hosting?

Created on 7 Sep 2018  Â·  43Comments  Â·  Source: aws-amplify/amplify-cli

What is the best practice for using amplify-cli to deploy to dev and prod environments?

feature-request

Most helpful comment

Based on all of your feedback, we’ve released a beta version of the CLI (npm install -g @aws-amplify/cli@multienv) to support multiple environments, team workflows and integrate with your CI/CD flows.
Please check out this documentation for more details - https://aws-amplify.github.io/docs/cli/multienv?sdk=js
Also, as a part of our feedback mechanism, we’ve opened up another GitHub issue, to track feedback from everyone, iterate on this beta version and then merge it to master. We'll close this issue and track feedback in #508. Looking forward to your feedback on this release.

All 43 comments

@rygo6 I'm a PM on the team and would love to chat with you to share our plans on how to handle multiple environments. Let me know your email and I'll set something up.

@swaminator I'd like to have such a conversation as well (have also read over https://github.com/aws-amplify/amplify-js/issues/875 which seems similar).

You're welcome to send me an email at [email protected]

@swaminator I'd like to have such a conversation as well
You're welcome to send me an email at [email protected]

@SagarMhatre @samueljseay @alukach I've sent you all emails. Please do have a look.

@swaminator , can you also include me in the mail [email protected] thanks

I'll appriciate being included as well @swaminator , with my email [email protected]

@swaminator please could you send me details also. Am using Amplify and want to manage deployments in dev/staging/production in a clean, simple way. [email protected]. thanks

@swaminator My team is very interested in how to handle this as well. [email protected]

I'd be interested in this as well [email protected]

Is there any word on an official workflow being put out for this?

I'm interested as well. wshaddix_at_web.com

@swaminator Me and my Team are also interested.
c.[email protected]

@swaminator Is there a workaround for this either official or not? We're trying to decide whether to go with Amplify or not on a new project. [email protected]

TBH, I would not use amplify on a major project yet. Lots of potential. But needs some more development. If it's a smaller project where you can deal with something more expirimental, and not everything needs to be perfect. Probably would be good, then you can give them some feedback. Tons of great ideas and great direction, but needs more development.

I'm also interested about separating dev, prod and staging environments [email protected]

sign me up - [email protected]

Awesome to see the interest! I'm going to get in touch with all of you this week.

TBH, I would not use amplify on a major project yet. Lots of potential. But needs some more development. If it's a smaller project where you can deal with something more expirimental, and not everything needs to be perfect. Probably would be good, then you can give them some feedback. Tons of great ideas and great direction, but needs more development.

@rygo6 would you be open to chatting? Please share your email.

I'm curious too: [email protected]

TBH, I would not use amplify on a major project yet. Lots of potential. But needs some more development. If it's a smaller project where you can deal with something more expirimental, and not everything needs to be perfect. Probably would be good, then you can give them some feedback. Tons of great ideas and great direction, but needs more development.

@rygo6 would you be open to chatting? Please share your email.

sure, email is [email protected]

Hi I'm super interested in how to accomplish this too.
[email protected]

@rygo6 @alukach @SagarMhatre @gcid12 @Myrberg @chrisfowler @sp-tenovos @cgreening @hisham @wshaddix @ChrisWun @brianhilst @JustFly1984 @CodySwannGT @alphara @austinamorusocfc @southerneer
We're currently brainstorming and working towards providing a CI/CD workflow as a part of the Amplify CLI, and in doing so we want to work backwards from the customer needs and we've opened up an issue (https://github.com/aws-amplify/amplify-cli/issues/286) as a part of the CLI repo to track this story.
Would be great, if you guys could take a look at it and respond back with some answers to the questions mentioned in the issue (https://github.com/aws-amplify/amplify-cli/issues/286) which would give us a better idea about your needs. Thanks!

@swaminator i would love to join to conversation, i'm experienced in aws (having aws pro architect and pro devops certs) and just starting a project which involves mobile app (react-native, both ios and android), webapp (react) and at the backend, i'm planning to use lambda, dynamodb mainly but also probably kinesis, sqs, ses... we're using codecommit for repo, and i want to use codebuild, codepipeline (maybe codedeploy if necessary?) for ci/cd.

@ahmetcetin We opened up an RFC as a part of this repo to gather information from customers.
Could you please respond to the same at https://github.com/aws-amplify/amplify-cli/issues/286

Based on all of your feedback, we’ve released a beta version of the CLI (npm install -g @aws-amplify/cli@multienv) to support multiple environments, team workflows and integrate with your CI/CD flows.
Please check out this documentation for more details - https://aws-amplify.github.io/docs/cli/multienv?sdk=js
Also, as a part of our feedback mechanism, we’ve opened up another GitHub issue, to track feedback from everyone, iterate on this beta version and then merge it to master. We'll close this issue and track feedback in #508. Looking forward to your feedback on this release.

That's awesome news about the release with multiple environments!

I am very much interested as well [email protected], could you please include me as well?

@alexdorand We've launched support for this in beta and made it publicly available for feedback.
Please checkout the the following announcement:

Based on all of your feedback, we’ve released a beta version of the CLI (npm install -g @aws-amplify/cli@multienv) to support multiple environments, team workflows and integrate with your CI/CD flows.
Please check out this documentation for more details - https://aws-amplify.github.io/docs/cli/multienv?sdk=js
Also, as a part of our feedback mechanism, we’ve opened up another GitHub issue, to track feedback from everyone, iterate on this beta version and then merge it to master. We'll close this issue and track feedback in #508. Looking forward to your feedback on this release.

The Amplify CLI now supports team workflows. If you're looking to use the Amplify CLI in conjunction with the Amplify Console, you can view the recommended workflow here: https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html

Hi, I would also like to set up the environments for my project. @swaminator please help me. my email id is [email protected]

You have to install the lastest version of the amplify/cli, latest version
of vanilla amplify does not have latest cli last i checked. Latest cli has
multienv.

On Mon, May 13, 2019, 2:26 PM Zachary Carter notifications@github.com
wrote:

I don't think this issue should be closed - it still doesn't seem possible
to publish multiple hostings, multienv or not... Unless the answer is - it
isn't possible with the CLI and you need to use the console.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/aws-amplify/amplify-cli/issues/128?email_source=notifications&email_token=ABKL3EFHFXXEA4SG3J2OEXDPVHMHTA5CNFSM4FT5LJV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVJTQHA#issuecomment-491993116,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABKL3EFU2YLXSHB3GK64VDDPVHMHTANCNFSM4FT5LJVQ
.

Hi, I would also like to set up the environments for my project. @swaminator please help me. my emai is [email protected]

@swaminator could you share as well? [email protected]

Just to update @dreadjr @orland1to @puneetrastogi90. The Amplify CLI and Amplify Console now support multiple envs. If you're looking to use the Amplify CLI in conjunction with the Amplify Console, you can view the recommended workflow here: https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html

Is it possible to have one environment (dev) that only uses s3 and http and another enviornment (prod) that uses cloudfront and https? I have created different environments but if I do "amplify hosting configure" in one environment the changes effect the other environment as well

I also see this issue. We (currently) don't allow external access to our source code so hooking into the AWS CI/CD workflow isn't really a fit for us at the moment.

Is it possible to have one environment (dev) that only uses s3 and http and another enviornment (prod) that uses cloudfront and https? I have created different environments but if I do "amplify hosting configure" in one environment the changes effect the other environment as well

Is it possible to have one environment (dev) that only uses s3 and http and another enviornment (prod) that uses cloudfront and https? I have created different environments but if I do "amplify hosting configure" in one environment the changes effect the other environment as well

@AshkanHovold Starting from your `dev env:

  1. amplify env add createprod which is a clone of dev at this point.
  2. amplify hosting remove
  3. amplify hosting add and add CloudFront this time round.

Let me know if that works.

I also see this issue. We (currently) don't allow external access to our source code so hooking into the AWS CI/CD workflow isn't really a fit for us at the moment.

Is it possible to have one environment (dev) that only uses s3 and http and another enviornment (prod) that uses cloudfront and https? I have created different environments but if I do "amplify hosting configure" in one environment the changes effect the other environment as well

@rmcvicar You could use our headless scripts in your own CI/CD system: https://github.com/aws-amplify/amplify-cli/tree/master/packages/amplify-cli/sample-headless-scripts

Is it possible to have one environment (dev) that only uses s3 and http and another enviornment (prod) that uses cloudfront and https? I have created different environments but if I do "amplify hosting configure" in one environment the changes effect the other environment as well

@AshkanHovold Starting from your `dev env:

  1. amplify env add createprod which is a clone of dev at this point.
  2. amplify hosting remove
  3. amplify hosting add and add CloudFront this time round.

Let me know if that works.

@swaminator , This didn't work for me. I removed hosting from prod, added hosting back with CloudFront, but when I switched back to dev, that environment also wanted to update to CloudFront hosting.

Yes I have managed to have s3 on my "dev" environment and cloudfront on my "production" environment. If I publish production with cloudfront and then switch to my dev environment I have to do
"amplify configure hosting" and remove cloudfront from there. If I publish it there then switch to production again, I need to re-add cloudfront there by doing "amplify configure hosting" again. It is very easy to miss this.
Imo this feels like a bugg but from amplify guides I have found it looks like this is by design? I would think having different environments with different setup is desired?

I would like my dev env to be simply http and my prod env to use S3 and CloudFront.

Currently I am stuck with CloudFront on my dev env (not necessary). I guess this will have to do for now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DonPepone picture DonPepone  Â·  70Comments

janhesters picture janhesters  Â·  78Comments

varmab picture varmab  Â·  41Comments

ChrisWun picture ChrisWun  Â·  43Comments

rygo6 picture rygo6  Â·  93Comments