Skip to content

Instantly share code, notes, and snippets.

Luke Hoban lukehoban

Block or report user

Report or block lukehoban

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lukehoban
lukehoban / waitForJob.ts
Last active Jul 9, 2019
Pulumi program which waits on Jobs during a Kubernetes deployment
View waitForJob.ts
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
import * as k8sOutput from "@pulumi/kubernetes/types/output";
import * as k8sapi from 'kubernetes-client';
const job = new k8s.batch.v1.Job("job", {
spec: {
template: {
spec: {
containers: [{
@lukehoban
lukehoban / index.ts
Created Jun 20, 2019
Passing credentials to a Pulumi dynamic provider
View index.ts
import * as splunk from "./splunk"
async function getSecretValue(): Promise<string> {
return "abcd"
}
getSecretValue().then(secret => {
splunk.setAuth(secret);
new splunk.SavedSearch("foo", {});
});
@lukehoban
lukehoban / index.ts
Last active Apr 9, 2019
Simple Aurora Serverless + Lambda VPC example with Pulumi
View index.ts
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as random from "@pulumi/random";
// Construct a VPC
const vpc = new awsx.ec2.Vpc("vpc");
// Create an Aurora Serverless MySQL database
const dbsubnet = new aws.rds.SubnetGroup("dbsubnet", {
View managedkubernetes.ts
import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";
// Create an AWS VPC and EKS cluster
const vpc = new awsx.Vpc("vpc", { usePrivateSubnets: false });
const cluster = new eks.Cluster("cluster", {
vpcId: vpc.vpcId,
subnetIds: vpc.subnetIds,
});
@lukehoban
lukehoban / apigatewaydomain.ts
Last active Jan 27, 2019
API Gateway Domain Mapping in Pulumi
View apigatewaydomain.ts
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// The services we want to host on our domain...
const api1 = new aws.apigateway.x.API("api1", {
routes: [
{method: "GET", path: "/", eventHandler: async(ev) => {
return {
statusCode: 200,
body: JSON.stringify({hello: "world"}),
@lukehoban
lukehoban / thumbnailer.js
Created Jun 18, 2018
Serverless + Containers with Pulumi
View thumbnailer.js
const cloud = require("@pulumi/cloud-aws");
const aws = require("@pulumi/aws");
// A bucket to store videos and thumbnails.
const bucket = new cloud.Bucket("bucket");
const bucketName = bucket.bucket.id;
// A task which runs a containerized FFMPEG job to extract a thumbnail image.
const ffmpegThumbnailTask = new cloud.Task("ffmpegThumbTask", {
build: "./docker-ffmpeg-thumb",
@lukehoban
lukehoban / helloworld.js
Created Jun 18, 2018
A simple Pulumi program
View helloworld.js
const cloud = require("@pulumi/cloud-aws");
const endpoint = new cloud.API("hello");
endpoint.static("/", "www");
endpoint.get("/source", (req, res) => res.json({name: "AWS"}));
exports.url = endpoint.publish().url;
View expression.str
interface IHashtable
{
double lookup(string i);
void set(string i, double d);
}
class Hashtable()
{
var o = {};
View ClosureCompiler.svc.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Activation;
using System.Net;
using System.IO;
using System.Web;
View parser.fsy.diff
@@ -459,8 +466,12 @@ StatementList:
| Statement { [$1]}
// See 12.2
VariableStatement:
- | VAR VariableDeclarationList SEMICOLON { VariableStatement(List.rev($2)) }
- | VAR VariableDeclarationList { VariableStatement(List.rev($2)) }
+ | Type VariableDeclarationList SEMICOLON { VariableStatement([], false, $1,List.rev($2)) }
+ | Type VariableDeclarationList { VariableStatement([], false, $1, List.rev($2)) }
+ | READONLY Type VariableDeclarationList SEMICOLON { VariableStatement([], true, $2,List.rev($3)) }
+ | READONLY Type VariableDeclarationList { VariableStatement([], true, $2, List.rev($3)) }
You can’t perform that action at this time.