Deployment of Stack to Elastic BeanStalk
Introduction
AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications that abstracts away infrastructure management, making it highly valuable for development stacks. It allows developers to simply upload their code while automatically provisioning and managing underlying resources like EC2 instances, load balancers, and auto-scaling.
Need for Stack Deployment to Elastic BeanStalk
A developer deploys a Dev stack to Elastic Beanstalk primarily to accelerate iteration speed and ensure consistency between development and production environments, thereby preventing common integration issues. A crucial scenario where this deployment is indispensable is for permission validation: When the action or resource within an IAM policy is changed. In this case the only reliable way to validate the change is to perform a full deployment. Unlike simple local builds via Jenkins/GitHub, an actual deployment test forces the underlying IAM role assumed by the Beanstalk environment to execute the sensitive actions, immediately verifying if the new, more restrictive policy works without breaking the deployment pipeline.
How to deploy the stack
Verify and delete all existing CloudWatch log groups associated with the stack prior to deployment.
Before deployment, verify that the deployment binary for the version you intend to use is entirely absent from s3 bucket dev-configuration.sagebase.org/versions. There is three folder in s3 bucket portal, services-repository and services-workers because three stacks will be deployed, all should not contain the binary of version which need to be deployed. As a safety measure to prevent conflicts, always select a version number lower than the one currently active in the Main stack; for example, if the Main stack is running version 564, prefer using 563 or an older version for your current deployment.
Check and delete any existing CloudFormation stacks with the same name before building a new one.
Create a new stack http://build-system-ops.dev.sagebase.org:8080/job/build-test-stack/ with parameters as below.
Once the CloudFormation stack successfully builds, the Elastic Beanstalk environment will be visible.
Check Log
If the environment health is degraded or you are investigating an issue, consult the multiple available logging options for diagnosis.
Check the environment log.
Check the instance log by connecting to the instance. click on “Connect” button.
Run below command to get latest log.