Application Tier Access Test

Application Tier Access Test

  1. Get the private IP addresses of the Application Tier EC2 instances with the following command in the VS Code terminal:

    aws ec2 describe-instances \
     --filters "Name=tag:aws:autoscaling:groupName,Values=3-Tier-AppTier-AutoScaleGroup" "Name=instance-state-name,Values=running" \
     --query "Reservations[].Instances[].PrivateIpAddress" \
     --output text
    

AWS CloudFormation

  1. In the SSH session to the Web Tier EC2 instance (the last step of the previous section).
    • Test access to the Application Tier through the internal Application Load Balancer with the following command, replacing <AppTierLoadBalancerURL> with the value in the Outputs tab:

      curl <AppTierLoadBalancerURL>
      

The output contains the line This is the Application tier!.

AWS CloudFormation

  1. Try curl directly to the private IP of an Application Tier EC2 instance.
    • The request times out after 10 seconds because the Application Tier Security Group only allows HTTP from the Application Tier Load Balancer.

      curl -m 10 <app_tier_ec2_private_ip>
      

AWS CloudFormation

  1. Try a TCP ping with nping to check the response on TCP port 22.
    • No connection succeeds because SSH is only allowed from the Bastion Host.

      nping -p 22 <app_tier_ec2_private_ip>
      

AWS CloudFormation

  1. Run the same check with TCP port 80.
    • The result is the same: no connection succeeds because HTTP is only allowed from the Application Tier Load Balancer.

      nping -p 80 <app_tier_ec2_private_ip>
      

AWS CloudFormation