Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deploy storage account, share, container group with Pulumi
"use strict";
const pulumi = require("@pulumi/pulumi");
const azure = require("@pulumi/azure");
// Create an Azure Resource Group
const resourceGroup = new azure.core.ResourceGroup("resourceGroup", {
location: "WestEurope",
name: "aci-rg",
});
const storage = new azure.storage.Account("gortstorage", {
accountReplicationType: "LRS",
resourceGroupName: resourceGroup.name,
accountTier: "Standard",
location: resourceGroup.location,
});
const share = new azure.storage.Share("go-realtime-cert", {
storageAccountName: storage.name,
resourceGroupName: resourceGroup.name,
});
// Create container group
const containerGroup = new azure.containerservice.Group("go-realtime", {
location: resourceGroup.location,
resourceGroupName: resourceGroup.name,
ipAddressType: "public",
osType: "linux",
dnsNameLabel: "realtime-go-app",
containers: [
{
name: "redis",
image: "redis",
cpu: 0.4,
memory: 0.2,
port: 6379,
},
{
name: "realtime-go",
image: "gbaeke/realtime-go-le",
cpu: 0.1,
memory: 0.2,
port: 443,
environmentVariables: {
"RTHOST": "YOUR_HOSTNAME",
"CLOUDFLARE_EMAIL": "YOUR_EMAIL",
"CLOUDFLARE_API_KEY": "YOUR_API_KEY"
},
volumes: [
{
mountPath: "/.local/share/certmagic",
name: "azshare",
readOnly: false,
shareName: share.name,
storageAccountKey: storage.primaryAccessKey,
storageAccountName: storage.name
}
]
}
]
})
// Export the connection string for the storage account
exports.containerGroupIP = containerGroup.ipAddress;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment