-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
48 lines (42 loc) · 1.33 KB
/
main.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
41
42
43
44
45
46
47
48
package main
import (
"github.com/pulumi/pulumi-azure-native/sdk/go/azure/resources"
"github.com/pulumi/pulumi-azure-native/sdk/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
resourceGroup, err := resources.NewResourceGroup(ctx, "fllo-rg",
&resources.ResourceGroupArgs{Tags: pulumi.StringMap{"owner": pulumi.String("fllo")}, Location: pulumi.String(`westeurope`)})
if err != nil {
return err
}
_, err = storage.NewStorageAccount(ctx, "sa", &storage.StorageAccountArgs{
ResourceGroupName: resourceGroup.Name,
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_LRS"),
},
Kind: pulumi.String("StorageV2"),
})
if err != nil {
return err
}
// Export the primary key of the Storage Account
//ctx.Export("primaryStorageKey", pulumi.All(resourceGroup.Name, account.Name).ApplyT(
// func(args []interface{}) (string, error) {
// resourceGroupName := args[0].(string)
// accountName := args[1].(string)
// accountKeys, err := storage.ListStorageAccountKeys(ctx, &storage.ListStorageAccountKeysArgs{
// ResourceGroupName: resourceGroupName,
// AccountName: accountName,
// })
// if err != nil {
// return "", err
// }
//
// return accountKeys.Keys[0].Value, nil
// },
//))
return nil
})
}