Update azure-go-webserver-component
MODIFY
azure-go-webserver-component/main.go
azure-go-webserver-component/main.go
@@ -33,8 +33,8 @@ func main() {
network, err := network.NewVirtualNetwork(ctx, "server-network", &network.VirtualNetworkArgs{
ResourceGroupName: rg.Name,
AddressSpaces: pulumi.StringArray{pulumi.String("10.0.0.0/16")},
- Subnets: network.VirtualNetworkSubnetsArrayArgs{
- network.VirtualNetworkSubnetsArgs{
+ Subnets: network.VirtualNetworkSubnetArray{
+ network.VirtualNetworkSubnetArgs{
Name: pulumi.String("default"),
AddressPrefix: pulumi.String("10.0.1.0/24"),
},
@@ -51,7 +51,7 @@ func main() {
echo "Hello, from Server %v!" > index.html
nohup python -m SimpleHTTPServer 80 &`, i)),
ResourceGroupName: rg.Name,
- SubnetID: network.Subnets.Index(pulumi.Int(0)).Id(),
+ SubnetID: network.Subnets.Index(pulumi.Int(0)).Id().ToStringPtrOutput().Elem(),
})
if err != nil {
return err

MODIFY
azure-go-webserver-component/webserver.go
azure-go-webserver-component/webserver.go
@@ -40,11 +40,10 @@ type WebserverArgs struct {
// NewWebserver allocates a new web server VM, NIC, and public IP address.
func NewWebserver(ctx *pulumi.Context, name string, args *WebserverArgs, opts ...pulumi.ResourceOption) (*Webserver, error) {
webserver := &Webserver{}
- reg, err := ctx.RegisterComponentResource("ws-ts-azure-comp:webserver:WebServer", name, webserver, opts...)
+ err := ctx.RegisterComponentResource("ws-ts-azure-comp:webserver:WebServer", name, webserver, opts...)
if err != nil {
return nil, err
}
- defer reg.Close()
webserver.PublicIP, err = network.NewPublicIp(ctx, name+"-ip", &network.PublicIpArgs{
ResourceGroupName: args.ResourceGroupName,
@@ -56,10 +55,10 @@ func NewWebserver(ctx *pulumi.Context, name string, args *WebserverArgs, opts ..
webserver.NetworkInterface, err = network.NewNetworkInterface(ctx, name+"-nic", &network.NetworkInterfaceArgs{
ResourceGroupName: args.ResourceGroupName,
- IpConfigurations: network.NetworkInterfaceIpConfigurationsArrayArgs{
- network.NetworkInterfaceIpConfigurationsArgs{
+ IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
+ network.NetworkInterfaceIpConfigurationArgs{
Name: pulumi.String("webserveripcfg"),
- SubnetId: args.SubnetID,
+ SubnetId: args.SubnetID.ToStringOutput(),
PrivateIpAddressAllocation: pulumi.String("Dynamic"),
PublicIpAddressId: webserver.PublicIP.ID(),
},
@@ -84,8 +83,8 @@ func NewWebserver(ctx *pulumi.Context, name string, args *WebserverArgs, opts ..
OsProfile: compute.VirtualMachineOsProfileArgs{
ComputerName: pulumi.String("hostname"),
AdminUsername: args.Username,
- AdminPassword: args.Password,
- CustomData: args.BootScript,
+ AdminPassword: args.Password.ToStringOutput(),
+ CustomData: args.BootScript.ToStringOutput(),
},
OsProfileLinuxConfig: compute.VirtualMachineOsProfileLinuxConfigArgs{
DisablePasswordAuthentication: pulumi.Bool(false),
@@ -115,7 +114,7 @@ func (ws *Webserver) GetIPAddress(ctx *pulumi.Context) pulumi.StringOutput {
return ready.ApplyT(func(args []interface{}) (string, error) {
name := args[1].(string)
resourceGroupName := args[2].(string)
- ip, err := network.LookupPublicIP(ctx, &network.GetPublicIPArgs{
+ ip, err := network.GetPublicIP(ctx, &network.GetPublicIPArgs{
Name: name,
ResourceGroupName: resourceGroupName,
})

Update azure-go-webserver-component (#565)