forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyStack.cs
55 lines (51 loc) · 1.69 KB
/
MyStack.cs
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
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2016-2021, Pulumi Corporation. All rights reserved.
using Pulumi;
using Pulumi.AzureNative.ContainerInstance;
using Pulumi.AzureNative.ContainerInstance.Inputs;
using Pulumi.AzureNative.Resources;
class MyStack : Stack
{
public MyStack()
{
var resourceGroup = new ResourceGroup("aci-rg");
var imageName = "mcr.microsoft.com/azuredocs/aci-helloworld";
var containerGroup = new ContainerGroup("helloworld", new ContainerGroupArgs
{
ResourceGroupName = resourceGroup.Name,
OsType = "Linux",
Containers =
{
new ContainerArgs
{
Name = "acilinuxpublicipcontainergroup",
Image = imageName,
Ports = { new ContainerPortArgs { Port = 80} },
Resources = new ResourceRequirementsArgs
{
Requests = new ResourceRequestsArgs
{
Cpu = 1.0,
MemoryInGB = 1.5,
}
}
}
},
IpAddress = new IpAddressArgs
{
Ports =
{
new PortArgs
{
Port = 80,
Protocol = "Tcp",
}
},
Type = "Public"
},
RestartPolicy = "always"
});
this.ContainerIPv4Address = containerGroup.IpAddress.Apply(ip => ip!.Ip);
}
[Output("containerIPv4Address")]
public Output<string> ContainerIPv4Address { get; set; }
}