cvwiki

EC2

Nov 5, 2022

# EC2 - Elastic Compute Cloud

# Instance Types

# EC2 Storage

# EC2 Instance Lifecycle States

# Connecting to EC2 Instances

# General EC2 Notes

# Amazon Machine Images (AMI)

# Lifecycle of an AMI

  1. Launch: Use an AMI to launch an EC2 instance, and/or add an EBS volume
  2. Configure: Take instance and attached EBS volumes, and apply customizations, like an OS that is heavily configured with an application
  3. Create Image: Take previously configured instance to produce an AMI
  4. Launch: The new instance will have new EBS volumes that are perfect copies of the original EBS volume snapshots from S3. They will have exactly the same data.

# Scenarios

A DevOps Engineer reported a problem accessing his EC2 instance with a private IP address of 172.31.8.11 from his corporate laptop. The EC2 instance is hosting a web application which works well but he is still experiencing an issue establishing a connection to manage the instance. As the SysOps Administrator, which of the following options is the most suitable solution in this scenario based on the VPC flow log entries below?

1
2 123456789010 eni-abc123de 110.217.100.70 172.31.8.11 49761 3389 6 20 4249 1418530010 1418530070 REJECT OK

Answer: Based on the VPC flow log record provided, the RDP traffic (destination port 3389) to network interface eni-abc123de in the AWS account 123456789010 was rejected. The RDP connection request came from the DevOps engineer’s laptop (with an IP address of 110.217.100.70) and it is trying to access the EC2 instance with a private IP address of 172.31.8.11.

Although the scenario did not explicitly say what type of remote connection protocol the DevOps engineer used, it is quite clear in the VPC flow logs that the user is using Remove Desktop Protocol (RDP). The root cause of this issue is because the security group and the Network ACL of the EC2 instance do not allow RDP traffic. To solve this issue, you would simply have to configure the security group of the EC2 instance to allow incoming RDP traffic including the inbound and outbound rules in the Network ACL.

A VPC flow log record is a space-separated string that has the following format:

1
<version> <account-id> <interface-id> <srcaddr> <dstaddr> <srcport> <dstport> <protocol> <packets> <bytes> <start> <end> <action> <log-status>

#aws #aws-compute