Describe the All at once deployment process, stating where it would be useful.
All instances are stopped, then we deploy the new instances.
- Fastest deployment
- Application has downtime
- Great for quick iterations in dev env.
- No additional cost
Describe the Rolling deployment.
Instances are stopped and then updated as per the predefined bucket size - e.g., 4 of v1 -> 2 of v1, 2 of v2 -> 4 of v2 (with downtime/decreased instance numbers)
- Application is running both versions at the same time
- No additional cost (instance count is never higher than max)
- Long deployment
Describe the Rolling with additional batches deployment.
Same as Rolling, except a new batch of instances are deployed alongside the old ones are, and are kept while the old ones are stopped and updated (e.g., 4 of v1 -> 4 of v1, 2 of v2 -> 2 of v1, 4 of v2 -> 6 of v2 -> 4 of v2)
Describe the Immutable deployment.
Describe Blue / Green deployment
Not a ‘direct feature’ of Beanstalk
- Zero downtime and release facility
- Create a new ‘stage’ environment and deploy v2 in there
- New env. can be validated independently and rolled back if issues
- Route 53 can be setup with weighted policies to redirect some traffic to the stage env.
- Using Beanstalk, ‘swap URLs’ when done with the env. test
What is the limit on the number of application versions Beanstalk can store, and how should you avoid hitting that limit?
1000 application versions
- Use a lifecycle policy to remove old versions (based on age of version or just total version count)
- Active versions will not be deleted
How would you avoid data loss when using a lifecycle policy to delete old Beanstalk application versions?
Select the option not to delete the source bundle in S3
How can you set Beanstalk configuration using files? What must you be careful of when using these files?
What does Beanstalk use to create all its resources? What is a use case for knowing this?
It uses CloudFormation to provision other AWS services
- You can define CloudFormation resources in you .ebextensions to provision ElastiCache, and S3 bucket etc.
If you wanted to deploy a ‘test’ version of your application, what can you do?
Clone the environment, keeping the same configuration.
How can you change your Beanstalk Load Balancer to another type of Load Balancer?
What is the issue with provisioning RDS with Beanstalk?
Database lifecycle is tied to the Beanstalk env lifecycle.
How should you manage RDS with Beanstalk for prod env?
Separately create an RDS database and provide EB application with connection string.
How do you decouple the RDS that has already been couple to a Beanstalk env?
How would you run your application as a single docker container?
Provide either:
- Dockerfile: Beanstalk will build and run the Docker container
- Dockerrun.aws.json (v1): Describe where already built Docker image is
How would you run your application as a multi docker container?
Requires a config Dockerrun.aws.json (v2) at the root of source code
- This file will be used to generate the ECS task definition
- Docker images must be pre-build and stored in ECR for example
What is an important difference between single and multi docker container setup?
Single does not use ECS - multi generates an ECS task definition to create an ECS cluster
How can you use HTTPS with Beanstalk?
How can you redirect HTTP to HTTPS with Beanstalk?
Configure the ALB (only the ALB) with a rule
What should you do to manage tasks that take a long time to complete?
Create a dedicated worker env, and push messages to this env via SQS Queue (worker env is not exposed to public)
What is a use case for Beanstalk with a Custom Platform, and what are the high level steps to do this?
Using an app language that is incompatible with Beanstalk & doesn’t use Docker
- Define an AMI using Platform.yaml
- Build that platform using the Packer software (open source tool to create AMIs)
What is the difference between Custom Platform and Custom Image