-
Notifications
You must be signed in to change notification settings - Fork 878
/
Copy pathconfig.go
34 lines (28 loc) · 888 Bytes
/
config.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
package main
import (
"fmt"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
const OvhApplicationKey = "OVH_APPLICATION_KEY"
const OvhApplicationSecret = "OVH_APPLICATION_SECRET"
const OvhConsumerKey = "OVH_CONSUMER_KEY"
const OvhServiceName = "OVH_SERVICE_NAME"
const OvhGroup = "ovh"
const FLAVOR = "flavor"
const REGION = "region"
func ovhConfig(ctx *pulumi.Context, key string) string {
return getConfig(ctx, OvhGroup, key)
}
// Cluster config keys
const ClusterGroup = "cluster"
const NAME = "name"
const NodePool = "nodepool"
const MinNodes = "min_nodes"
const MaxNodes = "max_nodes"
func clusterConfig(ctx *pulumi.Context, key string) string {
return getConfig(ctx, ClusterGroup, key)
}
func getConfig(ctx *pulumi.Context, group string, key string) string {
return config.Require(ctx, fmt.Sprintf("%s:%s", group, key))
}