AWS Public vs Private vs Elastic IP Defined

A summary of the differences between Public vs Private  vs Elastic IP in a AWS environment.

Public IPs:

        1.  IP assigned to one Machine and is routable on the internet.

        2.  IP is unique and never duplicated at the same time.

        3.  Can easily be geographically located.

Private IPs

        1.  IP only identifiable on private network.

        2.  IPs unique on single private network but can be duplicated on another.

        3.  IP must go through internet gateway as a proxy to access internet.

        4.  IP is that can be used are specified in a range.

Elastic IPs

        1.  Stopping and Starting an EC2 Instance, public IP can change.

        2.  To get a stable IP for EC2 Instance, you have to request an Elastic IP

        3.  Elastic IP is a public IPv4 address you own until deleted.

        4.  Elastic IP can only be attached to single EC2 Instance at a time.

        5.  Elastic IP allow you to mask Instance failure with rapid remapping to another Instance.

EC2 Instances by default come with:

        1.  One Private IP Address for internal AWS network.

        2.  One Public IP for internet.

        3.  SSH must use the public IP because it is assumed you are on outside network.

        4.  Starting and Stopping can cause the Public IP to Change.

  •  

AWS Spot Request

1.   The following is required before you create IAM user for your AWS Free Tier Account.

                -An Active AWS Account with admin level permissions.

2.   Logon to AWS as an IAM user at URL:  https://signin.aws.amazon.com/

3.   From the Home Console type EC2 in the search bar, select the star next to EC2, and select EC2

4.   Scroll down on right hand menu bar select Spot Request.

5.   We can view the Pricing history for spot instances, by clicking Pricing history button.   This will allow you to see the saving you could obtain by choosing a spot instance over an on-demand instance.

6.   Click on Create Spot Fleet request button to submit a request.

7.   Complete the following request and select Launch for AWS to start processing your request.

8.   Note:  At the bottom gives you a summary of the hourly cost of this spot request.

9.   To simply request a single spot instance you place the request under Instance Create-? Advance options.

AWS Spot Instances and Spot Fleet

Spot Instances are the cheapest available resource on AWS, but they are not guaranteed to be available and may become unavailable while the instance is running. So spot instances are effective at decreasing the overall cost by as much as 90% compared to On-demand, but are not suitable for required computer services. The following are specification of Spot Instances.

1. Can reduce cost up to 90% compared to On-demand

2. Hourly spot prices for service change continuously

3. You can set a max spot price you are willing to pay

a. If the max spot price you defined is exceeded, you have a 2 minute grace period

b. You must decide to either stop or terminate your instance

4. You have an option for a Spot Block

a. Guarantees no interruptions from 1 to 6 hours of time

b. Spot Blocks were supported after 31 Dec 2022

Placing Spot Requests – Request for spot resources, that contains:

1. Max Price

2. Desired number of instances

3. Launch specifications

4. Request type: one-time or persistent

a. one-time is removed once request is complete

b. persistent will become request again once it is stopped or terminated

5. Valid start time and stop time

Spot Requests Specifics:

1. Request is made and AWS attempts to fill request.

2. You can only cancel while in open, active, or disabled states.

3. You have to cancel spot request and terminate any instances created by the request. In this order

4. Canceling spot requests does not terminate running instances.

Spot Fleet – is a set of spot instance + optional on-demand instances.

1. Spot Fleet will try to fill the target resources with the price set by customer.

2. AWS will take available pools of varing instance type, OS, and Availability Zones to attempt to meet request.

3. You can have multiple launch pools the fleet can choose from.

4. Spot fleet stops launching instances when capacity or max price is reached.

5. Spot Fleets allow us to automatically request spot instances with the lowest price.

Strategies in Spot Fleet

1. LowestPrice – from pools with lowest cost.

2. Diversified – Distribute across all available pools.

3. CapacityOptimized – From pools with optimal capacity for number of instances.

4. PriceCapacityOptimized – this is the recommended approach. Select from the pools with highest capacity avaiblable and then the lowest price.