From 7ff5481ce7dbf895235a1261937f9311c9e80fbb Mon Sep 17 00:00:00 2001 From: Alan Sebastian Date: Tue, 5 Mar 2019 07:29:02 -0800 Subject: [PATCH] Check for nil SSM stanza and return --- pkg/secret/ssm.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/secret/ssm.go b/pkg/secret/ssm.go index 8468241..cdbc7f8 100644 --- a/pkg/secret/ssm.go +++ b/pkg/secret/ssm.go @@ -25,6 +25,10 @@ func GetSSMSecret(k string, v []byte) (string, error) { return "", err } + if j["$ssm"] == nil { + return "", errors.New("$ssm is nil, this is most likely due to an indentation problem") + } + var region string var service string if _, ok := j["$ssm"].(map[string]interface{})["service"]; ok {