Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.66 KB

AWS-EC2-Deployment.md

File metadata and controls

36 lines (25 loc) · 1.66 KB

Deployment with AWS CodePipeline, CodeBuild, Elastic Beanstalk and EC2

Elastic Beanstalk and EC2 with IAM Roles

  • ElasticBeanstalk no longer allow to create EC2 instance profile. We need to create it manually. See article
  • EC2InstanceProfileRoleForBeanstalk. These AWS-managed policies would be sufficient:
AWSElasticBeanstalkServiceRolePolicy
AWSElasticBeanstalkWebTier
AWSElasticBeanstalkMulticontainerDocker
AWSElasticBeanstalkWorkerTier
  • ElasticBeanstalkRole, can be created automatically by Beanstalk, and must have these 2 AWS-managed policies:
AWSElasticBeanstalkEnhancedHealth
AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy

Other Elastic Beanstalk options

  • Choose default VPC, security group and deployment availablity zones
  • Disabled Automatic Managed Update, and Enhanced Monitoring

Create a Procfile into the source code

  • Create a Procfile to instruct Elastic Beanstalk on how to start the application. See Procfile
  • (IMPORTANT) we must not zip the parent folder, and we can ignore node_modules, README.md and any non-prod files. See Instructions
  • Zip Content

Better Option is to use AWS CodePipeline/CodeBuild to interac with Elastic Beanstalk