Skip to content

Commit

Permalink
fix: Able to use iam roles without providing AWS_ACCESS_KEY_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
mannytoledo committed Sep 25, 2015
1 parent 1173b38 commit 25154c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ HTTP_PROXY=""
: ${HOSTNAME:?$MISSING_VAR_MESSAGE}
: ${AWS_REGION:=$DEFAULT_AWS_REGION}
: ${ZK_DATA_DIR:=$DEFAULT_DATA_DIR}
: ${ZK_CLUSTER_SIZE:=0}
: ${ZK_LOG_DIR:=$DEFAULT_LOG_DIR}
: ${HTTP_PROXY_HOST:=""}
: ${HTTP_PROXY_PORT:=""}
Expand All @@ -34,6 +35,7 @@ cat <<- EOF > /opt/exhibitor/defaults.conf
zoo-cfg-extra=tickTime\=2000&initLimit\=10&syncLimit\=5&quorumListenOnAllIPs\=true
auto-manage-instances-settling-period-ms=0
auto-manage-instances=1
auto-manage-instances-fixed-ensemble-size=3
EOF


Expand All @@ -42,10 +44,12 @@ if [[ -n ${AWS_ACCESS_KEY_ID} ]]; then
com.netflix.exhibitor.s3.access-key-id=${AWS_ACCESS_KEY_ID}
com.netflix.exhibitor.s3.access-secret-key=${AWS_SECRET_ACCESS_KEY}
EOF
S3_SECURITY="--s3credentials /opt/exhibitor/credentials.properties"
fi

if [[ -n ${S3_BUCKET} ]]; then
echo "backup-extra=throttle\=&bucket-name\=${S3_BUCKET}&key-prefix\=${S3_PREFIX}&max-retries\=4&retry-sleep-ms\=30000" >> /opt/exhibitor/defaults.conf

S3_SECURITY="--s3credentials /opt/exhibitor/credentials.properties"
BACKUP_CONFIG="--configtype s3 --s3config ${S3_BUCKET}:${S3_PREFIX} ${S3_SECURITY} --s3region ${AWS_REGION} --s3backup true"
else
BACKUP_CONFIG="--configtype file --fsconfigdir /opt/zookeeper/local_configs --filesystembackup true"
Expand Down

0 comments on commit 25154c0

Please sign in to comment.