What AWS Resources/Services are used when creating an AWS Elastic Beanstalk Ruby/Rails Application Environment [AWS free tier]?

Viewed 109

Intent: understanding AWS Cloud Infrastructure Resources Services Configurations and related cost implications [AWS free tier]

Context: Creating a Ruby application environment for example the sample application using only the console

Does Elastic Beanstalk handle the cleanup? How to verify?

2 Answers

Source: AWS Official Docs EB > tutorial Rails

All of these resources are managed by Elastic Beanstalk. When you terminate your environment, Elastic Beanstalk terminates all the resources that it contains.

Environment creation takes about 5 minutes and creates the following resources:

EC2 instance – An Amazon Elastic Compute Cloud (Amazon EC2) virtual machine configured to run web apps on the platform that you choose.

Each platform runs a specific set of software, configuration files, and scripts to support a specific language version, framework, web container, or combination of these. Most platforms use either Apache or NGINX as a reverse proxy that sits in front of your web app, forwards requests to it, serves static assets, and generates access and error logs.

Instance security group – An Amazon EC2 security group configured to allow inbound traffic on port 80. This resource lets HTTP traffic from the load balancer reach the EC2 instance running your web app. By default, traffic isn't allowed on other ports.

Load balancer – An Elastic Load Balancing load balancer configured to distribute requests to the instances running your application. A load balancer also eliminates the need to expose your instances directly to the internet.

Load balancer security group – An Amazon EC2 security group configured to allow inbound traffic on port 80. This resource lets HTTP traffic from the internet reach the load balancer. By default, traffic isn't allowed on other ports.

Auto Scaling group – An Auto Scaling group configured to replace an instance if it is terminated or becomes unavailable.

Amazon S3 bucket – A storage location for your source code, logs, and other artifacts that are created when you use Elastic Beanstalk.

Amazon CloudWatch alarms – Two CloudWatch alarms that monitor the load on the instances in your environment and that are triggered if the load is too high or too low. When an alarm is triggered, your Auto Scaling group scales up or down in response.

AWS CloudFormation stack – Elastic Beanstalk uses AWS CloudFormation to launch the resources in your environment and propagate configuration changes. The resources are defined in a template that you can view in the AWS CloudFormation console.

Domain name – A domain name that routes to your web app in the form subdomain.region.elasticbeanstalk.com.

The deploy of the sample ruby application following the official guide is in the free tier;

Using the console services one can:

  • check the additional resources created after the deployment
  • check the cleanup

It depends if is it single-instance Ruby environment, load-balanced one, or do you bundle RDS with your environment and so on.

Nevertheless, to know what exactly EB creates for you, the best way is to go to CloudFormaion (CFN) console, and check EB stack that EB provisions for you. EB environments are created through CFN, so everything that is created in your EB environment is there (exception is S3 bucket).

To get the concise list of the resource created, you can use AWS CLI:

aws cloudformation  describe-stack-resources --stack-name <awseb-stack-name> --query "StackResources[].ResourceType"

Example:

    "AWS::AutoScaling::AutoScalingGroup",
    "AWS::AutoScaling::LaunchConfiguration",
    "AWS::AutoScaling::ScalingPolicy",
    "AWS::AutoScaling::ScalingPolicy",
    "AWS::CloudFormation::WaitConditionHandle",
    "AWS::CloudWatch::Alarm",
    "AWS::CloudWatch::Alarm",
    "AWS::CloudFormation::WaitCondition",
    "AWS::CloudFormation::WaitConditionHandle",
    "AWS::EC2::SecurityGroup",
    "AWS::EC2::SecurityGroup",
    "AWS::ElasticLoadBalancingV2::LoadBalancer",
    "AWS::ElasticLoadBalancingV2::Listener",
    "AWS::ElasticLoadBalancingV2::TargetGroup"

Does Elastic Beanstalk handle the cleanup? How to verify?

Yes, because all resources are managed by a single CFN stack. Cleaning up is based on deleting the stack, which you can verify in CFN console.

Exception: S3 bucket won't be deleted. You have to do it manually.

Related