From 9da705851eb141fcf562109f66cd2731ac5072cc Mon Sep 17 00:00:00 2001 From: rkass Date: Wed, 10 Apr 2019 16:52:29 -0400 Subject: [PATCH] Issue 21 (#23) --- README.md | 2 +- .../disneystreaming/pg2k4j/CommandLineRunner.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bf01288..b03507c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Then run the command below. ``` docker run -v /path/to/.aws/creds/:/aws_creds disneystreaming/pg2k4j ---awsconfiglocation=/aws_creds +--awsconfiglocation=/aws_creds --awsprofile=default --pgdatabase= --pghost= --pguser= --pgpassword= --streamname= ``` diff --git a/src/main/java/com/disneystreaming/pg2k4j/CommandLineRunner.java b/src/main/java/com/disneystreaming/pg2k4j/CommandLineRunner.java index eee4309..be0fc85 100644 --- a/src/main/java/com/disneystreaming/pg2k4j/CommandLineRunner.java +++ b/src/main/java/com/disneystreaming/pg2k4j/CommandLineRunner.java @@ -90,7 +90,9 @@ public static void main(final String[] args) { @CommandLine.Option( names = {"--awsprofile"}, description = "AWS Profile to use for accessing the Kinesis Stream." - + " If one is provided a ProfileCredentialProvider will" + + " --awsconfiglocation must also be provided when" + + " using --awsprofile." + + " If these are provided a ProfileCredentialProvider will" + " be used for interacting with AWS. Otherwise the" + " DefaultAWSCredentialsProviderChain will be used." ) @@ -99,7 +101,9 @@ public static void main(final String[] args) { @CommandLine.Option( names = {"--awsconfiglocation"}, description = "File path to use for sourcing AWS config." - + " If one is provided a ProfileCredentialProvider will" + + " --awsprofile must also be provided when" + + " using --awsconfiglocation." + + " If these are provided a ProfileCredentialProvider will" + " be used for interacting with AWS. Otherwise the" + " DefaultAWSCredentialsProviderChain will be used." ) @@ -108,14 +112,14 @@ public static void main(final String[] args) { @CommandLine.Option( names = {"--awsaccesskey"}, description = "Access key to use for accessing AWS Kinesis Stream." - + "If provided, awsSecretKey (-f) must also be provided." + + "If provided, --awssecret must also be provided." ) private String awsAccessKey; @CommandLine.Option( names = {"--awssecret"}, description = "Access secret to use for accessing AWS Kinesis " - + " Stream. If provided, awsAccessKey (-e)" + + " Stream. If provided, --awsaccesskey" + " must also be provided." ) private String awsSecretKey; @@ -201,7 +205,7 @@ public static void main(final String[] args) { private boolean usageHelpRequested; private AWSCredentialsProvider getAwsCredentialsProvider() { - if (awsProfile != null || awsConfigLocation != null) { + if (awsProfile != null && awsConfigLocation != null) { final String profile = makeProfile(awsProfile); return new ProfileCredentialsProvider(awsConfigLocation, profile); } else if (awsAccessKey != null && awsSecretKey != null) {