Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 203 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"network_interface_unit_test": "file:tests/ts/iaas/network-interface",
"network_unit_test": "file:tests/ts/iaas/network",
"public_ip_unit_test": "file:tests/ts/iaas/public_ip",
"routing_table_unit_test": "file:tests/ts/iaas/routingTable",
"securitygroup_unit_test": "file:tests/ts/iaas/securityGroup"
}
}
10 changes: 10 additions & 0 deletions tests/ts/iaas/routingTable/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: routing_table_unit_test
description: A minimal TypeScript Pulumi program
runtime:
name: nodejs
options:
packagemanager: npm
config:
pulumi:tags:
value:
pulumi:template: typescript
49 changes: 49 additions & 0 deletions tests/ts/iaas/routingTable/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import * as pulumi from "@pulumi/pulumi";
import * as stackit from "@stackitcloud/pulumi-stackit";

export const routingTableOrganizationId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
export const routingTableNetworkAreaId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx1";
export const routingTableId = "routingTable-id";
export const routingTableRouteId = "routingTableRoute-id";

export const routingTableRouteLabelKey = "unit-test";
export const routingTableRouteLabelValue = "test-label-value";
export const routingTableRouteDestinationType = "cidrv4";
export const routingTableRouteDestinationValue = "192.168.178.0/24";
export const routingTableRouteNextHopType = "ipv4";
export const routingTableRouteNextHopValue = "192.168.178.1";

export const exampleRoutingTable = new stackit.RoutingTable("exampleRoutingTable", {
organizationId: routingTableOrganizationId,
networkAreaId: routingTableNetworkAreaId,
});

// only labels are optional therefore one unit test
export const exampleRoutingTableRoute = new stackit.RoutingTableRoute("exampleRoutingTableRoute", {
organizationId: routingTableOrganizationId,
networkAreaId: routingTableNetworkAreaId,
routingTableId: routingTableId,
destination: {
type: routingTableRouteDestinationType,
value: routingTableRouteDestinationValue,
},
nextHop: {
type: routingTableRouteNextHopType,
value: routingTableRouteNextHopValue,
},
labels: {[routingTableRouteLabelKey]:routingTableRouteLabelValue},
});

// datasource
export const routingTableDatasource = stackit.getRoutingTableOutput({
organizationId: routingTableOrganizationId,
networkAreaId: routingTableNetworkAreaId,
routingTableId: routingTableId,
});

export const routingTableRouteDatasource = stackit.getRoutingTableRouteOutput({
organizationId: routingTableOrganizationId,
networkAreaId: routingTableNetworkAreaId,
routingTableId: routingTableId,
routeId: routingTableRouteId,
});
Loading
Loading