Skip to content

Commit

Permalink
kms: fix panic in aws kms config validation (#48996)
Browse files Browse the repository at this point in the history
  • Loading branch information
dboslee authored Nov 14, 2024
1 parent 858e1b3 commit 1cd9f7f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1167,13 +1167,15 @@ func applyAWSKMSConfig(kmsConfig *AWSKMS, cfg *servicecfg.Config) error {
if kmsConfig.Account == "" {
return trace.BadParameter("must set account in ca_key_params.aws_kms")
}
cfg.Auth.KeyStore.AWSKMS.AWSAccount = kmsConfig.Account
if kmsConfig.Region == "" {
return trace.BadParameter("must set region in ca_key_params.aws_kms")
}
cfg.Auth.KeyStore.AWSKMS.AWSRegion = kmsConfig.Region
cfg.Auth.KeyStore.AWSKMS.MultiRegion = kmsConfig.MultiRegion
cfg.Auth.KeyStore.AWSKMS.Tags = kmsConfig.Tags
cfg.Auth.KeyStore.AWSKMS = &servicecfg.AWSKMSConfig{
AWSAccount: kmsConfig.Account,
AWSRegion: kmsConfig.Region,
MultiRegion: kmsConfig.MultiRegion,
Tags: kmsConfig.Tags,
}
return nil
}

Expand Down

0 comments on commit 1cd9f7f

Please sign in to comment.