Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Build Solutions across VPCs with Peering

A VPC peering connection is a networking connection between two VPCs that enables you to route traffic between them using private IPv4 addresses or IPv6 addresses. In this lab, you will create a new VPC for your WordPress blog to run from. You will then create a VPC peering connection between the new VPC and an existing database VPC. By the end of this lab, you will understand how to create a new VPC from scratch, attach internet gateways, edit routing tables, and peer multiple VPCs together.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Sep 24, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create Web_VPC Subnets and Attach a New Internet Gateway

    Using the AWS console, create the Web_VPC VPC with the 192.168.0.0/16 IPv4 CIDR block. Create the WebIG internet gateway. Modify the route table to attach the internet gateway to the Web_VPC.

  2. Challenge

    Create a Peering Connection

    Create a peering connection called DBtoWeb. Peer the newly created Web_VPC with the DB_VPC. Ensure DB_VPC is the requester and Web_VPC is the accepter. Accept the request.

  3. Challenge

    Create an EC2 Instance and configure Wordpress
    1. Launch a new public facing Ubuntu Server 24.04 LTS EC2 instance in the Web_VPC VPC using the provided bootstrap user data script.

      #!/bin/bash
      sudo apt update
      sudo apt install apache2 php libapache2-mod-php php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip unzip -y
      sudo ufw allow in "Apache"
      sudo a2enmod rewrite
      systemctl restart apache2
      cd /tmp/ && wget https://wordpress.org/latest.zip
      unzip latest.zip -d /var/www
      chown -R www-data:www-data /var/www/wordpress/
      mv /var/www/wordpress/wp-config-sample.php /var/www/wordpress/wp-config.php
      cd /var/www/wordpress/
      perl -pi -e "s/database_name_here/wordpress/g" wp-config.php
      perl -pi -e "s/username_here/wordpress/g" wp-config.php
      perl -pi -e "s/password_here/wordpress/g" wp-config.php
      perl -i -pe'
      BEGIN {
      @chars = ("a" .. "z", "A" .. "Z", 0 .. 9);
      push @chars, split //, "!@#$%^&*()-_ []{}<>~\`+=,.;:/?|";
      sub salt { join "", map $chars[ rand @chars ], 1 .. 64 }
      }
      s/put your unique phrase here/salt()/ge
      ' wp-config.php
      wget https://raw.githubusercontent.com/ACloudGuru-Resources/course-aws-certified-solutions-architect-associate/main/lab/5/000-default.conf
      mkdir wp-content/uploads
      chmod 775 wp-content/uploads
      mv 000-default.conf /etc/apache2/sites-enabled/
      systemctl restart apache2
      
    2. Configure Wordpress by editing /var/www/wordpress/wp-config.php to point DB_HOST to the RDS database endpoint.

  4. Challenge

    Modify the RDS Security Groups to Allow Connections from the Web_VPC VPC

    The RDS instance requires a security group modification to allow access from 192.168.0.0/16.

  5. Challenge

    Test WordPress

    Visit the IP address of your EC2 instance in a web browser, and confirm WordPress is working correctly and communicating with the RDS instance via VPC peering.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight