Skip to content

Commit

Permalink
add flag for specifying secrets manager arn and improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
petedannemann committed Dec 29, 2023
1 parent 22f0629 commit 9ef5d97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cmd/topicctl/subcmd/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ func addSharedFlags(cmd *cobra.Command, options *sharedOptions) {
os.Getenv("TOPICCTL_SASL_USERNAME"),
"SASL username if using SASL; will override value set in cluster config",
)
cmd.PersistentFlags().StringVar(
&options.saslSecretsManagerArn,
"sasl-secrets-manager-arn",
os.Getenv("TOPICCTL_SASL_SECRETS_MANAGER_ARN"),
"Secrets Manager ARN to use for credentials if using SASL; will override value set in cluster config",
)
cmd.PersistentFlags().StringVar(
&options.tlsCACert,
"tls-ca-cert",
Expand Down
2 changes: 1 addition & 1 deletion pkg/admin/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func GetKafkaCredentials(svc secretsmanageriface.SecretsManagerAPI, secretArn st

arn, err := arn.Parse(secretArn)
if err != nil {
return creds, err
return creds, fmt.Errorf("Couldn't parse the ARN for secret: %s, error: %v", secretArn, err)
}
// Remove "secret:" from the resource to get the secret name
secretName := strings.Split(arn.Resource, ":")[1]
Expand Down

0 comments on commit 9ef5d97

Please sign in to comment.