github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/provider-config-schema/go/configstation/config/config.go (about) 1 // Code generated by test DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package config 5 6 import ( 7 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 8 "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" 9 ) 10 11 func GetFavoritePlants(ctx *pulumi.Context) string { 12 return config.Get(ctx, "configstation:favoritePlants") 13 } 14 15 // omg my favorite sandwich 16 func GetFavoriteSandwich(ctx *pulumi.Context) string { 17 return config.Get(ctx, "configstation:favoriteSandwich") 18 } 19 func GetIsMember(ctx *pulumi.Context) bool { 20 v, err := config.TryBool(ctx, "configstation:isMember") 21 if err == nil { 22 return v 23 } 24 return true 25 } 26 func GetKids(ctx *pulumi.Context) string { 27 return config.Get(ctx, "configstation:kids") 28 } 29 func GetName(ctx *pulumi.Context) string { 30 return config.Get(ctx, "configstation:name") 31 } 32 func GetNumberOfSheep(ctx *pulumi.Context) int { 33 return config.GetInt(ctx, "configstation:numberOfSheep") 34 } 35 36 // This is a huge secret 37 func GetSecretCode(ctx *pulumi.Context) string { 38 v, err := config.Try(ctx, "configstation:secretCode") 39 if err == nil { 40 return v 41 } 42 return getEnvOrDefault("", nil, "SECRET_CODE", "MY_SUPER_SECRET_CODE").(string) 43 }