|
| 1 | +import * as pulumi from "@pulumi/pulumi"; |
| 2 | +import * as stackit from "@stackitcloud/pulumi-stackit"; |
| 3 | + |
| 4 | +export const routingTableOrganizationId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; |
| 5 | +export const routingTableNetworkAreaId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx1"; |
| 6 | +export const routingTableId = "routingTable-id"; |
| 7 | +export const routingTableRouteId = "routingTableRoute-id"; |
| 8 | + |
| 9 | +export const routingTableRouteLabelKey = "unit-test"; |
| 10 | +export const routingTableRouteLabelValue = "test-label-value"; |
| 11 | +export const routingTableRouteDestinationType = "cidrv4"; |
| 12 | +export const routingTableRouteDestinationValue = "192.168.178.0/24"; |
| 13 | +export const routingTableRouteNextHopType = "ipv4"; |
| 14 | +export const routingTableRouteNextHopValue = "192.168.178.1"; |
| 15 | + |
| 16 | +export const exampleRoutingTable = new stackit.RoutingTable("exampleRoutingTable", { |
| 17 | + organizationId: routingTableOrganizationId, |
| 18 | + networkAreaId: routingTableNetworkAreaId, |
| 19 | +}); |
| 20 | + |
| 21 | +// only labels are optional therefore one unit test |
| 22 | +export const exampleRoutingTableRoute = new stackit.RoutingTableRoute("exampleRoutingTableRoute", { |
| 23 | + organizationId: routingTableOrganizationId, |
| 24 | + networkAreaId: routingTableNetworkAreaId, |
| 25 | + routingTableId: routingTableId, |
| 26 | + destination: { |
| 27 | + type: routingTableRouteDestinationType, |
| 28 | + value: routingTableRouteDestinationValue, |
| 29 | + }, |
| 30 | + nextHop: { |
| 31 | + type: routingTableRouteNextHopType, |
| 32 | + value: routingTableRouteNextHopValue, |
| 33 | + }, |
| 34 | + labels: {[routingTableRouteLabelKey]:routingTableRouteLabelValue}, |
| 35 | +}); |
| 36 | + |
| 37 | +// datasource |
| 38 | +export const routingTableDatasource = stackit.getRoutingTableOutput({ |
| 39 | + organizationId: routingTableOrganizationId, |
| 40 | + networkAreaId: routingTableNetworkAreaId, |
| 41 | + routingTableId: routingTableId, |
| 42 | +}); |
| 43 | + |
| 44 | +export const routingTableRouteDatasource = stackit.getRoutingTableRouteOutput({ |
| 45 | + organizationId: routingTableOrganizationId, |
| 46 | + networkAreaId: routingTableNetworkAreaId, |
| 47 | + routingTableId: routingTableId, |
| 48 | + routeId: routingTableRouteId, |
| 49 | +}); |
0 commit comments