Skip to content

Commit

Permalink
Merge pull request #415 from sagansystems/aws-kms-aliases
Browse files Browse the repository at this point in the history
Support referencing AWS KMS keys by aliases
  • Loading branch information
autrilla authored Jan 11, 2019
2 parents e398d1c + 7a78a69 commit cfc6fa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kms/keysource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cfc6fa1

Please sign in to comment.