AWS Elastic Beanstalk Express Sample App with Dynamo
This sample application uses the Express framework and Bootstrap to build a simple, scalable customer signup form that is deployed to AWS Elastic Beanstalk. The application stores data in Amazon DynamoDB and publishes notifications to the Amazon Simple Notification Service (SNS) when a customer fills out the form.
This example cannot be run locally.
You can get started using the following steps:
- Install the AWS Elastic Beanstalk Command Line Interface (CLI).
- Add policies to the default instance profile to grant the EC2 instances in your environment permission to access DynamoDB and Amazon SNS:
- Open the Roles page in the IAM console.
- Choose
aws-elasticbeanstalk-ec2-role
. - On the Permissions tab, choose Attach policies.
- Select the managed policy for the additional services that your application uses. For this specific example, add
AmazonSNSFullAccess
andAmazonDynamoDBFullAccess
. - Choose Attach policy.
- Run
eb init --platform node.js --region <region>
to initialize the folder for use with the CLI. Replace<region>
with a region identifier such asus-east-2
(see Regions and Endpoints for a full list of region identifiers). - Run
eb create --sample nodejs-example-express-dynamo
to begin the creation of a sample application that contains a load-balanced environment with the default settings for the Node.js platform. - Once the environment creation process completes, run
eb open
to load the sample environment in your browser to verify the deployment has succeeded and is accessible. - Deploy the source in this bundle using
eb deploy
. - Once the deployment of this source bundle completes, run
eb open
to interact with the new webpage. - Run
eb terminate --all
to clean up.
Themes
The code includes several Bootstrap themes from bootswatch.com. You can dynamically change the active theme by setting the THEME environment variable in the Elastic Beanstalk Management Console:
Installed themes include: