View a markdown version of this page

Preview routing changes with AWS Cloud WAN policy Dry Run - AWS Network Manager

Preview routing changes with AWS Cloud WAN policy Dry Run

With AWS Cloud WAN policy Dry Run, a built-in prediction capability, you can preview the impact of core network policy changes before they go live. You submit your intended network changes as a new core network policy version. Dry Run then gives you a predicted view of the resulting core network, including changes to AWS Regions, segments, attachment associations, and routes, without affecting your live network.

When you create a new core network policy version, AWS Cloud WAN generates a change set that lists the resources that will be created, modified, or deleted when you deploy that version. A change set doesn't show how those changes affect routing. Policy Dry Run fills that gap. Start with the Dry Run impact summary, which gives you a summary view of how the policy version changes Regions, attachment associations, and routes in each segment and network function group. For more information, see Dry Run impact summary.

For the details, Dry Run predicts the routes that will be in effect in each segment and network function group, in each edge location, after the version becomes LIVE. Additionally, it compares that prediction with the routes in effect on your core network today and marks each route as added, removed, updated, or unchanged.

Use Dry Run to check the routing impact of a policy change before you deploy it, for example, to confirm that a new segment sharing rule exposes only the routes you expect, or that a change to your attachment policies doesn't remove routes that production traffic depends on.

Dry Run is read-only. Running a Dry Run or viewing its results never deploys a policy version and never changes how traffic is forwarded on your core network. Dry Run results are advisory and aren't used when you deploy a policy version. A Dry Run doesn't block you from deploying a policy version, and you don't have to wait for a Dry Run to finish before you deploy.

How Dry Run works

A Dry Run always applies to a single policy version whose change set state is READY_TO_EXECUTE. To run a Dry Run, use the StartCoreNetworkPolicyDryRun operation after the change set for the policy version reaches READY_TO_EXECUTE. You can also start a new Dry Run for the same policy version later, for example, to refresh results that have become STALE.

To compute its prediction, Dry Run uses the proposed policy version together with the current state of your core network, including your attachments, the routes that your attachments advertise in each Region, and your prefix list associations. This includes routes from attachments that aren't currently associated with any segment or network function group, so that Dry Run can show the routes those attachments would contribute if the proposed policy version associates them.

Dry Run states

Each policy version that has a Dry Run reports its Dry Run state in the DryRunState field of the GetCoreNetworkPolicy response, along with DryRunUpdatedAt, the time the Dry Run results were last updated.

PENDING

The Dry Run is in progress. You can't view results or start another Dry Run for the policy version until the current one finishes.

AVAILABLE

The Dry Run finished and the results reflect the current state of your core network. You can view results with ListCoreNetworkDryRunRoutes.

STALE

The Dry Run finished, but something changed on your core network after the results were computed, so the results might no longer be accurate. You can still view the results. To refresh them, start a new Dry Run. Results become STALE when either of the following happens:

  • The routes on your core network change, for example, because you created or deleted an attachment, or an attachment started or stopped advertising a route.

  • You deploy a different policy version, and it becomes LIVE, making this policy version OUT_OF_DATE.

FAILED

Dry Run couldn't compute results for the policy version. The DryRunFailureReason field in the GetCoreNetworkPolicy response describes why. This usually means that your core network or policy version uses a configuration that Dry Run doesn't support. For more information, see Dry Run considerations and limitations.

If DryRunState isn't present in the response, no Dry Run results exist for the policy version. This is the case for policy versions that you haven't started a Dry Run for, for the LIVE policy version, which already reflects the routes in effect on your core network, and for policy versions whose change set failed to generate.

Information that a Dry Run provides

Dry Run results are organized the same way as the routes on your core network: by edge location, and by segment or network function group within that edge location. For each route, Dry Run returns the same information that the GetNetworkRoutes operation returns for live routes, such as the destination CIDR block, the destinations (next hops), the prefix list, the route state, and the route type. Dry Run results also include the following fields.

State

The predicted state of the route after the policy version is deployed:

  • ACTIVE – The route is installed and used to forward traffic.

  • BLACKHOLE – The route is installed as a blackhole route, and traffic that matches it is dropped.

  • PENDING_DEPLOYMENT – The final state of the route can't be predicted. The route might not be installed, or, if it's installed, it might be either active or a blackhole route. This happens when routing policies or service insertion act on an overlapping CIDR block. You can determine the state of the route only after you deploy the policy version. Only Dry Run results return this state. Review routes in this state carefully before you deploy the policy version, and use get-network-routes after deployment to confirm the outcome.

DryRunChangeState

How the route changes when you deploy the policy version, compared with the routes in effect today:

  • ADDED – The route doesn't exist today and exists after you deploy the policy version.

  • REMOVED – The route exists today and doesn't exist after you deploy the policy version. This includes all routes in a segment or edge location that the policy version removes.

  • UPDATED – A route for the same destination CIDR block exists today and still exists after deployment, but its destinations, its route type, or whether it's a blackhole route changes. Routes whose outcome can't be predicted with certainty are also reported as UPDATED. For more information, see Overlapping routes.

  • NO_CHANGES – The route stays the same. A route is NO_CHANGES only when its destinations, route type, and blackhole status are all unchanged. A change only to the next-hop IP address of a route isn't reported as a modification.

IsOverlappingRoute

Whether Dry Run found more than one possible outcome for this destination. For more information, see Overlapping routes.

Dry Run impact summary

A policy version can change routes in many segments, network function groups, and edge locations at once, which can make the full list of Dry Run routes difficult to review. The impact summary gives you a simplified view of all the changes that a policy version would make to your core network, compared with the LIVE policy version.

AWS Cloud WAN uses AWS Ops Agent for networking to generate the impact summary from the Dry Run results. The impact summary is optional and is available in the AWS Cloud WAN console.

Important

Generating an impact summary enables AWS Ops Agent for networking in an Agent Space. During the preview, AWS Ops Agent for networking is available at no charge.

What the impact summary shows

  • Totals for the core network. The number of Regions, attachment associations, and routes that the policy version adds, removes, or updates.

  • A breakdown by segment and network function group. Each row counts the Region, attachment, and route changes for that segment or network function group, and links to the details: the affected Regions, the attachment association changes in the change set, and the matching routes in the Dry Run results.

  • Overlapping routes. The summary flags destinations that resolve to more than one destination attachment in the same Region. For more information, see Overlapping routes.

Start with the breakdown to find the segments and network function groups that change, and then review their routes. Before you deploy the policy version, confirm that anything removed is intended and resolve any overlapping routes.

Setting up the agent for the impact summary

To generate an impact summary, you connect the Dry Run to an Agent Space that has AWS Ops Agent for networking enabled. The first time you generate an impact summary, the console asks you to choose one of the following:

  • Use an existing agent space — Connect an Agent Space that's available to your account.

  • Create a new agent space — Create a new single-account Agent Space for the core network. The console creates two AWS Identity and Access Management (IAM) roles: a web app access role, which lets the console access the Agent Space, and a service role, which AWS Ops Agent for networking assumes to operate in the Agent Space.

Before you connect an Agent Space, consider the following:

  • Deletion – You can't delete an Agent Space after it's connected.

  • Account scope – An Agent Space works for a single account unless you turn on trusted access in the Agent Space settings for your organization.

Before you begin, make sure that a Dry Run for the policy version has finished and its state is AVAILABLE. To create a new Agent Space, your IAM principal must also be allowed to create IAM roles. If it isn't, ask your administrator to connect an Agent Space for you.

To generate an impact summary
  1. Open the AWS Network Manager console.

  2. Open the policy version, and choose the Dry run tab.

  3. Connect an Agent Space, if you haven't already.

  4. Choose Generate summary.

  5. Choose the Agent Space to use.

    The console connects to the Agent Space, enables AWS Ops Agent for networking if needed, and then analyzes the impact. Analysis can take a few minutes. You can leave the page while the summary is generated.

    When the analysis finishes, the impact summary appears on the Dry run tab, with totals for the core network and a breakdown by segment and network function group.

You can generate one impact summary for each Dry Run. If the Dry Run state changes to STALE, the summary might no longer reflect your core network. Choose Restart dry run to rerun the Dry Run and regenerate the summary. AWS Cloud WAN regenerates the summary with the last Agent Space that you used, unless you choose a different one.

Overlapping routes

In some configurations, more than one route can be the best route for the same destination. Which route the core network ends up using depends on factors that can't be known ahead of time, such as the order in which routes are learned. For example, this can happen when attachments in different Regions advertise the same CIDR block with equivalent route attributes.

When this happens, Dry Run doesn't pick one of the possible outcomes. Instead, it merges the candidate routes into a single route for the destination CIDR block, sets IsOverlappingRoute to true, and reports the route as UPDATED. The Destinations of the merged route include the destinations of every candidate route, so review the destinations to see each possible outcome. Review overlapping routes carefully before you deploy a policy version. If the routing outcome for a destination must be predictable, change your configuration so that only one route can win. For example, you can do any of the following:

Note

Dry Run doesn't support core networks that have 1:1 NAT routes. For more information, see Unsupported configurations.

Run a Dry Run and view its results

To use Dry Run, you must be the owner of the core network, and your IAM principal must be allowed the following actions on the core network ARN:

  • networkmanager:StartCoreNetworkPolicyDryRun

  • networkmanager:ListCoreNetworkDryRunRoutes

  • networkmanager:GetCoreNetworkPolicy, to check the Dry Run state

Accounts that share attachments into a core network through AWS RAM can't start a Dry Run or view Dry Run results for that core network.

To check the Dry Run state of a policy version
  • Use the get-core-network-policy command. The following example checks policy version 5:

    aws networkmanager get-core-network-policy \ --core-network-id core-network-0123456789abcdef0 \ --policy-version-id 5

    The response includes the DryRunState and DryRunUpdatedAt fields, and, if the state is FAILED, the DryRunFailureReason field.

To start a Dry Run
  1. Use the start-core-network-policy-dry-run command. The policy version's change set state must be READY_TO_EXECUTE, and a Dry Run can't already be in progress for that version.

    aws networkmanager start-core-network-policy-dry-run \ --core-network-id core-network-0123456789abcdef0 \ --policy-version-id 5

    The command returns the following output:

    { "CoreNetworkId": "core-network-0123456789abcdef0", "PolicyVersionId": 5, "DryRunState": "PENDING" }
  2. Use get-core-network-policy to check the Dry Run state. When it changes to AVAILABLE, the results are ready.

To view Dry Run results
  • Use the list-core-network-dry-run-routes command. You must specify the core network, the policy version, and an edge location. Specify either a segment name or a network function group name. You can view results when the Dry Run state is AVAILABLE or STALE.

    The following example returns the routes in the production segment in us-east-1 that change when policy version 5 is deployed:

    aws networkmanager list-core-network-dry-run-routes \ --core-network-id core-network-0123456789abcdef0 \ --policy-version-id 5 \ --edge-location us-east-1 \ --segment-name production \ --dry-run-change-states ADDED REMOVED UPDATED

    The command returns output similar to the following:

    { "NetworkRoutes": [ { "DestinationCidrBlock": "10.1.0.0/16", "Destinations": [ { "CoreNetworkAttachmentId": "attachment-0123456789abcdef0", "SegmentName": "development", "EdgeLocation": "us-east-1", "ResourceType": "vpc", "ResourceId": "vpc-0123456789abcdef0" } ], "Type": "PROPAGATED", "State": "ACTIVE", "IsOverlappingRoute": false, "DryRunChangeState": "ADDED" } ] }

Results are paginated. Use --max-results and --next-token to page through large route tables. You can also narrow results with the following filters:

  • --dry-run-change-states – Return only routes with the specified change states: ADDED, REMOVED, UPDATED, or NO_CHANGES.

  • --is-overlapping-route – Return only overlapping routes.

  • --exact-cidr-matches, --longest-prefix-matches, --subnet-of-matches, and --supernet-of-matches — Return only routes that match the specified CIDR blocks. Each filter accepts up to 10 CIDR blocks.

  • --prefix-list-ids, --states, --types, and --destination-filters – Filter by prefix list, route state, route type, and route destination. These filters work the same way as they do for the GetNetworkRoutes operation. For example, use --states PENDING_DEPLOYMENT to return only routes whose state can't be predicted until the policy version is deployed.

Dry Run considerations and limitations

General considerations

  • Dry Run results are a prediction. Dry Run models how AWS Cloud WAN applies your policy version to the state of your core network at the time the Dry Run runs. The routes in effect after deployment can differ if your network changes in the meantime, for example, if an attachment starts or stops advertising routes. Always check the DryRunState and DryRunUpdatedAt fields before you rely on the results.

  • Results aren't refreshed automatically. When routes on your core network change, the Dry Run state changes to STALE, but Dry Run doesn't recompute the results. Start a new Dry Run to get current results.

  • Dry Run only reports routes in effect. Results show the routes that each segment or network function group uses to forward traffic in each edge location. They don't show whether traffic is permitted end to end, for example, by security groups, network ACLs, or firewalls.

  • Only policy versions that are ready to deploy are supported. You can run a Dry Run only for a policy version whose change set state is READY_TO_EXECUTE. You can't start a Dry Run while another Dry Run for the same policy version is in progress.

  • Attachments that aren't provisioned are excluded. Attachments in the REJECTED, FAILED, or PENDING_ATTACHMENT_ACCEPTANCE state don't contribute routes to the Dry Run prediction. AWS Cloud WAN doesn't provision these attachments when it deploys a new policy version.

Unsupported configurations

If your core network or policy version uses any of the following configurations, Dry Run can't compute results. The Dry Run state changes to FAILED, and DryRunFailureReason identifies the configuration. You can still deploy the policy version.

  • Unsupported attachment types. Dry Run supports VPC, Connect, Site-to-Site VPN, transit gateway route table, and Direct Connect gateway attachments. If your core network has an attachment of any other type, Dry Run can't run.

  • Routing policies associated with edge location pairs. Dry Run doesn't support policy versions that use the associate-routing-policy segment action to apply routing policies to routes propagated between edge locations. Routing policies associated with attachments or segments are supported.

  • 1:1 NAT. Dry Run doesn't support core networks that have 1:1 NAT routes.

  • Route 53 Global Resolver. Dry Run doesn't support core networks that have an associated Route 53 Global Resolver.

Dry Run also fails if you change your core network configuration after AWS Cloud WAN generates the change set. This happens when the change makes the policy version invalid. In that case, DryRunFailureReason describes the problem. For example, Dry Run fails if a network function group has more than one attachment in the same Region, either on the live core network or under the proposed policy version.