Skip to content

Commit

Permalink
Issue 21 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkass authored Apr 10, 2019
1 parent 27b1ce1 commit 9da7058
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<your_postgres_db> --pghost=<your_postgres_host> --pguser=<your_postgres_user> --pgpassword=<your_postgres_pw>
--streamname=<your_kinesis_streamname>
```
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/com/disneystreaming/pg2k4j/CommandLineRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand All @@ -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."
)
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9da7058

Please sign in to comment.