aws-cloudformation/vpc_routing_enhancement_architectures/templates/EgressVpcNatGw.yaml [525:585]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !Ref ApplicationAmiId
      KeyName: !Ref KeyPairName
      InstanceType: !Ref ApplicationInstanceType
      IamInstanceProfile: !Ref InstanceSSMProfile
      SecurityGroupIds:
        - !Ref ApplicationSg
      SubnetId: !Ref ApplicationSubnet1
      BlockDeviceMappings:
        - DeviceName: /dev/xvda
          Ebs:
            VolumeSize: !Ref ApplicationInstanceDiskSize
      Tags:
        - Key: Name
          Value: !Sub "${AWS::StackName}-server-1"
      UserData:
        Fn::Base64: |
          #!/bin/bash -ex

          # Install packages:
          yum update -y;
          yum install htop -y;
          yum install httpd -y;

          # Configure hostname:
          hostnamectl set-hostname gwlbe-ingress-vpc-server-1;

          # Configure SSH client alive interval for ssh session timeout:
          echo 'ClientAliveInterval 60' | sudo tee --append /etc/ssh/sshd_config;
          service sshd restart;
          
          # Set dark background for vim:
          touch /home/ec2-user/.vimrc;
          echo "set background=dark" >> /home/ec2-user/.vimrc;

          # Define variables:
          curl http://169.254.169.254/latest/dynamic/instance-identity/document > /home/ec2-user/iid
          export instance_az=$(cat /home/ec2-user/iid |grep 'availability' | awk -F': ' '{print $2}' | awk -F',' '{print $1}');
          
          # Start httpd and configure index.html:
          systemctl enable httpd;
          systemctl start httpd;
          touch /var/www/html/index.html
          echo "<html>" >> /var/www/html/index.html
          echo "  <head>" >> /var/www/html/index.html
          echo "    <title>Gateway Load Balancer Endpoint</title>" >> /var/www/html/index.html
          echo "    <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>" >> /var/www/html/index.html
          echo "  </head>" >> /var/www/html/index.html
          echo "  <body>" >> /var/www/html/index.html
          echo "    <h1>GWLB Endpoint POC:</h1>" >> /var/www/html/index.html
          echo "    <h2>Welcome to Ingress VPC: GWLB Endpoint + ALB + VPC Routing Enhancements POC:</h2>" >> /var/www/html/index.html
          echo "    <h3>This is server 1 running in $instance_az. Happy testing!</h3>" >> /var/www/html/index.html
          echo "  </body>" >> /var/www/html/index.html
          echo "</html>" >> /var/www/html/index.html

  Server2:
    DependsOn: 
      - PublicRtb2EditLocalRoute
      - GwlbeRtb2Route1
      - AppRtb2Route1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-cloudformation/vpc_routing_enhancement_architectures/templates/IngressVpcElb.yaml [617:677]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !Ref ApplicationAmiId
      KeyName: !Ref KeyPairName
      InstanceType: !Ref ApplicationInstanceType
      IamInstanceProfile: !Ref InstanceSSMProfile
      SecurityGroupIds:
        - !Ref ApplicationSg
      SubnetId: !Ref ApplicationSubnet1
      BlockDeviceMappings:
        - DeviceName: /dev/xvda
          Ebs:
            VolumeSize: !Ref ApplicationInstanceDiskSize
      Tags:
        - Key: Name
          Value: !Sub "${AWS::StackName}-server-1"
      UserData:
        Fn::Base64: |
          #!/bin/bash -ex

          # Install packages:
          yum update -y;
          yum install htop -y;
          yum install httpd -y;

          # Configure hostname:
          hostnamectl set-hostname gwlbe-ingress-vpc-server-1;

          # Configure SSH client alive interval for ssh session timeout:
          echo 'ClientAliveInterval 60' | sudo tee --append /etc/ssh/sshd_config;
          service sshd restart;
          
          # Set dark background for vim:
          touch /home/ec2-user/.vimrc;
          echo "set background=dark" >> /home/ec2-user/.vimrc;

          # Define variables:
          curl http://169.254.169.254/latest/dynamic/instance-identity/document > /home/ec2-user/iid
          export instance_az=$(cat /home/ec2-user/iid |grep 'availability' | awk -F': ' '{print $2}' | awk -F',' '{print $1}');
          
          # Start httpd and configure index.html:
          systemctl enable httpd;
          systemctl start httpd;
          touch /var/www/html/index.html
          echo "<html>" >> /var/www/html/index.html
          echo "  <head>" >> /var/www/html/index.html
          echo "    <title>Gateway Load Balancer Endpoint</title>" >> /var/www/html/index.html
          echo "    <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>" >> /var/www/html/index.html
          echo "  </head>" >> /var/www/html/index.html
          echo "  <body>" >> /var/www/html/index.html
          echo "    <h1>GWLB Endpoint POC:</h1>" >> /var/www/html/index.html
          echo "    <h2>Welcome to Ingress VPC: GWLB Endpoint + ALB + VPC Routing Enhancements POC:</h2>" >> /var/www/html/index.html
          echo "    <h3>This is server 1 running in $instance_az. Happy testing!</h3>" >> /var/www/html/index.html
          echo "  </body>" >> /var/www/html/index.html
          echo "</html>" >> /var/www/html/index.html

  Server2:
    DependsOn: 
      - PublicRtb2EditLocalRoute
      - GwlbeRtb2Route1
      - AppRtb2Route1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



