Mais conteúdo relacionado Semelhante a Building Web Apps on AWS (20) Mais de Amazon Web Services (20) Building Web Apps on AWS1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pop-up Loft
Building Web Apps with AWS CodeStar and AWS Elastic Beanstalk
Len Henry
Sr. Solutions Architect
2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What we will learn today
• What is AWS CodeStar?
• How do I use AWS CodeStar to rapidly develop on AWS (demo)?
• What is AWS Elastic Beanstalk?
• How do I run my application in production with Elastic Beanstalk (demo)?
3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS CodeStar
4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS CodeStar
Quickly develop, build, and deploy applications on AWS
• Start developing on AWS in minutes
• Choose from a variety of project templates
• Manage software delivery easily
• Work across your team securely
5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS CodeStar
• Some notable features
– Free
– Integration with Cloud9 IDE
– Works with
• EC2, Lambda, CodeCommit, CodeBuild, CodePipeline,
CodeDeploy, CloudFormation, CloudWatch, Elastic
Beanstalk
• GitHub, Atlassian JIRA
6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS CodeStar Demo
• Application Architecture
• Syncing the code
• Initial Deployment
• Updating your code with Cloud9
7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Elastic Beanstalk
8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What is Elastic Beanstalk?
Elastic Beanstalk is an easy-to-use service for
deploying, scaling, and managing web applications
and services
9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Elastic Beanstalk benefits
Fast and simple
to begin
Developer
productivity/agility
Impossible
to outgrow
Complete
resource control
No additional charge to use Elastic Beanstalk—you pay only for underlying AWS
resources (i.e., EC2 instances, Amazon S3, etc.)
10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
On-instance configuration
Your code
HTTP server
Application server
Language interpreter
Operating system
Host
Elastic Beanstalk configures each
Amazon EC2 instance in your
environment with the components
necessary to run applications for
the selected platform
Focus on building your application
Provided by you
Provided and managed by Elastic Beanstalk
11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Infrastructure stack
• Preconfigured infrastructure
• Single instance (dev, low cost)
• Load-balanced, Auto Scaling (production)
• Web and worker tiers
• Elastic Beanstalk provisions necessary infrastructure
resources, such as the load balancer, Auto Scaling group,
security groups, database (optional), etc.
• Provides a unique domain name for your application
(e.g., youapp.regionx.elasticbeanstalk.com)
12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Building blocks
Application
Application versions ( v1, v2, …,vn)
Environment 1 Environment 2 Environment … n
13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Getting started with AWS Elastic Beanstalk
14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
How to deploy applications
1. Via AWS Management Console
2. Via AWS Toolkit for Eclipse and Visual Studio
IDE
3. Via AWS SDKs and AWS CLI
4. Via AWS Code Pipeline
5. Via Elastic Beanstalk command line interface
$ eb deploy
15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Elastic Beanstalk Demo
• Application Architecture
• Setting up Elastic Beanstalk
• Setting Up CodePipeline with CodeCommit and Elastic
Beanstalk
• Updating your code with Cloud9
16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Elastic Beanstalk Best Practices
17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Dependency Management
{
"name": "Elastic-Beanstalk-Sample-App",
"version": "0.0.1",
"private": true,
"dependencies": {
"ejs": "latest",
"aws-sdk": "latest",
"express": "latest",
"body-parser": "latest"
},
"scripts": {
"start": "node app.js"
}
}
Bad idea to do this for production environments
18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Dependency Management
{
"name": "Elastic-Beanstalk-Sample-App",
"version": "0.0.1",
"private": true,
"dependencies": {
"ejs": "2.3.3",
"aws-sdk": "2.1.39",
"express": "4.13.1",
"body-parser": "1.13.2"
},
"scripts": {
"start": "node app.js"
}
}
Always lock down versions of dependencies.
19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Testing/Tuning Your Application
• Pick performance metrics you want to optimize for (e.g.: latency, concurrent
users, number of web requests, etc.)
• Load test your application
– Start with auto-scaling minimum and maximum of 1 to understand how your application
degrades under an over load condition
– Understand available metrics and how they correspond to your performance metric.
• Configure auto-scaling to optimize for performance metrics
– Number of instances to add on scale out
– Breach duration
– Metric to scale on
• Tune backend (DynamoDB, RDS, etc.) for optimal performance, leave enough
headroom for full scale out
20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Logs, Metrics, & Alarms
• Enable log rotation to automatically publish logs to S3.
• Understand metrics available for your environment and
what they mean.
• Setup alarms to automatically monitor critical metrics and
send notifications when metrics are outside normal
operating range.
• Enable Amazon Route 53 health checks and alarms.
21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Tag your environments
• Makes it easy to find resources belonging to a given environment.
• Can be used to monitor costs associated with a given environment and/or
application.
• AWS Elastic Beanstalk automatically tags environments with:
– Environment Name
– Environment ID
22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Summary
• Get your development environment started quickly with
CodeStar
• Use Elastic Beanstalk for operating production workloads
• Use AWS Developer Services, such as CodeCommit and
CodePipeline to do CI/CD
23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Next Steps
• AWS DevOps Blog: https://aws.amazon.com/blogs/devops/
• AWS 10 Minute Tutorials:
• https://aws.amazon.com/getting-started/tutorials/build-serverless-
application/
• https://aws.amazon.com/getting-started/tutorials/launch-an-app/
• https://aws.amazon.com/getting-started/tutorials/continuous-
deployment-pipeline/
24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pop-up Loft