Mr.DevEng
Mr.DevEng

Reputation: 2421

Deploying Angular 2 application into AWS Elastic Beanstalk

I am now developing a front-end application using angular 2. This id for communicating with another micro services deploying in cloud. In this Angular 2 application I am not using database interaction.

I need to deploy this Angular 2 application in elastic beanstalk (AWS PaaS). What are the important procedure that I need to follow for deploying into cloud? I am new to angular framework and cloud platforms. How can I deploy my Angular 2 application into AWS Elastic Beanstalk?

Upvotes: 2

Views: 3125

Answers (2)

Darryn Smith
Darryn Smith

Reputation: 47

I think it's got something to do with the aws-sdk imported requiring a node runtime environment to execute properly. So the EBS machine and EC2 instances work for that specific use case as hosting a SPA via s3 does not have a nodejs runtime environment.

Upvotes: 1

VadimB
VadimB

Reputation: 5711

Do you need exactly to elastic beanstalk or you need just deploy to AWS using any suggested solutions?

If second - simplest way is to deploy Angular2 to S3 bucket, configured to serve static files:

  • Go to S3
  • Create new bucket
  • Open bucket
  • Go to "Properties" tab enter image description here
  • Select "Static website hosting" enter image description here
  • Check "Use this bucket to host a website" and provide "index.html" for both index and error pages enter image description here
  • Build solutions using "ng build"
  • Copy build results from "build" folder into this bucket
  • Navigate to links, displayed in "Static website hosting" section

Upvotes: 7

Related Questions