EC2 Flashcards

1
Q

What is user data?

A

User data is the data that is supplied by the user at time of instance launch in the form of a script

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When is the user data executed?

A

By default, the user data scripts are run one time when you launch (creating an instance) the instance. To run the user data scripts every time you reboot or start the instance, add persist tag with the true value.

Scripts entered as user data are executed as the root user.

You can’t change the user data if the instance is running (even by using root user credentials), but you can view it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Can user data be modified?

A

Yes, Open the Amazon EC2 console > Stop your instance > Choose Actions, choose Instance Settings, and then choose Edit User Data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

is there a limit for user data

A

16KB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which user account is required for running the EC2 Instances?

A

Root User

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Security Groups?

A

Security Groups are fundamental to AWS Network Security. They control how the traffic is allowed in or out of the EC2 instances.
Security Groups only contain ALLOW rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are EC2 Purchasing options?

A
  1. On-Demand: short workload, predictable pricing
    Reserved: (Minimum 1 year)
  2. Reserved Instance: Long workload
  3. Convertible Reserved Instances: Long Workloads with Flexible Instances
  4. Scheduled Reserved Instances: e.g. every Thursday between 3 and 6 pm
  5. Spot instances - Short workloads, cheap, and can lose instances (less reliable)
  6. Dedicated Host - Book the entire physical server
  7. Dedicated Instance - No other customer will share your hardware
  8. Capacity Reservation: Allows you to reserve capacity in a specific AZ for any duration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the features of EC2 on demand?

A
  1. Pay for what you use
    1. Linux or windows- billing per second after the first minute
    2. All of the operating systems- billing per hour
  2. Has the highest but no upfront payment
  3. No long-term commitment
  4. Recommended for short-term and uninterrupted workloads, where you can’t predict how the application will behave.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the features of EC2 reserved instances?

A
  1. Up to 72% discount compared to on demand
  2. Reservation. Is either one year or three years. Three-year reservation will provide more discount
  3. Recommended for steady-state usage applications example, database
  4. you can buy or sell the reserved instances in marketplace if you don’t need them anymore.
  5. Convertible Reserved Instance: can change the EC2 instance type, Instance family, os, scope and tendency
  6. Scheduled reserved instance (deprecated): launch within the time window you reserve, commitment for one year only from the stop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what are EC2 saving plans?

A

get a discount based on long-term usage. Commit to a certain type of usage - $10/hr for 1-3 years). Usage beyond EC2 saving plans is billed at the on-demand price.

You are logged to a specific instance family and AWS region (e.g., M5 in US-East-1). but you get the flexibility to increase instant size, OS, tenancy (host, dedicated, and default)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a convertible reserved instance?

A

Enables you to exchange one or more Convertible Reserved Instances for another Convertible Reserved Instance with a different configuration, including instance family, operating system, and tenancy.

There are no limits to how many times you perform an exchange, as long as the target Convertible Reserved Instance is of an equal or higher value than the Convertible Reserved Instances that you are exchanging. For more information, see Exchanging Convertible Reserved Instances.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are EC2 spot instances?

A
  • Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud.
  • Spot Instances are available at up to a 90% discount compared to On-Demand prices.
  • You can use Spot Instances for various stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, CI/CD, web servers, high-performance computing (HPC), and test & development workloads. Because Spot Instances are tightly integrated with AWS services such as Auto Scaling, EMR, ECS, CloudFormation, Data Pipeline, and AWS Batch, you can choose how to launch and maintain your applications running on Spot Instances.
  • Moreover, you can easily combine Spot Instances with On-Demand, RIs, and Savings Plans Instances to optimize workload cost and performance. Due to the operating scale of AWS, Spot Instances can offer scale and cost savings to run hyper-scale workloads. You also have the option to hibernate, stop or terminate your Spot Instances when EC2 reclaims the capacity back with two minutes of notice.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to request an EC2 spot instance?

A
  1. Define Maxi spot price and get the instance while the current spot price is less than Max. The early spot price varies based on offering capacity. If the current spot price exceeds your Max price, you may stop or terminate your instance with a 2-minute grace.
  2. Spot block: block spot instances during a specified time frame (1 - 6 hours) without interruptions. In rare situations, the instance may be reclaimed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When to use spot instances?

A
  1. Batch jobs
  2. Data analysis
  3. Image processing
  4. Any distributed workload
  5. Workload with flexible start and end time

Not suitable for critical jobs and databases.

Spot instances are not interrupted because of higher competing bids

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to terminate spot instances?

A

You must cancel a spot request and then terminate the associated Spot instances. Canceling a spot request does not terminate instances. You only cancel spot instant requests that are open, active, or disabled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is EC2 dedicated host?

A
  • An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use. Dedicated Hosts can help you address compliance requirements and reduce costs by allowing you to use your existing server-bound software licenses.
  • Allocated for your account for a 3-year period reservation
  • More expensive
  • Useful for software that has a complicated licensing model (BYOL – Bring Your Own License)
  • Or for companies that have strong regulatory or compliance needs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are EC2 dedicated instances?

A

Dedicated Instances are Amazon EC2 instances that run in a VPC on hardware dedicated to a single customer. Your Dedicated instances are physically isolated at the host hardware level from instances that belong to other AWS accounts. Dedicated instances may share hardware with other instances from the same AWS account that is not Dedicated instances. Pay for Dedicated Instances On-Demand, save up to 70% by purchasing Reserved Instances, or save up to 90% by purchasing Spot Instances.

It does not provide the additional visibility and controls of a dedicated host. Virtualize instances and hardware just for you.

Pay only for what you use with no long-term commitments. Dedicated Instance pricing has two components: (1) an hourly per instance usage fee and (2) a dedicated per region fee (note that you pay this once per hour regardless of how many Dedicated Instances you’re running).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Comparing Dedicated Hosts to Dedicated Instances?

A

An important difference between a Dedicated Host and a Dedicated instance is that a Dedicated Host gives you additional visibility and control over how instances are placed on a physical server, and you can consistently deploy your instances to the same physical server over time. As a result, Dedicated Hosts enable you to use your existing server-bound software licenses and address corporate compliance and regulatory requirements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which instance is right in which situation?

A
  • On-demand: coming and staying in a resort whenever we like, we pay the full price
  • Reserved: like planning ahead and if we plan to stay for a long time, we may get a good discount.
  • Spot instances: the hotel allows people to bid for the empty rooms, and the highest bidder keeps the rooms. You can get kicked out at any time
  • Dedicated Hosts: We book an entire building of the resort
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are the spot fleets?

A

A Spot Fleet is a collection, or fleet, of Spot Instances and optionally On-Demand Instances.

The Spot Fleet attempts to launch the number of Spot Instances and On-Demand Instances to meet the target capacity that you specified in the Spot Fleet request. The request for Spot Instances is fulfilled if there is available capacity and the maximum price you specified in the request exceeds the current Spot price. The Spot Fleet also attempts to maintain its target capacity fleet if your Spot Instances are interrupted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is Amazon machine image in (AMI)?

A

An Amazon Machine Image (AMI) is a supported and maintained image provided by AWS that provides the information required to launch an instance. You must specify an AMI when you launch an instance. You can launch multiple instances from a single AMI when you require multiple instances with the same configuration. You can use different AMIs to launch instances when you require instances with different configurations.

You can launch an instance from an existing AMI, customize the instance (for example, install software on the instance), and then save this updated configuration as a custom AMI. Instances launched from this new custom AMI include the customizations that you made when you created the AMI.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is elastic network adapter (ENA)?

A

It provides higher packet-per-second performance and consistently lower inter-instance latencies. AWS currently supports enhanced networking capabilities using SR-IOV. SR-IOV provides direct access to network adapters and provides high performance and low latency. It’s only available for certain instance types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is Elastic Fabric Adapter (EFA)?

A

Elastic Fabric Adapter (EFA) is a network interface for Amazon EC2 instances that enables customers to run applications requiring high levels of inter-node communications at scale on AWS. Its custom-built operating system (OS) bypass hardware interface enhances the performance of inter-instance communications, which is critical to scaling these applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How many elastic IP’s you can have in your account?

A

you can only have 5 elastic IP’s in your account. You can ask AWS to increase that.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What’s the use of using elastic IP address?

A

You can mask the failure of an instance or a software by rapidly remapping the address to another instance in your account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

How many IP addresses you get by default with an EC2 instance?

A

By default, you get a private IP address for the internal AWS network and a public IP address. When we are doing SSH into our EC2 machine, we can’t use the private IP because we are not in the same network. We can only use the public IP address.

The public IP address can change if the instance is stopped and then started.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are placement groups?

A

Placement groups are a logical grouping of instances. In AWS we don’t control the hardware but we can let AWS know how we want are instances to be placed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is cluster placement?

A

Cluster instances into a low latency group in a same rack and in a same availability zone.

Pros: It can provide enhanced network speed of up to 10 gigabits per second gonna.

Cons: if rack fails, all instances fail at the same time

Use case:

  1. Big data job that needs to complete fast.
  2. Application that needs extremely low latency and high network throughput.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is the spread placement?

A

Instances spread across underlying hardware across availability zones.

Pros: reduce risk in simultaneous failure. EC2 instances are on different physical hardware

Cons: limited to 7 instances per AZ per placement group

Use case: application that needs maximum high availability. Critical applications where each instance must be isolated from failure from each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What is partition placement groups?

A

Partition – spreads your instances across logical partitions such that groups of instances in one partition do not share the underlying hardware with groups of instances in different partitions. This strategy is typically used by large distributed and replicated workloads, such as Hadoop, Cassandra, and Kafka.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is EBS volume?

A
  1. Elastic block store volume is a network drive you can attach to an instance while they are running. Since it’s a network drive, there might be a bit of latency. Think of EBS as a network USB stick.
  2. EBS volumes are like a network drive therefore, there could be a little bit of latency
  3. It allows your instances to persist data, even after their termination.
  4. They are bound to a specific availability zone.
  5. You can attach multiple EBS volumes to an instance
  6. They can only be mounted to one instance at a time - use Elastic File Store instead
  7. Root EBS volumes are deleted on termination by default
32
Q

Can EBS volume be detached from an E2 instance while it’s running?

A

Yes, EBS volume can be detached from an EC2 instance while it’s running and attached to another one quickly.

33
Q

Is it possible to increase the capacity of EBS volume?

A

Yes, it is. you’ve got built for all provisioned capacity. You can increase the capacity of the drive over time.

34
Q

Is EBS volume locked to an availability zone?

A

Yes, EBS volumes are locked to an availability zone. And EBS volume in US-E-1A cannot be attached to an instance in US-E-1B. You first need to take its snapshot to move it.

35
Q

What is EBS- DeleteOnTermination attribute?

A

It controls EBS behavior when an EC2 instance terminates. By default, the root EBS volume is deleted [attribute enabled]. By default, any other attached EBS volume is not deleted [attribute disabled]. This attribute can be used when you need to preserve root volume when an instance is terminated.

36
Q

Is it necessary to detach EBS volume to take it a snapshot?

A

It is not necessary to detach the volume, but it’s recommended?

37
Q

What are EBS’s snapshots feature?

A

EBS is a snapshot archive

  • move a snapshot to an archive tier that is 75 percent cheaper
  • takes within 24 to 72 hours for restoring the archive

Recycle bin for EBS is snapshots

  • set up rules to retain deleted snapshots so you can recover them after an accidental deletion
  • A specified attention (from one day to one year)

Fast Snapshot Restore (FSR)

  • Forces all initialization of snapshot to have no latency on the first use
38
Q

How to move EBS volume across AZ or region?

A

Take a snapshot, copy it to a S3 and then restore it another agency or region.

39
Q

how many EBS volume types are there?

A
    1. General purpose SSD volume that balances price and performance for a wide variety of workloads. It is low cost and low latency. It is best used for the system boot volume, virtual desktop, development, and testing environment.
  1. IO1 and IO2 (SSD): highest performance SSD volume for mission-critical com low latency or high throughput workloads. It should be used for critical business applications with sustained IOPS performance and database workload.
    1. It supports EBS multi-attach.
  2. St1 (HDD): low-cost HDD volume designed for frequently accessed, throughput-intensive workloads
  3. SC1 (HDD): lowest-cost HDD volume designed for less frequently accessed workloads.

HDD volumes cannot be boot volumes

EBS volumes are categorized in size, throughput, and IOPS

Only GP2/GP3 and IO1/IO2 can be used as boot volumes

IO1 and IO2 can be shared with multiple instances at the same time.

40
Q

What is EC2 instance store?

A

EBS volumes is a network drive with good but limited performance. If you need a high-performance hardware disk, use the EC2 instance store. An instance store is a disk typically attached to the host computer. You’ll specify instance store volume only when you launch it.

  • It offers better IO performance.
  • Easy to instance, lose their storage if they’re stopped
    • Good for buffer/cache/scratch data/temporary content
  • risk of data loss if hardware fails
  • Backups and replication are your responsibility
41
Q

Can you detach an instance store volume from one instance and attach it to a different instance?

A

No

42
Q

What is a AMI process?

A

AMI stands for Amazon machine image. In order to create AMI:

  1. Start an EC2 instance and customize it
  2. Stop the instance for data integrity
  3. Build an AMI - this will also create EBS snapshots
43
Q

Can instance store be used for high performance and low latency?

A

Yes, instance store is ideal for temporary storage of information that change frequently such as buffers, cache, scratch data and other temporary content. Remember that cost of instance store is included in the instance charges so it can be more cost efficient than EBS provisioned IOPS

44
Q

What’s the difference between EBS and instance store?

A

Instance store volume are sometimes called Ephemeral storage (non-persistent)

45
Q

Can EFS be mounted on many EC2 instances?

A

Yes

46
Q

Does EFS works with EC2 instances in multiple AZ?

A

Yes

47
Q

What’s the use case for EFS?

A

It can be used for content management, web serving, data sharing, WordPress.

48
Q

Does EFS work with windows or Linux?

A
  1. It works only on Linux and not windows.
  2. It uses NFSv4.1 protocol.
  3. File system scales automatically, pay per use, no capacity planning
49
Q

How does EFS security work?

A

Security groups are used to control EFS access

50
Q

What is the difference between EFS and EBS?

A
  • EFS can be mounted on hundreds of instances across AZ.
  • EFS can be used to share website files fill.
  • It is only used for Linux instances.
  • EFS is more expensive than EBS.
51
Q

What is a classic load balancer?

A

The classic load balancer is deprecated by AWS. It supports TCP (layer 4), HTTP, and HTTP (layer 7)

52
Q

What is the application load balancer?

A
  1. Application load balancer works on HTTP layer 7
  2. Load balances multiple HTTP applications across machines
  3. Load balancing to multiple applications on the same machine
  4. routing to different target groups based on a path in the URL, hostname in URL, query string, or header
  5. It’s a great fit for microservices and container-based application
53
Q

what is target group?

A

A target group is a logical group of targets. Targets can be easy to instances (can be managed by an autoscaling group), ECS tasks, lambda functions, and IP addresses (must be private IP).

54
Q

Can Application load balancer have multiple target groups?

A

Yes. But one target group can be a part of one Application load balancer

55
Q

Can single target be in multiple target groups?

A

Yes it can be

56
Q

Are target groups regional or limited to availability zones?

A

Target groups are regional construct

57
Q

What is network load balancer?

A

Network load balancer operate at the connection level, routine connections to targets-Amazon EC2 instances, containers and IP addresses based on IP protocol data.

58
Q

A Solutions Architect is creating a solution for an application that must be deployed on Amazon EC2 hosts that are dedicated to the client. Instance placement must be automatic, and billing should be per instance.

A

Dedicated Instances are Amazon EC2 instances that run in a VPC on hardware that’s dedicated to a single customer. Your Dedicated instances are physically isolated at the host hardware level from instances that belong to other AWS accounts. Dedicated instances allow automatic instance placement and billing is per instance.

“Dedicated Host” is incorrect. An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use. Dedicated Hosts can help you address compliance requirements and reduce costs by allowing you to use your existing server-bound software licenses. With dedicated hosts billing is on a per-host basis (not per instance).

59
Q

Is encryption supported on all EBS volume types?

A

Yes

60
Q

Is data encrypted in the transition between an instance and an encrypt EBS Volume?

A

Yes

61
Q

A solution architect needs a solution for a fleet of Linux Web Application servers. The solution should provide a file system interface and support millions of files. Which AWS service should the architect choose?

A

Elastic file system is the only storage solution that provides a file system interface it also supports millions of files as requested. EFS only works with Linux instances

62
Q

A Solutions Architect manages multiple Amazon RDS MySQL databases. To improve security, the Solutions Architect wants to enable secure user access with short-lived credentials. How can these requirements be met?

A

With MySQL, authentication is handled by AWSAuthenticationPlugin—an AWS-provided plugin that works seamlessly with IAM to authenticate your IAM users. Connect to the DB instance and issue the CREATE USER statement, as shown in the following example.

CREATE USER jane_doe IDENTIFIED WITH AWSAuthenticationPlugin AS ‘RDS’;

The IDENTIFIED WITH clause allows MySQL to use the AWSAuthenticationPlugin to authenticate the database account (jane_doe). The AS ‘RDS’ clause refers to the authentication method, and the specified database account should have the same name as the IAM user or role. In this example, both the database account and the IAM user or role are named jane_doe.

63
Q

what is scaling out?

A

Scaling out is the process in which EC2 instances are launched by the scaling policy

64
Q

What is scaling in?

A

“Scaling in” is a process in which EC2 instances are terminated by the scaling policy. It is recommended to create a scale-in event for each scale-out event created

65
Q

What are different Auto Scaling Policies?

A

Dynamic scaling policies:

Target tracking scaling—Increase and decrease the group’s current capacity based on an Amazon CloudWatch metric and a target value. It works similarly to how your thermostat maintains your home’s temperature—you select a temperature, and the thermostat does the rest.

Step scaling—Based on the cloud watch alarm if CPU% goes beyond a certain threshold add 2 instances or remove 1 instance.

Scheduled Scaling: anticipate ice scaling based on known usage patterns and schedule the scaling-out or scaling-in of the instances

Predictive Scaling: The machine learning model will look at the historical usage pattern and scale the instances in advance.

66
Q

How to suspend Auto Scaling Policies?

A

AddToLoadBalancer is suspended: Amazon EC2 Auto Scaling launches the instances but does not add them to the load balancer target group or Classic Load Balancer. When you resume the AddToLoadBalancer process, it resumes adding instances to the load balancer when they are launched. However, it does not add the instances that were launched while this process was suspended. You must register those instances manually.

AlarmNotification is suspended: Amazon EC2 Auto Scaling does not invoke scaling policies when a CloudWatch alarm threshold is in breach. When you resume AlarmNotification, Amazon EC2 Auto Scaling considers policies with alarm thresholds that are currently in breach.

AZRebalance is suspended: Amazon EC2 Auto Scaling does not attempt to redistribute instances after certain events. However, if a scale-out or scale-in event occurs, the scaling process still tries to balance the Availability Zones. For example, during scale out, it launches the instance in the Availability Zone with the fewest instances. If the group becomes unbalanced while AZRebalance is suspended and you resume it, Amazon EC2 Auto Scaling attempts to rebalance the group. It first calls Launch and then Terminate.

HealthCheck is suspended: Amazon EC2 Auto Scaling stops marking instances unhealthy as a result of EC2 and Elastic Load Balancing health checks. Your custom health checks continue to function properly. After you suspend HealthCheck, if you need to, you can manually set the health state of instances in your group and have ReplaceUnhealthy replace them.

InstanceRefresh is suspended: Amazon EC2 Auto Scaling stops replacing instances as a result of an instance refresh. If there is an instance refresh in progress, this pauses the operation without canceling it.

ReplaceUnhealthy is suspended: Amazon EC2 Auto Scaling stops replacing instances that are marked as unhealthy. Instances that fail EC2 or Elastic Load Balancing health checks are still marked as unhealthy. As soon as you resume the ReplaceUnhealthly process, Amazon EC2 Auto Scaling replaces instances that were marked unhealthy while this process was suspended. The ReplaceUnhealthy process calls Terminate first and then Launch.

ScheduledActions is suspended: Amazon EC2 Auto Scaling does not run scheduled actions that are scheduled to run during the suspension period. When you resume ScheduledActions, Amazon EC2 Auto Scaling only considers scheduled actions whose scheduled time has not yet passed.

67
Q

How instances are selected by Auto Scaling for the termination?

A

Per the default termination policy, the first priority is given to any allocation strategy for On-Demand vs Spot instances.

The next priority is to consider any instance with the oldest launch template unless there is an instance that uses a launch configuration.

The next priority is the one that’s closest to the next billing cycle

68
Q

Which instances are not terminated by the ASG?

A
  1. Amazon EC2 Auto Scaling does not immediately terminate instances with an Impaired status. Instead, Amazon EC2 Auto Scaling waits a few minutes for the instance to recover. Amazon EC2 Auto Scaling might also delay or not terminate instances that fail to report data for status checks. This usually happens when there is insufficient data for the status check metrics in Amazon CloudWatch.
  2. The instance has failed the ELB health check status - By default, Amazon EC2 Auto Scaling doesn’t use the results of ELB health checks to determine an instance’s health status when the group’s health check configuration is set to EC2. As a result, Amazon EC2 Auto Scaling doesn’t terminate instances that fail ELB health checks. If an instance’s status is OutofService on the ELB console, but the instance’s status is Healthy on the Amazon EC2 Auto Scaling console, confirm that the health check type is set to ELB
  3. The health check grace period for the instance has not expired - Amazon EC2 Auto Scaling doesn’t terminate an instance that came into service based on EC2 status checks and ELB health checks until the health check grace period expires.
69
Q

Can autoscaling group scale based on Amazon SQS?

A

Yes it can, custom metrics that’s sent to Amazon cloud watch that measures the number of messages in the queue for EC2 instance in the autoscaling group . Then use a target tracking policy that configures your auto scaling group to scale based on the custom metrics and set target value.

70
Q

What is cool down period?

A

Cooldown period is a configuration setting for your autoscaling group that helps to ensure that it doesn’t launch or terminate additional instances before the previous scaling activity takes place gonna stop. The default cooldown period is 300 seconds.

71
Q

What is Security Group in EC2 Instances?

A

A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic. Inbound rules control the incoming traffic to your instance, and outbound rules control the outgoing traffic from your instance.

When you launch an instance, you can specify one or more security groups.

one security group can be attached to multiple EC2 instances.

If an application is not accessible (time out) to an EC2 instance, it means there is a security group issue.

It only contains the “allow” rules.

By default, all inbound traffic is blocked, and all outbound traffic is allowed.

72
Q

How security group controls the traffic?

A

It controls the access to ports, authorizes IP addresses(IPV4 or IPV 6), controls the inbound and outbound network.

Security groups can authorize security groups and EC2 instances attached to them. We can control security groups without using IP addresses.

73
Q

What is AWS Compute Optimizer?

A

AWS Compute Optimizer helps you to avoid overprovisioning or underprovisioning three types of AWS resources—Amazon Elastic Compute Cloud (EC2) instance types, Amazon Elastic Block Store (EBS) volumes, and AWS Lambda functions—based on your utilization data.

74
Q

What is AWS Cost Explorer?

A

The rightsizing recommendations feature in Cost Explorer helps you identify cost-saving opportunities by downsizing or terminating instances in Amazon Elastic Compute Cloud (Amazon EC2). Rightsizing recommendations analyze your Amazon EC2 resources and usage to show opportunities for how you can lower your spending.

75
Q

What is launch configuration tenancy?

A

Tenancy defines how EC2 instances are distributed across physical hardware and affects pricing. There are three tenancy options available:

  1. Shared (default) — Multiple AWS accounts may share the same physical hardware.
  2. Dedicated Instance (dedicated) — Your instance runs on single-tenant hardware.
  3. Dedicated Host (host) — Your instance runs on a physical server with EC2 instance capacity fully dedicated to your use, an isolated server with configurations that you can control.

The default tenancy in a VPC is Default. It means new easy to instances can be created on shared hardware devices. You can change the tenancy to dedicated, it will create the instances on the same hardware. If you select tenancy as host, your instance runs on a physical server with EC2 instance capacity fully dedicated to your use.

76
Q

What is connection draining?

A

To ensure that an Elastic Load Balancer stops sending requests to instances that are de-registering or unhealthy while keeping the existing connections open, use connection draining. This enables the load balancer to complete in-flight requests made to instances that are de-registering or unhealthy. The maximum timeout value can be set between 1 and 3,600 seconds (the default is 300 seconds). When the maximum time limit is reached, the load balancer forcibly closes connections to the de-registering instance.