We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @pulumi/azure.compute function in @pulumi/azure

To help you get started, we’ve selected a few @pulumi/azure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / examples / azure-ts-webserver-component / webserver.ts View on Github external
this.publicIp = new azure.network.PublicIp(`${name}-ip`, {
            resourceGroupName: args.resourceGroupName,
            allocationMethod: "Dynamic",
        }, { parent: this });
        this.networkInterface = new azure.network.NetworkInterface(`${name}-nic`, {
            resourceGroupName: args.resourceGroupName,
            ipConfigurations: [{
                name: "webserveripcfg",
                subnetId: args.subnetId,
                privateIpAddressAllocation: "Dynamic",
                publicIpAddressId: this.publicIp.id,
            }],
        }, { parent: this });

        // Now create the VM, using the resource group and NIC allocated above.
        this.vm = new azure.compute.VirtualMachine(`${name}-vm`, {
            resourceGroupName: args.resourceGroupName,
            networkInterfaceIds: [this.networkInterface.id],
            vmSize: args.vmSize || "Standard_A0",
            deleteDataDisksOnTermination: true,
            deleteOsDiskOnTermination: true,
            osProfile: {
                computerName: "hostname",
                adminUsername: args.username,
                adminPassword: args.password,
                customData: args.bootScript,
            },
            osProfileLinuxConfig: {
                disablePasswordAuthentication: false,
            },
            storageOsDisk: {
                createOption: "FromImage",
github pulumi / examples / azure-ts-webserver / index.ts View on Github external
resourceGroupName,
    allocationMethod: "Dynamic",
});

const networkInterface = new azure.network.NetworkInterface("server-nic", {
    resourceGroupName,
    ipConfigurations: [{
        name: "webserveripcfg",
        subnetId: network.subnets[0].id,
        privateIpAddressAllocation: "Dynamic",
        publicIpAddressId: publicIp.id,
    }],
});

// Now create the VM, using the resource group and NIC allocated above.
const vm = new azure.compute.VirtualMachine("server-vm", {
    resourceGroupName,
    networkInterfaceIds: [networkInterface.id],
    vmSize: "Standard_A0",
    deleteDataDisksOnTermination: true,
    deleteOsDiskOnTermination: true,
    osProfile: {
        computerName: "hostname",
        adminUsername: username,
        adminPassword: password,
        customData: `#!/bin/bash\n
echo "Hello, World!" > index.html
nohup python -m SimpleHTTPServer 80 &`,
    },
    osProfileLinuxConfig: {
        disablePasswordAuthentication: false,
    },
github pulumi / examples / azure-ts-vm-scaleset / index.ts View on Github external
protocol: "Tcp",
});

const vnet = new azure.network.VirtualNetwork("vnet", {
    resourceGroupName: resourceGroup.name,
    addressSpaces: ["10.0.0.0/16"],
});

const subnet = new azure.network.Subnet("subnet", {
    enforcePrivateLinkEndpointNetworkPolicies: false,
    resourceGroupName: resourceGroup.name,
    addressPrefix: "10.0.2.0/24",
    virtualNetworkName: vnet.name,
});

const scaleSet = new azure.compute.ScaleSet("vmscaleset", {
    resourceGroupName: resourceGroup.name,
    networkProfiles: [{
        ipConfigurations: [{
            loadBalancerBackendAddressPoolIds: [bpepool.id],
            name: "IPConfiguration",
            primary: true,
            subnetId: subnet.id,
        }],
        name: "networkprofile",
        primary: true,
    }],
    osProfile: {
        adminUsername: adminUser,
        adminPassword,
        computerNamePrefix: "vmlab",
        customData:
github pulumi / examples / azure-js-webserver / index.js View on Github external
let networkInterface = new azure.network.NetworkInterface("server-nic", {
    resourceGroupName: resourceGroup.name,
    ipConfigurations: [{
        name: "webserveripcfg",
        subnetId: network.subnets[0].id,
        privateIpAddressAllocation: "Dynamic",
        publicIpAddressId: publicIP.id,
    }],
});

let userData = 
`#!/bin/bash
echo "Hello, World!" > index.html
nohup python -m SimpleHTTPServer 80 &`;

let vm = new azure.compute.VirtualMachine("server-vm", {
    resourceGroupName: resourceGroup.name,
    networkInterfaceIds: [networkInterface.id],
    vmSize: "Standard_A0",
    deleteDataDisksOnTermination: true,
    deleteOsDiskOnTermination: true,
    osProfile: {
        computerName: "hostname",
        adminUsername: username,
        adminPassword: password,
        customData: userData,
    },
    osProfileLinuxConfig: {
        disablePasswordAuthentication: false,
    },
    storageOsDisk: {
        createOption: "FromImage",
github WallarooLabs / wallaroo / orchestration / pulumi / azure-cluster / index.js View on Github external
"use strict";

const pulumi = require("@pulumi/pulumi");
const azure = require("@pulumi/azure");

let config = new pulumi.Config();

const vmssName = config.require("vmss-name");
const vmssId = config.require("vmss-id");

const vmss = azure.compute.ScaleSet.get(vmssName, vmssId);
github pulumi / examples / azure-ts-cosmosapp-component / vms.ts View on Github external
resourceGroupName: resourceGroup.name,
            addressPrefix: "10.0.2.0/24",
            virtualNetworkName: vnet.name,
        }, opts);

        const customData = pulumi.all([cosmosAccount.endpoint, cosmosAccount.primaryMasterKey, database.name, container.name])
            .apply(([endpoint, key, databaseName, collectionName]) => {
                const s = file.replace("${ENDPOINT}", endpoint)
                    .replace("${MASTER_KEY}", key)
                    .replace("${DATABASE}", databaseName)
                    .replace("${COLLECTION}", collectionName)
                    .replace("${LOCATION}", location);
                return s;
            });

        const scaleSet = new azure.compute.ScaleSet(`vmss-${location}`, {
            resourceGroupName: resourceGroup.name,
            location,
            networkProfiles: [{
                ipConfigurations: [{
                    loadBalancerBackendAddressPoolIds: [bpepool.id],
                    name: "IPConfiguration",
                    primary: true,
                    subnetId: subnet.id,
                }],
                name: "networkprofile",
                primary: true,
            }],
            osProfile: {
                adminUsername: "neo",
                adminPassword: "SEcurePwd$3",
                computerNamePrefix: "lab",

@pulumi/azure

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Nat

Apache-2.0
Latest version published 1 month ago

Package Health Score

87 / 100
Full package analysis