pulumi/tests/integration/config_secrets_warn/go/main.go

164 lines
4.9 KiB
Go

// Copyright 2016-2021, Pulumi Corporation. All rights reserved.
//go:build !all
// +build !all
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
c := config.New(ctx, "")
config.Get(ctx, "plainstr1")
config.Require(ctx, "plainstr2")
config.Try(ctx, "plainstr3")
config.GetSecret(ctx, "plainstr4")
config.RequireSecret(ctx, "plainstr5")
config.TrySecret(ctx, "plainstr6")
c.Get("plainstr7")
c.Require("plainstr8")
c.Try("plainstr9")
c.GetSecret("plainstr10")
c.RequireSecret("plainstr11")
c.TrySecret("plainstr12")
config.GetBool(ctx, "plainbool1")
config.RequireBool(ctx, "plainbool2")
config.TryBool(ctx, "plainbool3")
config.GetSecretBool(ctx, "plainbool4")
config.RequireSecretBool(ctx, "plainbool5")
config.TrySecretBool(ctx, "plainbool6")
c.GetBool("plainbool7")
c.RequireBool("plainbool8")
c.TryBool("plainbool9")
c.GetSecretBool("plainbool10")
c.RequireSecretBool("plainbool11")
c.TrySecretBool("plainbool12")
config.GetInt(ctx, "plainint1")
config.RequireInt(ctx, "plainint2")
config.TryInt(ctx, "plainint3")
config.GetSecretInt(ctx, "plainint4")
config.RequireSecretInt(ctx, "plainint5")
config.TrySecretInt(ctx, "plainint6")
c.GetInt("plainint7")
c.RequireInt("plainint8")
c.TryInt("plainint9")
c.GetSecretInt("plainint10")
c.RequireSecretInt("plainint11")
c.TrySecretInt("plainint12")
config.GetFloat64(ctx, "plainfloat1")
config.RequireFloat64(ctx, "plainfloat2")
config.TryFloat64(ctx, "plainfloat3")
config.GetSecretFloat64(ctx, "plainfloat4")
config.RequireSecretFloat64(ctx, "plainfloat5")
config.TrySecretFloat64(ctx, "plainfloat6")
c.GetFloat64("plainfloat7")
c.RequireFloat64("plainfloat8")
c.TryFloat64("plainfloat9")
c.GetSecretFloat64("plainfloat10")
c.RequireSecretFloat64("plainfloat11")
c.TrySecretFloat64("plainfloat12")
var obj interface{}
config.GetObject(ctx, "plainobjj1", &obj)
config.RequireObject(ctx, "plainobj2", &obj)
config.TryObject(ctx, "plainobj3", &obj)
config.GetSecretObject(ctx, "plainobj4", &obj)
config.RequireSecretObject(ctx, "plainobj5", &obj)
config.TrySecretObject(ctx, "plainobj6", &obj)
c.GetObject("plainobjj7", &obj)
c.RequireObject("plainobj8", &obj)
c.TryObject("plainobj9", &obj)
c.GetSecretObject("plainobj10", &obj)
c.RequireSecretObject("plainobj11", &obj)
c.TrySecretObject("plainobj12", &obj)
config.Get(ctx, "str1")
config.Require(ctx, "str2")
config.Try(ctx, "str3")
config.GetSecret(ctx, "str4")
config.RequireSecret(ctx, "str5")
config.TrySecret(ctx, "str6")
c.Get("str7")
c.Require("str8")
c.Try("str9")
c.GetSecret("str10")
c.RequireSecret("str11")
c.TrySecret("str12")
config.GetBool(ctx, "bool1")
config.RequireBool(ctx, "bool2")
config.TryBool(ctx, "bool3")
config.GetSecretBool(ctx, "bool4")
config.RequireSecretBool(ctx, "bool5")
config.TrySecretBool(ctx, "bool6")
c.GetBool("bool7")
c.RequireBool("bool8")
c.TryBool("bool9")
c.GetSecretBool("bool10")
c.RequireSecretBool("bool11")
c.TrySecretBool("bool12")
config.GetInt(ctx, "int1")
config.RequireInt(ctx, "int2")
config.TryInt(ctx, "int3")
config.GetSecretInt(ctx, "int4")
config.RequireSecretInt(ctx, "int5")
config.TrySecretInt(ctx, "int6")
c.GetInt("int7")
c.RequireInt("int8")
c.TryInt("int9")
c.GetSecretInt("int10")
c.RequireSecretInt("int11")
c.TrySecretInt("int12")
config.GetFloat64(ctx, "float1")
config.RequireFloat64(ctx, "float2")
config.TryFloat64(ctx, "float3")
config.GetSecretFloat64(ctx, "float4")
config.RequireSecretFloat64(ctx, "float5")
config.TrySecretFloat64(ctx, "float6")
c.GetFloat64("float7")
c.RequireFloat64("float8")
c.TryFloat64("float9")
c.GetSecretFloat64("float10")
c.RequireSecretFloat64("float11")
c.TrySecretFloat64("float12")
config.GetObject(ctx, "obj1", &obj)
config.RequireObject(ctx, "obj2", &obj)
config.TryObject(ctx, "obj3", &obj)
config.GetSecretObject(ctx, "obj4", &obj)
config.RequireSecretObject(ctx, "obj5", &obj)
config.TrySecretObject(ctx, "obj6", &obj)
c.GetObject("obj7", &obj)
c.RequireObject("obj8", &obj)
c.TryObject("obj9", &obj)
c.GetSecretObject("obj10", &obj)
c.RequireSecretObject("obj11", &obj)
c.TrySecretObject("obj12", &obj)
config.GetObject(ctx, "parent1", &obj)
config.RequireObject(ctx, "parent2", &obj)
config.TryObject(ctx, "parent3", &obj)
config.GetSecretObject(ctx, "parent1", &obj)
config.RequireSecretObject(ctx, "parent2", &obj)
config.TrySecretObject(ctx, "parent3", &obj)
config.GetObject(ctx, "names1", &obj)
config.RequireObject(ctx, "names2", &obj)
config.TryObject(ctx, "names3", &obj)
config.GetSecretObject(ctx, "names1", &obj)
config.RequireSecretObject(ctx, "names2", &obj)
config.TrySecretObject(ctx, "names3", &obj)
return nil
})
}