1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

Support referencing AWS KMS keys by aliases

- addresses issue #381
This commit is contained in:
Daren Desjardins
2019-01-10 14:42:10 -08:00
parent 647d8ed41b
commit 532c36eebc

View File

@@ -180,7 +180,7 @@ func (key MasterKey) createStsSession(config aws.Config, sess *session.Session)
}
func (key MasterKey) createSession() (*session.Session, error) {
re := regexp.MustCompile(`^arn:aws[\w-]*:kms:(.+):[0-9]+:key/.+$`)
re := regexp.MustCompile(`^arn:aws[\w-]*:kms:(.+):[0-9]+:(key|alias)/.+$`)
matches := re.FindStringSubmatch(key.Arn)
if matches == nil {
return nil, fmt.Errorf("No valid ARN found in %q", key.Arn)