Skip to content
This repository was archived by the owner on Jun 15, 2019. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

12 Commits

Repository files navigation

No longer maintained, in favor of: https://github.com/hookactions/config

fig

headerCircleCI

Usage

AWS

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.go

Supported prefixes

  • sm:// – Get string value from secrets manager
  • smb:// – Get binary value from secrets manager
  • ssm:// – 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.

AWS via Env

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.go

Supported prefixes

  • sm:// – Get string value from secrets manager
  • ssm:// – Get string value from parameter store
    • Note: decryption of the value is automatically requested.

About

Configuration management in Go

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages