Skip to content

Instantly share code, notes, and snippets.

View mikhailshilkov's full-sized avatar

Mikhail Shilkov mikhailshilkov

View GitHub Profile
import * as azure from "@pulumi/azure";
import * as pulumi from "@pulumi/pulumi";
const resourceGroup = new azure.core.ResourceGroup("rg", { location: "westus2" });
const appServicePlan = new azure.appservice.Plan("asp", {
resourceGroupName: resourceGroup.name,
kind: "App",
sku: {
tier: "Basic",
@mikhailshilkov
mikhailshilkov / dump.txt
Created September 25, 2019 14:11
ReportStats
{"startTime":"2019/09/25 15:33:00","endTime":"2019/09/25 15:33:35","elapsedSeconds":35.1280141,"stackName":"name-timer-d606c64e","testId":"C:\\Users\\theuser\\AppData\\Local\\Temp\\name-timer-d606c64e-106936391","stepName":"yarn-install","commandLine":"C:\\Program Files (x86)\\Yarn\\bin\\yarn.cmd install","testName":"timer","isError":false,"cloudURL":""}{"startTime":"2019/09/25 15:33:35","endTime":"2019/09/25 15:33:36","elapsedSeconds":1.1130774,"stackName":"name-timer-d606c64e","testId":"C:\\Users\\theuser\\AppData\\Local\\Temp\\name-timer-d606c64e-106936391","stepName":"yarn-link","commandLine":"C:\\Program Files (x86)\\Yarn\\bin\\yarn.cmd link @pulumi/azure","testName":"timer","isError":false,"cloudURL":""}{"startTime":"2019/09/25 15:33:36","endTime":"2019/09/25 15:33:38","elapsedSeconds":1.7090328,"stackName":"name-timer-d606c64e","testId":"C:\\Users\\theuser\\AppData\\Local\\Temp\\name-timer-d606c64e-106936391","stepName":"pulumi-stack-init","commandLine":"C:\\Users\\theuser\\.pulumi\\bin\\pulumi.exe sta
@mikhailshilkov
mikhailshilkov / index.ts
Created August 26, 2019 09:56
Pulumi and Azure Functions with config values
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as eventhub from "@pulumi/azure/eventhub";
const resourceGroup = new azure.core.ResourceGroup("test");
const config = new pulumi.Config();
const workspaceID = config.require("workspaceID");
const workspaceKey = config.require("workspaceKey");
const workspaceKeySecret = config.require("workspaceKeySecret");
provider "azurerm" {
version = "= 1.32.1"
}
resource "azurerm_resource_group" "rg" {
name = "testResourceGroup"
location = "westus"
}
resource "azurerm_storage_account" "atftest" {
open System
open Pulumi
open Components
open Common
open Cosmos
open FunctionApp
module Program =
import * as aws from "@pulumi/aws";
var s3 = new aws.sdk.S3();
let bucket = new aws.s3.Bucket("maptiles", {});
function downloadS3 (key: string): Promise<string> {
return new Promise<string>((resolve, reject) => {
var params = {
Bucket: bucket.bucket.get(),
import * as aws from "@pulumi/cloud-aws";
// Create a table `urls`, with `name` as primary key.
let urlTable = new aws.Table("urls", "name");
// Create a web server.
let endpoint = new aws.API("urlshortener");
// Serve all files in the www directory to the root.
endpoint.static("/", "www");
const api = new Endpoint("urlapi", {
path: "/{proxy+}",
lambda: func.lambda
});
export interface LambdaOptions {
readonly path: string;
readonly file: string;
readonly environment?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}
export class Lambda extends pulumi.ComponentResource {
import { Lambda } from "./lambda";
const func = new Lambda("lambda-get", {
path: "./app",
file: "read",
environment: {
"COUNTER_TABLE": counterTable.name
},
});