Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 15: Amazon VPC — Subnets, Route Tables, NACL, NAT Gateway and Bastion Host

AWS Cloud

15.4 Why do we need subnets? The 3-tier layout

If all servers share a subnet, they usually share its effective route table and subnet ACL. Each server still has its own addressing, resource traffic policy and listeners. Use separate subnets where the public web, private app and database need distinct subnet-level settings.

Subnets let you give different routing and different network rules to different groups of servers. Route tables and network ACLs attach to a subnet, so resources in a subnet share the corresponding routing and boundary ACL. Their addressing, security groups and listeners can still differ.

  • Security: the data placement in this example has no direct internet-gateway route, and the data interface only accepts approved app traffic.
  • Smaller blast radius: narrow traffic and application permissions can limit what an affected web host can reach.
  • Clear rules per tier: choose route-table and ACL associations for the intended placement. Use appropriate security groups for each tier.
  • High availability: subnets in two AZs provide space for separate deployments. Continued service depends on working capacity, routing, data and failover.

The 3-tier architecture

A classic web application can have three responsibilities. This training design gives each role a separate subnet:

Tier Also called Runs Subnet Reachable from
1. Web Presentation tier Nginx (static files, forwards PHP) Public 10.0.1.0/24 The internet (80/443)
2. App Logic tier PHP-FPM (your code) Private 10.0.2.0/24 Only the web tier
3. Database Data tier MySQL / MariaDB Private 10.0.3.0/24 Only the app tier
               Internet
                  |
          [ Internet gateway ]
                  |
+----------- VPC 10.0.0.0/16 -------------+
|  Public subnet    10.0.1.0/24           |
|    Nginx web server, bastion, NAT GW    |
|              |  port 9000               |
|  Private subnet   10.0.2.0/24           |
|    PHP-FPM app server                   |
|              |  port 3306               |
|  Private subnet   10.0.3.0/24           |
|    MySQL database                       |
+-----------------------------------------+

So this example uses three subnets, one per tier. Roles and subnets are separate design choices. That is the design of the project in 15.10–15.12.

Example placement in two Availability Zones

To make room for this layout in two AZs, repeat the three subnet placements in a second AZ:

Tier ap-south-1a ap-south-1b
Web (public) 10.0.1.0/24 10.0.11.0/24
App (private) 10.0.2.0/24 10.0.12.0/24
Database (private) 10.0.3.0/24 10.0.13.0/24

For a standard regional Application Load Balancer, select at least two Availability Zone subnets in different AZs. A standard regional RDS DB subnet group also needs suitable placement in at least two AZs, even if the DB instance is Single-AZ. The selected deployment determines actual resilience. A simple single-zone self-managed exercise illustrates the traffic boundaries.

Ravindra Bagale's Tip

Explain the design before counting. This lesson places three roles in three different subnets per zone, so its two-zone example has six. Other designs can use different subnet counts. Check the actual regional service requirements and show how healthy app capacity and data failover would work.

Practice task

Chala, design a network for a fictional college result portal: web, app and database tiers in two AZs. Write a table with six subnet names, CIDR blocks from 10.20.0.0/16, AZs and public or private for each.

Got it? The VPC is the society, subnets are the wings, and a separate wing for every tier. Now let's move on and build the society's main gate – the Internet Gateway.

Give each part of a registration service the access it needs

The training centre publishes its course timetable on the internet. A prospective student should see which classes still have places. An authorised staff member can record a booking. The database stores enrolment records, which include details the public should not read directly. You can start designing the network by naming three roles. The web entry accepts public requests. The application implements the booking and timetable logic. The data service stores the records and answers queries from the permitted application.

The three roles are often called presentation, application and data tiers. A tier is a responsibility in the system. A subnet is a slice of network address space in one Availability Zone. The concepts work together but count different things. A small process can serve pages and business logic on one host. A larger design can place several copies of one role in different subnets. The right separation comes from the traffic, operations and scale requirements. We will choose three separate placements for the training exercise so each traffic boundary is visible.

Picture one registration request before deciding where to build. The learner's browser sends a request to a named public endpoint. The web component understands which paths to serve itself and which use the application. The application may need to make its own connection to the data service. The web request should receive a useful result only if the relevant work succeeds. Calling every link HTTPS or saying the request travels directly to the database would hide which program and protocol are used at each boundary.

When students ask how many subnets a three-tier application needs, it is tempting to recite a number. Start with three responsibilities, then choose the appropriate subnet count for the design. This exercise separates the three tiers by subnet in each selected zone. That is three per zone, or six for the example with two AZs. Evolving the design may add a managed public entry, consolidate a service under a private placement or divide storage and replication further. A number should follow the design description so another engineer can tell what it represents.

Decide which network controls should differ between tiers

Resources in the same subnet normally share its effective subnet route table and subnet-level network ACL. That can be convenient when they need similar network treatment. Two resources in the same subnet can still have different network interfaces, security groups and listening programs. Sharing a route does not mean each one obtains a public address or that it has the same allowed ports. This is the subtle part of the example. Placing web and database in the same subnet does not automatically expose the database. Separate placements give you more direct control where the routes and boundary rules should differ.

In the centre's teaching design the web entry has a direct internet-gateway path and suitable public addressing. The application has no need for direct unsolicited access from outside and uses a private placement. The data tier serves the application over the internal network and uses a separate private placement with no default internet path in the illustration. All three placements can be in the same VPC. The VPC local route normally makes internal addresses routable, subject to the applicable tables and network controls. Separating the subnets supplies routing boundaries but does not automatically allow or block a particular service connection.

An effective route table chooses the next target for a packet based on the destination. It does not authenticate the client. A security group supplies allowed traffic for the associated interfaces and tracks connections in the documented manner. A network ACL is a stateless subnet boundary policy with ordered rules covering directions individually. It can support an additional set of controls where the network design calls for one. The app and database still use their own authentication and authorisation. None of these controls can replace the others. For instance, a database login grants only the operations of that database identity, even if the client's packets are allowed to reach the listener.

Use separate subnets when they support differences the team can explain. The public entry needs internet-facing routing. Data placement should have a restricted traffic design and no unrelated public address. App and data might both use local routing plus their approved endpoints, or their route tables might differ because the app needs external updates and the database does not. Several similar subnets can intentionally share a route table or ACL. That programming choice can reduce unnecessary duplication. Review every association before changing a shared table because the scope is its actual dependent subnets, regardless of the label attached to it.

Define what the security improvements achieve without overclaiming. If the web application is broken or compromised, a narrow network policy can limit the connections it can initiate. It may still call its legitimate application service. The app therefore needs to validate requests and use distinct limited database permissions. Useful isolation is layered. Network separation plus narrowly defined interfaces can reduce exposure and the scope of a failure, but it does not in itself guarantee that a private data service cannot be accessed in an unintended way through an authorised component.

Follow three connections for one useful result

Use a named resource and operation for each arrow in the architecture. A visitor from the public internet opens classes.example and requests the next open session. The first connection is browser to the public entry, commonly over HTTPS on TCP 443. DNS identifies the entry and HTTPS involves the expected certificate and TLS negotiation, followed by the HTTP operation. An internet gateway provides the relevant route path under this design; it does not route by website path, select a TLS certificate or open a listener. The serving component makes those decisions.

In the single-zone teaching example, Nginx can receive the browser request and serve a simple static page locally. For PHP execution it can forward the appropriate application request to a PHP-FPM service using FastCGI over an approved private path. FastCGI is an interface for the web server to hand work to an application runtime. It is not the same as a generic HTTP route. A configured TCP port such as 9000 in this lesson identifies the FastCGI listener. Use the correct protocol and script mapping if you test the actual application. An HTTP request to a FastCGI service is not a meaningful application check simply because the port responds to TCP.

The app opens the next connection, such as a MySQL-compatible protocol over the planned TCP 3306 path to a database. A driver turns the application's data request into the server's protocol. The destination has its own authentication and knows which queries that identity may make. The source from the database's perspective is the app's relevant interface and credentials, not the original browser's address and login. The data response returns to the app, the app produces a useful result, and the web entry sends the browser its response. The network path for the user login and the database user's permissions should both be kept clear.

A managed public Application Load Balancer can add another connection boundary. It accepts a client connection, then uses a separate connection to a selected target. Some designs let the target serve the application directly. A design with an independent Nginx server, PHP worker and database behind it has additional internal steps. The target group uses its supported protocol and its own health logic. Its targets and health-check port must be allowed according to the actual configuration. A listener on an ALB port does not make the ALB a general-purpose FastCGI proxy. Write down which HTTP-speaking component a public ALB actually targets.

A table of checks can contain source role, destination, protocol and port, reason, and a good test result. A public GET might return the expected site certificate and non-sensitive marker. A web-to-app test might reach an intended HTTP route or run a PHP script through the properly configured FastCGI gateway. The app-to-data check should use the intended database identity to read a known safe row without returning private values in a public test. This way the connectivity analysis stays tied to the operation the learner actually needs. Testing only a configured port does not exercise the next protocol step or the identity.

Use distinct permissions for the public, application, and data paths

Start with a traffic matrix. For the supported public entry, accept the intended HTTPS traffic on the approved address families. If HTTP is present for redirection, state that separate purpose. For a private app listener, accept its service port from the web security group where the architecture supports that reference. For the database listener, allow the required database port from the application security group. A security group source reference controls traffic from the eligible source interfaces; it does not import the other group's rules, open all ports, or create a route.

Confirm any restricted outbound policy on the initiator too. The public entry starts the planned application connection and may have separate health-check requirements. The application starts connections to the data service and any explicitly chosen dependencies. The data security group has no reason to allow a connection from every source in the VPC simply because the network is private. Network ACLs can provide an additional boundary where required; because they are stateless, relevant destination and reply paths need to be considered separately. Keep the rule reasoning as narrow and legible as the actual design permits.

Make administration a separate row. An operator may use AWS Systems Manager Session Manager under an approved role and working service connectivity. Another organization may require a controlled private-network path or a jump server. None of these administration choices implies ordinary visitor traffic should include SSH. A bastion is for approved access, while a NAT gateway serves specific network translation and routing needs. Neither is a mandatory fixture of every public or private subnet. If the lesson example uses a bastion for learning, record its narrow expected access and remove it when the exercise ends.

Also separate application traffic from maintenance traffic. A private app might need to download software or reach an internal artifact service. Choose the permitted path only after identifying the destination, protocol, credentials and frequency. A documented VPC endpoint can support some AWS service use privately. A NAT-based internet path may suit a different requirement. An internal database should avoid optional public paths it does not need. See how the difference allows justified defaults rather than automatically installing all the tools seen in one diagram.

Test the denied paths that matter within an authorised environment and record what the test actually proves. Test availability from the expected client, the private app, and the administrative entry as applicable. For a source that is deliberately excluded from the data network permissions, verify the forbidden connection in an agreed way. A single observed timeout does not prove every unauthorised source is blocked. Confirm the actual rules, route and address scope, and keep the test focused on the chosen source and destination. For a classroom worksheet, explain the expected outcome without sending packets.

Design for a real zone failure rather than counting subnet boxes

In this example the centre can reserve public web A and web B, private app A and app B, and private data A and data B. A pair of subnets gives a place to put each role in two zones. This can be a useful network layout even if the first lab only launches one small test machine of each role in one zone. Do not infer high availability from the six reservations alone. Verify that the current deployed service is able to continue or recover promptly if the chosen failure happens.

A standard Application Load Balancer using regional Availability Zone subnets needs at least two subnets in different zones. Follow that service's current subnet capacity requirements and special deployment choices. It must also have real healthy reachable targets. Standard regional RDS DB instance subnet group planning likewise uses subnets in at least two AZs even when the DB instance runs in one. A DB subnet group describes the service's placement options. It does not change the selected deployment to Multi-AZ or add a second readable database because the addresses appear in two rows.

For a Multi-AZ RDS DB instance deployment with a single standby, the service provides a standby in a different AZ for failover. The standby neither acts as a read-scaling target nor turns two client requests into independent useful writes. Other RDS deployment types such as supported Multi-AZ DB clusters have their own roles and access. In all cases read the current engine and deployment documentation and use the intended service endpoint. For self-managed MySQL or MariaDB on an EC2 instance, adding an empty subnet does not replicate the data. The deployment needs a tested plan for state, recovery and client reconnection.

Consider a timeline. The centre loses app A. The public entry must stop choosing the affected target under the actual health check and routing behavior. App B needs sufficient resources in its own zone. It has to reach a data service that remains usable or can fail over in the required time. The team should know which successful operations are retried and how to avoid recording duplicate bookings when a client times out near a commit. Availability depends on application correctness and all necessary supporting services, as well as the existence of viable subnets.

Shared dependencies can still link both zones. A central deployment server might be required for replacing capacity. A single network path can be unsuitable for an outbound dependency that needs to survive a zone event. Some designs require independent zonal paths, whereas a service with a documented Regional availability mode may have a different model. Check where the dependency actually is and what the service promises. It is possible for normal website traffic to keep serving while the next update workflow fails. State the operation and required recovery outcome when evaluating availability.

Before rolling out the second zone, specify capacity and expected service behavior during transitions, including loss of a dependency. Test a control route that does not need the dependency and an ordinary request that does. Record health check and application evidence. A cheap single-zone class exercise can teach the connections without representing the application's resilience in actual use. A cost comparison depends on the resources chosen and the traffic associated with them, not simply on the number of AZs listed on the diagram.

Trace a request across three local listeners

Use Python 3 in a terminal. This exercise starts three real loopback HTTP listeners on operating-system-assigned ports. They represent the web entry, the app and a data lookup service. The last listener returns a fixed example value in JSON and is intentionally not a MySQL server. All HTTP activity stays on your own machine. The example tests which component produced a result and what happens to an end-to-end request during a data dependency error. It does not create AWS routes, ACLs, firewall boundaries or authentication. Your ability to call local loopback ports is unrelated to the public and private placements in the proposed VPC.

Predict the difference between opening the web status route and asking for a session with room. The status route answers from the web tier only. The useful request calls the app, which then calls the data lookup. The web and app propagate the concrete error in this exercise rather than serving an old success. The trace records request entry in the order it occurs. A tightly controlled flag changes only the data response in the second run, so the web listener stays alive throughout.

python3 - <<'PY'
from contextlib import contextmanager
from http.client import HTTPConnection
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
import json
from threading import Event, Thread

unavailable = Event()
trace = []

def fetch(port, path):
    client = HTTPConnection('127.0.0.1', port, timeout=3)
    try:
        client.request('GET', path)
        response = client.getresponse()
        return response.status, json.loads(response.read())
    finally:
        client.close()

@contextmanager
def serving(role, route):
    class Handler(BaseHTTPRequestHandler):
        def do_GET(self):
            trace.append((role, self.path))
            status, message = route(self.path)
            body = json.dumps(message).encode()
            self.send_response(status)
            self.send_header('Content-Type', 'application/json')
            self.send_header('Content-Length', str(len(body)))
            self.end_headers()
            self.wfile.write(body)

        def log_message(self, *args):
            pass

    with ThreadingHTTPServer(('127.0.0.1', 0), Handler) as server:
        worker = Thread(target=server.serve_forever, daemon=True)
        worker.start()
        try:
            yield server.server_port
        finally:
            server.shutdown()
            worker.join(timeout=4)
            assert not worker.is_alive()

def lookup(path):
    if path != '/session':
        return 404, {'error': 'unknown data operation'}
    if unavailable.is_set():
        return 503, {'error': 'data unavailable'}
    return 200, {'seats': 3}

with serving('data', lookup) as data_port:
    def application(path):
        if path != '/next':
            return 404, {'error': 'unknown app operation'}
        status, result = fetch(data_port, '/session')
        if status != 200:
            return 503, {'error': 'session lookup failed'}
        return 200, {'course': 'VPC workshop', 'seats': result['seats']}

    with serving('app', application) as app_port:
        def frontend(path):
            if path == '/status':
                return 200, {'web': 'up'}
            if path == '/next-class':
                return fetch(app_port, '/next')
            return 404, {'error': 'unknown web route'}

        with serving('web', frontend) as web_port:
            trace.clear()
            assert fetch(web_port, '/next-class') == (
                200, {'course': 'VPC workshop', 'seats': 3}
            )
            expected = [('web', '/next-class'), ('app', '/next'), ('data', '/session')]
            assert trace == expected
            print('Successful path:', trace)
            unavailable.set()
            trace.clear()
            assert fetch(web_port, '/status') == (200, {'web': 'up'})
            assert trace == [('web', '/status')]
            trace.clear()
            assert fetch(web_port, '/next-class') == (
                503, {'error': 'session lookup failed'}
            )
            assert trace == expected
            print('Web status stayed 200, while useful lookup returned 503.')
            unavailable.clear()
            assert fetch(web_port, '/next-class')[0] == 200
            print('The same lookup worked again after the data response was restored.')
print('All three loopback listeners were shut down.')
PY

The first trace shows the web route, the app route and the data operation. Each nested call is a separate HTTP connection under this local design. The app adds the course label when it creates the public response. The trace of the status route contains only the web handler. It answers correctly for what it checks. During the data error, the browser-facing lookup returns 503 rather than the successful payload. If you operated this service, the web's status response would not be enough to close a ticket about class availability.

The data error is simulated within the data listener, so the trace still contains all three entries. If the data service could not be reached at all, the app would need handling for that different failure, including a connection timeout. Do not treat the current 503 as evidence that a network ACL rejected traffic. In an actual environment use the private service's evidence, approved reachability checks and operation-specific logs. Start with the component that explains the observed result. Keep distinct timeouts, protocol responses and errors after authentication rather than describing them all as network failures.

Repeat the exercise after restoring the state. An ordinary lookup should succeed again, and the context managers shut down all the exact listeners they created. You did not start or stop any existing local service, write files or contact any cloud network. As a follow-up task, sketch three rows from the output with purpose, expected response and next observation if it fails. In the AWS design, replace the abstract local data service with the selected database protocol and roles. Keep the principle of individually identifiable hops and the meaningful public operation.

Compare a small lab and a managed public-entry design

Draw the first version with one AZ, three small owned subnets and one workload per role. The example IPv4 VPC has the already approved 10.76.20.0/22 range. Put the web server in web A at 10.76.20.0/26, a PHP-FPM process in app A at 10.76.20.128/26, and a self-managed database in data A at 10.76.21.0/27. The web and app ranges do not overlap. They belong to the active VPC allocation and are placed in one chosen AZ. Use the resource IDs to identify each actual subnet after creation. The IP ranges here illustrate a workable layout for the fictional centre and do not establish approved address availability in any other environment.

Label each arrow in the first drawing. Browser to web is HTTPS for the intended deployment. Web to app uses approved FastCGI. App to data uses the database protocol. For a test of the architecture, you can exercise those logical boundaries on a local machine before seeking cloud approval. In an approved cloud lab, the actual listeners and data identities must exist. If the instructor demonstrates only a static default page, ask which additional request causes the application to execute and fetch a known value. If that page works but the PHP execution does not, the two tests give distinct clues.

Now draw a busier version. It needs a public entry in two zones, app instances on private addresses, and a managed database. Reuse the example six slices in the same approved allocation if their current free capacity meets the services' needs. Add web B at 10.76.20.64/26, app B at 10.76.20.192/26, and data B at 10.76.21.32/27. Place the B subnets in a different AZ. A public Application Load Balancer can use the two public placements. The target application can provide its own HTTP listener in the two private app subnets. The database implementation can use RDS in the appropriate private DB subnet group.

Compare the connections, because the first sketch's FastCGI hop does not appear in the same way in the second. A stand-alone application target may speak HTTP to the ALB. If it uses PHP-FPM, it can run Nginx as its local gateway on the same app host or another approved intermediate placement. The load balancer does not take the old configuration and translate it into FastCGI. Choose which component actually sees HTTP, which executes code, and which handles database credentials. The data service listens to the app. The extra public entry system supplies its own route and security rules; the browser has no need to learn the database's address.

Use a placement table to see what changes while the registration need stays the same. The design decisions in this table are examples. For a real deployment, verify the selected services, availability and adopted standards in the user's environment.

DecisionSingle-zone learning buildManaged public-entry design
Who answers public HTTPS?The Nginx web host handles the certificate, listener, and appropriate request.The internet-facing ALB accepts the public request and forwards to an approved healthy HTTP-speaking application target.
Who runs the application logic?PHP-FPM executes the script requested by the web gateway.The selected private application deployment runs on intended targets in two AZs. Any PHP-FPM integration is provided by its application stack.
Who owns data availability?The team that runs the self-managed database must design and test its backup and recovery.The chosen RDS deployment provides documented availability behavior. The application team is still responsible for connection handling, data access and recovery testing.
What test proves the complete chain?A test retrieval reaches the public web entry, executes the selected app logic and returns the expected safe database value.A real request with the intended hostname and healthy target returns the correct data-dependent response, with approved failure and capacity tests across placements.

Even using the same six subnet names, the two designs can require different resources and total spending. Count what will actually be created. A NAT gateway or interface endpoint should only be selected for a specified dependency. A managed load balancer has its own runtime and pricing model. Database availability choices affect placement and operating cost. For a small temporary exercise you may choose the smallest safe design that teaches the traffic decisions. For a real service, compare the required outcomes, downtime tolerance, resource charges and maintenance work. Current prices and options depend on the Region and service configuration.

Work through three failures in the order each observation supports

Case one starts with a browser reporting the web endpoint cannot be reached. Begin with the exact hostname and what the client reports. If it resolved to an unexpected address, inspect the current DNS answer and certificate path before checking MySQL. If the hostname resolved correctly but the client timed out, inspect the public entry, active coverage of its address family, effective route and ingress on that path. Confirm the expected service is listening. An administrator asking whether the database has a public address is starting with an unrelated component. The centre intentionally keeps that address private.

Suppose the student instead receives the site's own 404 on the known hostname. This tells you that an HTTP component responded. It does not prove the response came from the intended app. Inspect the host, path and web request log. If the path is meant to reach the app listener, check whether the request ever crossed that connection boundary. A wrong path rule could produce a valid response from the wrong component. You can use a small marker identifying the intended route and an expected response so the evidence advances the diagnosis beyond a status number. Keep a safe static request as a baseline control.

Case two has a good public static response and a dynamic request with a gateway error. Inspect the web entry's upstream configuration and timestamps. Check the private app listener's address and protocol. A FastCGI connection accepted by a PHP-FPM process differs from an HTTP connection to a service fronting a pool. Compare the planned destination, gateway mapping and the actual listener without rewriting the rest of the network. If the web entry records that the app connection timed out, determine whether the app saw any request. Verify the exact traffic policies for the source and port as well as the relevant controls at both sides. A single observed symptom can support several hypotheses.

Case three reaches the app and receives a database permission error. This can be evidence that enough network connectivity existed to get an authentication or authorization response from a database, though you should confirm the error's origin. Check the private database name the app resolved and which identity it presented. Compare permissions for that operation against the active schema or records. Opening more ports is an unrelated response to a verified database permission error. Conversely, a network timeout when reaching the configured database doesn't establish a credentials problem. The next observation should help cut the list of possible causes rather than broadening the allowed path.

Use timestamps or correlation identifiers across the web and app logs. For production use, follow the application's normal logging policy and avoid capturing credentials or full private records. For a safe learning example, log a synthetic request name and harmless result. Compare one failing request with a known good control in the same test context. If the failure happens on app B while app A is healthy, the exact target and dependency behavior can point to differences between placements. Don't replace the independently known good paths just because they share a role name with the failing part.

At the end of each case, write in plain words what was observed and what should be tested next. A useful note says the browser received web's status response, the app route called the correct private data endpoint, and that service returned a known credential error. It also states that fixing the selected role should be tested with a new regular request. This phrasing supplies evidence for the complete work. It also guides a handoff to the owner who can change the right component while preserving the others.

Review the network, application and data changes in their real order

A good three-tier rollout begins with address and dependency review. List the selected account, Region, zones, VPC ranges, subnets, intended routes and role-specific security groups. Record which parts already serve a different application. If infrastructure is shared, identify the set of associations that would change and confirm the owner before touching them. For a teaching deployment use a dedicated sandbox with only the new resources. Keep enough space in the app placements for old and new instances to overlap on a planned rollout.

Next build a test target and a private data endpoint and verify each from its supported source. A synthetic data row is useful here because its expected value can be checked without exposing personal data in a browser. Choose a read check to confirm the app uses the intended data source. A change affecting booking writes also needs an approved disposable test record and verification of exactly one useful result. If a web handler logs a success response while a write never commits, the deployment did not meet that requirement even if the network worked.

Then confirm the public entry can send traffic to the approved web or app targets. Make sure its health check makes sense for the intended availability behavior. A shallow check may be deliberate if the team has a plan for separately tracking the database. A dependency-aware check may be the right signal for some target readiness decisions, but a global dependency outage can change all targets at once. Understand what the selected service does when healthy targets are absent. Use the provider's documented behavior and do not assume a local HTTP fixture proves the same response strategy.

Decide how to roll back before directing ordinary users to the candidate. Check whether the old application can read any new data written by the candidate. Keep known previous configurations and distinguish a web release change from a database schema change. A load balancer target switch cannot undo committed data. Record the expected ordinary request, how to determine which version served it, and the conditions for moving traffic back or applying a forward correction. In a cloud exercise without real users, reproduce the same order using synthetic requests and an isolated data source.

Finally inspect what is left once the test is over. Remove owned test targets and environment-specific resources in a dependency-safe order. A load balancer, endpoint or managed database can retain network interfaces and related configurations while deletion is still in progress. Verify expected data retention before removing a database. Wait for the service's deletion result, then verify the absence of owned leftover dependencies before removing test subnet or VPC objects. A read-only planning or local loopback exercise needs none of these cloud steps. This is a different scope from reorganising a shared account or dismantling a default network.

For the college result-portal task, replace the workshop response with an authorised learner's own test result. Decide where that permission is checked and whether it is tied to the requester. Public TLS and restricted VPC routing improve the connection path. They do not know which student's record an authenticated visitor can read. Add one successful authorised result and one rejected request by an approved test identity to the application test plan.

Explain the design from one specific business request

Does a three-tier design always need at least three subnets?

No. A tier defines a responsibility. The centre's teaching layout places its three roles in separate subnets and repeats the layout in two zones, yielding six in the expanded version. A real design may share some placements or introduce additional required subnets. I would explain the traffic directions and the service-specific subnet requirements before providing a number.

If a database shares a subnet with a public web server, must it be publicly reachable?

No. It shares subnet characteristics such as the effective route table and boundary ACL, but actual resource addressing, security groups and listeners differ. Separate data placement makes it easier to avoid direct public routing and choose appropriate boundary policy. I would still check the real private address, allowed source and database identity.

How do you verify that the app runs if the browser sees a successful web status?

Run a relevant app operation through the public entry and verify the expected data-dependent output. If that fails while status passes, collect evidence for the entry-to-app and app-to-data steps. Check their distinct protocols, traffic policies and logs. The simple status route may only confirm that the first listener works.

What do two RDS subnet-group Availability Zones establish?

They establish suitable placement choices for the standard regional DB subnet group. The selected RDS deployment determines whether there is an actual standby, its behavior and the proper endpoints. I would also verify the app can connect under the real deployment's failover and recovery assumptions.

Decide what a connection is supposed to establish

  1. The database requires access from the application on port 3306. Does this grant the public web visitor a database connection?

    Answer and reasoning

    No. A supported source-group rule describes the eligible app interfaces on that port. The visitor calls a public web endpoint. The app handles the separate database operation with its own identity.

  2. There are six correctly labelled empty subnets. How much application failover behavior has the team verified?

    Answer and reasoning

    The subnets show the address placements exist. Availability still depends on actual targets and runtime capacity, state and working failover behavior. A useful service check during an approved disruption supplies stronger evidence.

  3. Why is an HTTP request to a FastCGI port insufficient to test the PHP application?

    Answer and reasoning

    The listener expects FastCGI. Use the web gateway or a supported FastCGI-aware check to exercise the intended execution with its script and request parameters. A TCP connection check can establish reachability only.

  4. The local lab trace contains web, app and data entries, but the public response is 503. Did the packet path necessarily fail?

    Answer and reasoning

    No. The request reached all three handlers in the observed local run. The sample data component intentionally gave an error and the app reported it. The measured evidence describes an application response rather than a dropped connection.

Revision cards for a three-tier review

Role and placement

Define the jobs first. Put each subnet in an actual zone and choose different route or boundary policies where the design requires them.

Three connections

Browser to web, web to app, and app to data each have a source, destination, protocol and success criterion. An extra load balancer may add another boundary.

Private and permitted

Use suitable private routes, resource addressing and least-privilege traffic rules for app and data. Verify authentication and business operation separately.

Space for failover

Two zone placements provide room. Check the actual capacity, state, traffic direction and recovery behavior before promising a working failover.

Official references