-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
54 lines (46 loc) · 1.38 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import * as pulumi from '@pulumi/pulumi'
import * as resources from '@pulumi/azure-native/resources'
import * as storage from '@pulumi/azure-native/storage'
import * as asset from '@pulumi/pulumi/asset'
const fs = require('fs')
const stackName = pulumi.getStack()
// Create an Azure Resource Group
const resourceGroup = new resources.ResourceGroup(`BouvetOne-${stackName}`,
{
location: 'North Europe'
})
const defaultOptions = {
resourceGroupName: resourceGroup.name
}
// Create an Azure resource (Storage Account)
const storageAccount = new storage.StorageAccount('sa', {
...defaultOptions,
sku: {
name: storage.SkuName.Standard_RAGZRS
},
kind: storage.Kind.StorageV2,
enableHttpsTrafficOnly: true,
allowBlobPublicAccess: true
})
const container = new storage.BlobContainer(
'presentation',
{
...defaultOptions,
accountName: storageAccount.name,
publicAccess: 'Container',
containerName: 'presentation'
}
)
const blobs = ['no', 'en'].map(language => {
const path = `presentation/index.${language}.html`
return new storage.Blob(path, {
...defaultOptions,
accountName: storageAccount.name,
source: new asset.StringAsset(fs.readFileSync(path).toString()),
containerName: container.name,
blobName: `index.${language}.html`,
contentType: 'text/html'
})
})
export const URL_NO = blobs[0].url
export const URL_EN = blobs[1].url