Elastic Beanstalk groups application versions and environments. The Standard web and worker sections explain EC2 deployments, configuration, health, and the choices that preserve serving capacity and database availability.
Elastic Beanstalk basics
AWS Elastic Beanstalk takes your application and builds the environment that runs it.
How it works
- Upload the application.
- Elastic Beanstalk provisions compute, load balancing and monitoring.
- It scales the environment as load changes.
Exam cues
- If the question says deploy an app without setting up the infrastructure yourself, think Elastic Beanstalk.
Remember
- Handles provisioning, load balancing, health and scaling.
Trap: You still own and can see the resources Elastic Beanstalk creates; it is not serverless.
From the AWS docs (6)
- AWS Elastic Beanstalk deploys web applications: you upload the app and it provisions EC2 instances or EKS clusters, load balancing, health monitoring and scaling.
- An application groups versions, environments, and environment configurations.
- An application can have independent environments running the same or different application versions.
- With Elastic Beanstalk you upload an application source bundle and it provisions and runs the AWS resources, such as EC2 instances, a load balancer and Auto Scaling, while you keep control of them.
- Elastic Beanstalk has no additional charge; you pay only for the AWS resources your application uses.
- Basic health reporting uses load balancer health checks (or EC2 status checks in a single-instance environment), checks that the Auto Scaling group has at least one instance, and publishes no metrics to CloudWatch.
Applications, environments, and roles
Elastic Beanstalk Standard deploys application code on managed EC2 environments. An application groups related versions and environments; each environment is an independently configured running deployment. A platform is the operating system, language runtime, and server software used to run that code.
How it works
- Create an application and upload a version. A version is a label pointing to code in S3. Package a single ZIP or WAR of at most 500 MB with the application files at its root, without an enclosing folder.
- Create an environment for that version and platform. Use separate environments for test and production, even when they run the same version.
- Supply the service roleAn IAM role that an AWS service assumes to perform permitted actions for you. for Beanstalk’s management actions and an EC2 instance profileA wrapper that passes an IAM role to an EC2 instance., the wrapper that gives application instances an IAM role. IAM roles grant permission to call AWS APIs. The web and worker policies are
AWSElasticBeanstalkWebTierandAWSElasticBeanstalkWorkerTier. - Choose capacity and the request entry point. Auto Scaling maintains the instance count and replaces terminated instances. A load balancer distributes incoming requests across instances.
- For HTTPS terminationDecrypting a secure client connection at the load balancer before forwarding the request., where the load balancer decrypts client requests, attach a certificate to an ALB HTTPS listenerA load balancer endpoint configured to accept connections on a protocol and port., typically port 443. ACM supplies certificates. Allow the backend application port from the load balancer in the instance security groupA set of rules controlling traffic allowed to and from attached resources., the rules that control allowed traffic.
| Environment choice | Request path | Capacity behavior |
|---|---|---|
| Single instance | Elastic IPA static public IPv4 address allocated to an AWS account., a fixed public IP address, directly to EC2 | Auto Scaling minimum, maximum, and desired capacity are 1; no load balancer |
| Load balanced | Load balancer to EC2 | Auto Scaling adjusts capacity; can span Availability Zones |
| Shared ALB | Existing Application Load Balancer to environments | Choose sharing at creation; cannot switch to or from dedicated later |
For the Standard Docker platform without Compose, use a Dockerfile to build an image locally or Dockerrun.aws.json v1 to identify an image in a hosted repository. An image is the packaged container software. If both files are provided, put both at the archive root; the Dockerfile determines the image.
Exam cues
- If the question says isolated test and production versions of one application, think separate environments, because an application groups independent deployments.
- If the question says an uploaded archive has an extra enclosing directory, think fix the bundle root, because Beanstalk expects the application files there.
- If the question says a single instance failed, think Auto Scaling replacement, because single-instance mode still has an Auto Scaling groupA group that maintains a configured count of EC2 instances..
- If the question says shared load balancer across environments, think choose a shared ALB at environment creation, because this choice cannot be changed later.
- If the question says HTTPS works at the ALB but a custom backend port is blocked, think instance security group ingress, because the load balancer must reach the application port.
Remember
- Source archive: ZIP or WAR, at most 500 MB, no enclosing directory.
- Single instance: Elastic IP, no load balancer, capacity fixed at 1.
- Service role: Beanstalk actions. Instance profile: application instance actions.
- With enhanced health authorization enabled, custom profiles need
elasticbeanstalk:PutInstanceStatisticsto send health data. - Elastic Beanstalk: no extra charge, pay for the resources.
Trap: A single-instance environment still uses Auto Scaling. It maintains one instance rather than adding instances for increasing traffic.
The ALB listener accepts HTTPS using its assigned certificate.
The instance security group allows traffic from the load balancer to the application port.
From the AWS docs (28)
- An application version labels deployable code stored as an S3 object.
- Beanstalk Standard runs applications on EC2.
- A platform combines an operating system, runtime, servers, and Beanstalk components.
- A source bundle consists of one ZIP or WAR archive.
- A source bundle cannot exceed 500 MB.
- A source bundle must not include a parent directory.
- The service role lets Beanstalk manage and monitor environment resources.
- An instance profile passes an IAM role to EC2 instances so their applications can access permitted AWS resources.
- AWSElasticBeanstalkWebTier and AWSElasticBeanstalkWorkerTier provide permissions for web and worker instances respectively.
- A custom instance profile needs elasticbeanstalk:PutInstanceStatistics when enhanced health authorization is enabled; missing permission can produce No Data.
- A single-instance environment has one EC2 instance with an Elastic IP and no load balancer.
- A single-instance environment uses an Auto Scaling group whose minimum, maximum, and desired capacity are all 1.
- A load-balanced environment distributes requests across EC2 instances.
- A scalable environment can run instances across multiple Availability Zones.
- Auto Scaling replaces terminated instances even in a single-instance environment.
- Multiple environments can use an existing shared Application Load Balancer.
- Choose a shared or dedicated load balancer during environment creation; that choice cannot be changed later.
- For HTTPS termination on an Application Load Balancer, configure an HTTPS listener, typically port 443, and assign a certificate, preferably from ACM.
- The instance security group must allow load balancer traffic on the application port; a nonstandard backend port needs an appropriate inbound rule.
- A Dockerfile builds an image locally on the Standard Docker platform without Compose.
- Dockerrun.aws.json v1 selects an image from a hosted repository on the Standard Docker platform without Compose.
- If both files are provided, the Dockerfile determines the image.
- Dockerfile and Dockerrun.aws.json belong at the source archive root.
- An Elastic IP is a static public IPv4 address.
- A security group controls allowed incoming and outgoing resource traffic.
- With Elastic Beanstalk you upload an application source bundle and it provisions and runs the AWS resources, such as EC2 instances, a load balancer and Auto Scaling, while you keep control of them.
- Elastic Beanstalk Docker platforms run applications in any language or runtime packaged as a container image.
- Elastic Beanstalk custom platforms are retired: on July 18, 2022, all Amazon Linux AMI platform branches, including custom platforms, were retired.
Flashcards
Nothing to review here right now. Pick other topics or another filter.
·
All 12 cards as a list
Developers want to upload application code and have AWS create the servers, load balancer and scaling for them. Which service fits?
AWS Elastic Beanstalk.
An Elastic Beanstalk team needs isolated test and production deployments of one application. How should it organize them?
Create separate environments in the same application. They can run different application versions independently.
A developer wants to upload a web application and have AWS provision the servers, load balancing and scaling, with no extra service fee. Which service fits?
AWS Elastic Beanstalk.
It has no additional charge; you pay for the EC2 instances and other resources it creates.
What does Elastic Beanstalk basic health reporting check, and does it publish metrics to CloudWatch?
Load balancer health checks (or EC2 status checks for a single instance) and that the Auto Scaling group has at least one instance. It publishes no CloudWatch metrics; enhanced health adds an agent and more data.
Which roles distinguish Elastic Beanstalk service permissions from application instance permissions?
The service role lets Beanstalk manage and monitor resources. The EC2 instance profile supplies the role used by application instances.
A team wants AWS to provision and run EC2 resources for an uploaded application while retaining control of those resources. Which service fits?
AWS Elastic Beanstalk. It provisions resources such as EC2 instances, a load balancer and Auto Scaling for the application.
Does an Elastic Beanstalk single-instance environment use Auto Scaling or a load balancer?
It uses an Auto Scaling group fixed at one instance, with an Elastic IP and no load balancer. The group replaces terminated instances.
An Elastic Beanstalk application must distribute requests across instances in multiple Availability Zones. Which environment fits?
A load-balanced environment. It distributes requests across EC2 instances and can run them in multiple Availability Zones.
An Elastic Beanstalk application needs HTTPS at its ALB and traffic forwarded to a custom backend port. What must be configured?
Assign a certificate to an HTTPS listener and allow traffic from the load balancer to the application port in the instance security group.
A team wants to deploy a containerized application with AWS Elastic Beanstalk. Which platform supports this use case?
An Elastic Beanstalk Docker platform. It runs applications packaged as container images.
An application on Elastic Beanstalk EC2 instances needs access to permitted AWS resources. How should the team grant that access?
Use an instance profile to pass an IAM role to the instances. The application can use that role to access permitted resources.
A team must run an app on Elastic Beanstalk in a language Beanstalk has no managed platform for. What should it use?
A Docker platform with the app packaged as a container image. Custom platforms were retired on July 18, 2022.