Beispiel #1
0
func ExampleListCommand() {
	keyringImpl = keyring.NewArrayKeyring([]keyring.Item{
		{Key: "llamas", Data: []byte(`{"AccessKeyID":"ABC","SecretAccessKey":"XYZ"}`)},
	})

	run([]string{"list"}, os.Exit)
	// Output:
	// llamas
}
Beispiel #2
0
func ExampleExecCommand() {
	awsConfigFile = &fileConfig{}
	keyringImpl = keyring.NewArrayKeyring([]keyring.Item{
		{Key: "llamas", Data: []byte(`{"AccessKeyID":"ABC","SecretAccessKey":"XYZ"}`)},
	})

	run([]string{"--debug", "exec", "--no-session", "llamas", "--", "sh", "-c", "echo $AWS_ACCESS_KEY_ID"}, os.Exit)
	// Output:
	// ABC
}