Deploying to AWS
aws sub-generator
An instance based sub-generator for deploying applications via Elastic Beanstalk. This is great (and very cheap!) for small applications.
This sub-generator allows to deploy automatically your JHipster application to the Amazon AWS cloud using Elastic Beanstalk.
Limitations
- You can only use it with a SQL database (Oracle and Microsoft SQL Server aren’t supported).
- Websockets doesn’t work behind the load balancer by default.
Prerequisites
Before running the sub-generator, you need to setup your AWS SDK credentials. Log in with your Amazon AWS account and create a user for your JHipster application. To grant this user the required permissions attach the AWSElasticBeanstalkFullAccess
, AmazonRDSFullAccess
and IAMFullAccess
policies.
After that create a credentials file at ~/.aws/credentials
on Mac/Linux or C:\Users\USERNAME\.aws\credentials
on Windows.
[default]
aws_access_key_id = your_access_key
aws_secret_access_key = your_secret_key
If you use a named profile different than default
, you have to set the environment variable AWS_PROFILE
with the correct profile.
Deploying your application
To deploy your application to Amazon AWS, type:
jhipster aws
This should package your application in “production” mode, create a Beanstalk application (with a SQL database), upload your code on S3, and start the application.
Updating your deployed application
When your application is already deployed, you can re-deploy it by run the sub-generator again:
jhipster aws
The sub generator ask your database credentials again but they will be ignored during the update.
Deleting your application
- Delete the Elastic Beanstalk.
- Delete S3 buckets relevant to the application.
- Delete the Amazon Relational Database Service (RDS) instance.
- Delete the EC2 security groups relevant to the application. You can find this by looking at the description of the
security group which should say
Enable database access to Beanstalk application
.