Skip to content
GitHubXDiscordRSS

GlobalNetwork

Learn how to create, update, and manage AWS NetworkManager GlobalNetworks using Alchemy Cloud Control.

The GlobalNetwork resource lets you manage AWS NetworkManager GlobalNetworks which facilitate the creation and management of a global network across multiple AWS Regions.

Create a basic Global Network with a description and tags.

import AWS from "alchemy/aws/control";
const globalNetwork = await AWS.NetworkManager.GlobalNetwork("myGlobalNetwork", {
Description: "My global network for branch connectivity",
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "GlobalExpansion" }
]
});

Create a Global Network with a defined state and additional properties.

const advancedGlobalNetwork = await AWS.NetworkManager.GlobalNetwork("myAdvancedGlobalNetwork", {
Description: "Advanced global network configuration",
State: "ACTIVE", // Possible values: PENDING | ACTIVE | DELETING | DELETED
Tags: [
{ Key: "Department", Value: "IT" },
{ Key: "Owner", Value: "Alice" }
],
adopt: true // Adopt existing resource if present
});

Utilize the created time property to monitor when the Global Network was established.

const networkWithCreationTime = await AWS.NetworkManager.GlobalNetwork("myNetworkWithCreationTime", {
Description: "Global network with creation monitoring",
Tags: [
{ Key: "Service", Value: "NetworkManagement" }
]
});
// Log the creation time of the Global Network
console.log(`Global Network created at: ${networkWithCreationTime.CreationTime}`);

Set up a Global Network and handle state changes programmatically.

const stateChangeNetwork = await AWS.NetworkManager.GlobalNetwork("myStateChangeNetwork", {
Description: "Network to demonstrate state handling",
State: "PENDING"
});
// Example of checking and updating state
if (stateChangeNetwork.State === "PENDING") {
console.log("Network is still pending, please check back later.");
// Logic to update or retry can be added here
}