diff --git a/src/main/java/gyro/aws/elbv2/AuthenticateCognitoAction.java b/src/main/java/gyro/aws/elbv2/AuthenticateCognitoAction.java index 8c1ba1bbb..0c1a2bb07 100644 --- a/src/main/java/gyro/aws/elbv2/AuthenticateCognitoAction.java +++ b/src/main/java/gyro/aws/elbv2/AuthenticateCognitoAction.java @@ -130,7 +130,20 @@ public void setUserPoolDomain(UserPoolDomainResource userPoolDomain) { } public String primaryKey() { - return String.format("%s/%s/%s", getUserPoolArn(), getUserPoolClient().getId(), getUserPoolDomain().getDomain()); + StringBuilder sb = new StringBuilder(); + if (getUserPoolArn() != null) { + sb.append(getUserPoolArn()).append(" "); + } + + if (getUserPoolClient().getId() != null) { + sb.append(getUserPoolClient().getId()); + } else { + sb.append(getUserPoolClient().getName()); + } + + sb.append(" ").append(getUserPoolDomain().getDomain()); + + return sb.toString(); } @Override