Skip to content

Commit

Permalink
Merge pull request #17 from usdot-jpo-ode/feature/dynamic_credentials
Browse files Browse the repository at this point in the history
Modified code to expose amazon key constant variables as application arguments.
  • Loading branch information
snallamothu authored Aug 12, 2020
2 parents 8c50ec0 + 38654e9 commit 9a2bde7
Show file tree
Hide file tree
Showing 3 changed files with 391 additions and 335 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ COPY --from=builder /home/src/main/resources/logback.xml /home
COPY --from=builder /home/target/jpo-aws-depositor-jar-with-dependencies.jar /home

CMD java -Dlogback.configurationFile=/home/logback.xml \
-Daws.accessKeyId=$AWS_ACCESS_KEY_ID -Daws.secretKey=$AWS_SECRET_ACCESS_KEY \
-jar /home/jpo-aws-depositor-jar-with-dependencies.jar \
--bootstrap-server $DOCKER_HOST_IP:9092 \
-g group1 \
-t $DEPOSIT_TOPIC \
-b $DEPOSIT_BUCKET_NAME \
-k $DEPOSIT_KEY_NAME
-k $DEPOSIT_KEY_NAME \
-i $K_AWS_ACCESS_KEY_ID \
-a $K_AWS_SECRET_ACCESS_SECRET \
-n $K_AWS_SESSION_TOKEN \
-e $K_AWS_EXPIRATION \
-u $API_ENDPOINT
-h $HEADER_ACCEPT
-x $HEADER_X_API_KEY
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This project is intended to serve as a consumer application to subscribe to a K
The use of AWS credentials is being read from the machine's environmental variables. You may also set them in your bash profile. Note that when using Docker Compose from the main `jpo-ode` repository, these variables are set in the `.env` present in that repo.

```
export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY>
export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY>
export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_KEY>
```

Expand All @@ -29,6 +29,13 @@ usage: Consumer Example
-b,--bucket-name <arg> Bucket Name
-t,--topic <arg> Topic Name
-type,--type <arg> string|byte message type
-i, --k-aws-key <arg> AWS key name (Optional, defaults to AccessKeyId)
-a, --k-aws-secret-key <arg> AWS secret access key name (Optional, defaults to SecretAccessKey)
-n, --k-aws-session-token <arg> AWS session token name (Optional, defaults to SessionToken)
-e, --k-aws-expiration <arg> AWS expiration name (Optional, defaults Expiration)
-u, --token-endpoint <arg> API token endpoint
-h, --header-accept <arg> Header Accept (Optional, defaults to application/json)
-x, --header-x-api-key <arg> Header X API key
```
Example Usage As Of: 3/2/18

Expand Down
Loading

0 comments on commit 9a2bde7

Please sign in to comment.