No longer maintained, in favor of: https://github.com/hookactions/config
Pre-process config values by reading secrets from AWS.
// main.gopackage main
import (
"context""fmt"
figAws "github.com/hookactions/fig/aws""github.com/spf13/viper"
)
funcmain() {
viper.SetConfigName("config")
viper.AddConfigPath(".")
iferr:=viper.ReadInConfig(); err!=nil {
panic(err)
}
fig, err:=figAws.New(nil)
iferr!=nil {
panic(err)
}
fig.PreProcessConfigItems(context.Background())
value:=viper.GetString("my_var")
fmt.Println(value)
}echo"my_var: sm://foo">> config.yaml
go run main.gosm://– Get string value from secrets managersmb://– Get binary value from secrets managerssm://– Get string value from parameter store- Note: decryption of the value is automatically requested.
ssmb64://– Get base64 encoded binary value from parameter store- Note: decryption of the value is automatically requested.
Pre-process config values by reading secrets from AWS.
// main.gopackage main
import (
"context""fmt""os""github.com/hookactions/fig/awsEnv"
)
funcmain() {
fig, err:=awsEnv.New()
iferr!=nil {
panic(err)
}
fmt.Println(fig.GetEnv(context.Background(), "MY_VAR"))
}MY_VAR=sm://foo go run main.gosm://– Get string value from secrets managerssm://– Get string value from parameter store- Note: decryption of the value is automatically requested.
