-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
42 lines (37 loc) · 1.35 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import * as aws from "./aws";
import * as azure from "./azure";
import { ResourceGroup } from "@pulumi/azure/core";
/**
* AWS
*/
const awsNetwork = new aws.Network("aws", {
vpcCidrBlock: "10.0.0.0/22",
publicSubnetCidrBlocks: ["10.0.0.0/24", "10.0.1.0/24",]
});
export const awsNetworkId = awsNetwork.getNetworkId();
export const awsPublicSubnetIds = awsNetwork.getPublicSubnetIds();
const awsWebserver = new aws.WebServer("aws", {
networkId: awsNetworkId,
subnetId: awsPublicSubnetIds[0],
});
export const awsInstanceId = awsWebserver.getInstanceId();
export const awsInstanceAddress = awsWebserver.getInstanceAddress();
/**
* Azure
*/
// All resources will share a resource group.
const resourceGroup = new ResourceGroup("azure");
const azureNetwork = new azure.Network("azure", {
resourceGroupName: resourceGroup.name,
vpcCidrBlock: "10.0.0.0/22",
publicSubnetCidrBlocks: ["10.0.0.0/24", "10.0.1.0/24",]
});
export const azureNetworkId = azureNetwork.getNetworkId();
export const azurePublicSubnetIds = azureNetwork.getPublicSubnetIds();
const azureWebserver = new azure.WebServer("azure", {
resourceGroupName: resourceGroup.name,
networkId: azureNetworkId,
subnetId: azurePublicSubnetIds[0],
});
export const azureInstanceId = azureWebserver.getInstanceId();
export const azureInstanceAddress = azureWebserver.getInstanceAddress();