forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
35 lines (30 loc) · 1.03 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
// Copyright 2016-2020, Pulumi Corporation. All rights reserved.
import * as pulumi from "@pulumi/pulumi";
import * as containerinstance from "@pulumi/azure-native/containerinstance";
import * as resources from "@pulumi/azure-native/resources";
const resourceGroup = new resources.ResourceGroup("aci-ts-rg");
const imageName = "mcr.microsoft.com/azuredocs/aci-helloworld";
const containerGroup = new containerinstance.ContainerGroup("containerGroup", {
resourceGroupName: resourceGroup.name,
osType: "Linux",
containers: [{
name: "acilinuxpublicipcontainergroup",
image: imageName,
ports: [{ port: 80 }],
resources: {
requests: {
cpu: 1.0,
memoryInGB: 1.5,
},
},
}],
ipAddress: {
ports: [{
port: 80,
protocol: "Tcp",
}],
type: "Public",
},
restartPolicy: "always",
});
export const containerIPv4Address = containerGroup.ipAddress.apply(ip => ip?.ip);