Skip to content

Instantly share code, notes, and snippets.

View pierskarsenbarg's full-sized avatar

Piers Karsenbarg pierskarsenbarg

View GitHub Profile
using System.Threading.Tasks;
using Pulumi;
using Pulumi.AzureNative.Resources;
using Sql = Pulumi.AzureNative.Sql;
using System;
class MyStack : Stack
{
public MyStack()
{
private (Output<string> registryUsername, Output<string> registryPassword) GetRegistryLogin(Output<string> resourceGroupName, Output<string> registryName)
{
var credentials = Output.Tuple(resourceGroupName, registryName).Apply(values =>
ListRegistryCredentials.InvokeAsync(new ListRegistryCredentialsArgs
{
ResourceGroupName = values.Item1,
RegistryName = values.Item2
}));
var registryUsername = credentials.Apply(c => c.Username ?? "");
var registryPassword = credentials.Apply(c => Output.CreateSecret(c.Passwords.First().Value ?? ""));
import * as aws from "@pulumi/aws";
// Create an AWS resource (S3 Bucket)
const bucket = new aws.s3.Bucket("my-bucket");
export const bucketName = bucket.id;
const value = new aws.ssm.Parameter("myParam", {
type: "String",
value: "bar",
function getFileHash(): string {
const filename = path.basename(__filename);
const fileContents = fs.readFileSync(filename);
return crypto.createHash("sha256").update(fileContents).digest("hex");
}
const deployment = new aws.apigateway.Deployment("deployment", {
restApi: Api.id,
triggers: {
filechanged: getFileHash(),
import * as docker from "@pulumi/docker";
const image = new docker.Image("image", {
imageName: "myimage",
build: {
args: {
arg1: "arg1value"
}
}
});
name: p-secret
runtime: nodejs
description: A minimal TypeScript Pulumi program
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.AzureNextGen.Resources.Latest;
using Pulumi.AzureNextGen.Storage.Latest;
using Pulumi.AzureNextGen.Storage.Latest.Inputs;
using Pulumi.Random;
class MyStack : Stack
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.AzureNextGen.Resources.Latest;
using Pulumi.AzureNextGen.Storage.Latest;
using Pulumi.AzureNextGen.Storage.Latest.Inputs;
using Pulumi.Random;
class MyStack : Stack
public class FunctionConfig
{
public bool Disabled { get; set; }
public Dictionary<string, string> Bindings { get; set; }
}
var config = new FunctionConfig
{
Bindings = new Dictionary<string, string>
{
using Pulumi;
using Azure = Pulumi.Azure;
using NextGen = Pulumi.AzureNextGen;
class SearchService : Stack
{
public SearchService()
{
var resourceGroup = new Azure.Core.ResourceGroup("search-rg", new Azure.Core.ResourceGroupArgs
{