forked from siderolabs/contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage.go
40 lines (34 loc) · 872 Bytes
/
storage.go
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
// compute.go holds functions specific to Azure storage resources
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func (ri *ResourceInfo) createStorage(ctx *pulumi.Context) error {
account, err := storage.NewAccount(
ctx,
ClusterName+"storage",
&storage.AccountArgs{
ResourceGroupName: ri.ResourceGroup.Name,
Location: pulumi.String(ri.Location),
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
},
)
if err != nil {
return err
}
ri.StorageAcct = account
container, err := storage.NewContainer(
ctx,
ClusterName+"-blobcontainer",
&storage.ContainerArgs{
StorageAccountName: ri.StorageAcct.Name,
},
)
if err != nil {
return err
}
ri.StorageContainer = container
return nil
}