Skip to content

Commit

Permalink
chore: simplify clientAuthentication assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Dahlberg Victor committed May 22, 2024
1 parent 92ffc5f commit bb72fc6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/@aws-cdk/aws-msk-alpha/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,20 +681,15 @@ export class Cluster extends ClusterBase {
let clientAuthentication: any = {};

if (props.clientAuthentication?.saslProps) {
clientAuthentication = {
sasl: {
...(props.clientAuthentication?.saslProps?.iam ? { iam: { enabled: props.clientAuthentication.saslProps.iam } } : {}),
...(props.clientAuthentication?.saslProps?.scram ? { scram: { enabled: props.clientAuthentication.saslProps.scram } } : {}),
},
clientAuthentication.sasl = {
...(props.clientAuthentication?.saslProps?.iam ? { iam: { enabled: props.clientAuthentication.saslProps.iam } } : {}),
...(props.clientAuthentication?.saslProps?.scram ? { scram: { enabled: props.clientAuthentication.saslProps.scram } } : {}),
};
}

if (props.clientAuthentication?.tlsProps) {
clientAuthentication = {
...clientAuthentication,
tls: {
certificateAuthorityArnList: props.clientAuthentication.tlsProps?.certificateAuthorities?.map((ca) => ca.certificateAuthorityArn),
},
clientAuthentication.tls = {
certificateAuthorityArnList: props.clientAuthentication.tlsProps?.certificateAuthorities?.map((ca) => ca.certificateAuthorityArn),
};
}

Expand Down

0 comments on commit bb72fc6

Please sign in to comment.