cuddly-napkin-89521
12/07/2022, 12:50 PMimport * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as fs from "fs"
import * as path from "path"
export default function createETLFunction() {
const etlResourceGroup = new azure.core.ResourceGroup("rg-horizon-dev-etl", {
location: "Westeurope",
name: "rg-horizon-dev-etl",
});
const etlAppServicePlan = new azure.appservice.Plan("sp-horizon-dev-etl", {
resourceGroupName: etlResourceGroup.name,
name:"sp-horizon-dev-etl",
kind: "Linux",
sku: {
size: "Y1",
tier: "Dynamic",
},
kind: "FunctionApp"
},)
const etlStorageAccount = new azure.storage.Account("sahorizondevetl", {
name: "sahorizondevetl",
resourceGroupName: etlResourceGroup.name,
location: etlResourceGroup.location,
accountTier: "Standard",
accountReplicationType: "LRS",
minTlsVersion: "TLS1_2",
isHnsEnabled: true,
tags: {
environment: "dev",
},
});
const etlAppInsights = new azure.appinsights.Insights("etlAppInsights", {
name : "etlAppInsights",
resourceGroupName: etlResourceGroup.name,
applicationType: "other",
});
new azure.appservice.ArchiveFunctionApp("faarc-horizon-etl-dev", {
name:"faarc-horizon-etl-dev",
plan: etlAppServicePlan,
resourceGroupName: etlResourceGroup.name,
archive: new pulumi.asset.FileArchive(path.resolve(__dirname, "../../services/horizon.etl")),
version: "~4",
appSettings: {
FUNCTIONS_WORKER_RUNTIME: "python",
APPINSIGHTS_INSTRUMENTATIONKEY: etlAppInsights?.instrumentationKey,
},
siteConfig: {
linuxFxVersion: "python|3.7",
minTlsVersion: "1.2",
cors: {
allowedOrigins: ['*']
},
}})
const exampleFunctionApp = new azure.appservice.FunctionApp("fa-horizon-etl-dev", {
name:"fa-horizon-etl-dev",
resourceGroupName: etlResourceGroup.name,
location: etlResourceGroup.location,
appServicePlanId: etlAppServicePlan.id,
storageAccountName: etlStorageAccount.name,
storageAccountAccessKey: etlStorageAccount.primaryAccessKey,
});
}
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by