func main() {
	const secretVar string = "SUPER_SECRET_VAR"
	const secretSsmKey string = "/app/some-secret"

	var sec providers.SecretProvider

	// Use environment variable secret if it's available, otherwise, use SSM
	// parameter store
	if _, ok := os.LookupEnv(secretVar); ok {
		sec = providers.NewEnvSecret(secretVar)
	} else {
		var err error
		sec, err = providers.NewSsmSecret(secretSsmKey)
		if err != nil {
			log.Fatal(err)
		}
	}

	for {
		secretValue, err := sec.GetSecret()
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(secretValue)
		time.Sleep(time.Second)
	}
}
// main runs the program from the CLI
main runs the program from the CLI
// main runs the program from the CLI
func main() {
	const secretVar string = "SUPER_SECRET_VAR"
	const secretSsmKey string = "/app/some-secret"
	var sec providers.SecretProvider
	if _, ok := os.LookupEnv(secretVar); ok {
		sec = providers.NewEnvSecret(secretVar)
	} else {
		var err error
		sec, err = providers.NewSsmSecret(secretSsmKey)
		if err != nil {
			log.Fatal(err)
		}
	}
	for {
		secretValue, err := sec.GetSecret()
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(secretValue)
		time.Sleep(time.Second)
	}
}
func main ( ) { const secretVar string = " " const secretSsmKey string = " " var sec providers . SecretProvider if _ , ok := os . LookupEnv ( secretVar ) ; ok { sec = providers . NewEnvSecret ( secretVar ) } else { var err error sec , err = providers . NewSsmSecret ( secretSsmKey ) if err != nil { log . Fatal ( err ) } } for { secretValue , err := sec . GetSecret ( ) if err != nil { log . Fatal ( err ) } fmt . Println ( secretValue ) time . Sleep ( time . Second ) } }
main runs the program from the CLI
main runs the program from the CLI
// Use environment variable secret if it's available, otherwise, use SSM // parameter store