Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Use canonical dynamodump docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Surabian committed Jan 29, 2018
1 parent f32de79 commit 429780c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tasks/restore
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ if [ "${VP_DYNAMODB_REGION}" == "${default_dynamodb_region}" ]; then
echo "Restoring the $dynamodb_table_name table on a local DynamoDB instance..."
VP_AUTO_INIT=false ${DIR}/init
local_dynamodb_port=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "8000/tcp") 0).HostPort}}' ${VP_NAMESPACE}-dynamodb)
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v ${snapshot_path}:${snapshot_path} mattsurabian/dynamodump:1.1.1 sh -s <<EOF
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v ${snapshot_path}:${snapshot_path} bchew/dynamodump:1.1.2 sh -s <<EOF
dynamodump -m restore -r ${VP_DYNAMODB_REGION} -s ${dynamodb_table_name} -d ${VP_DYNAMODB_RESTORE_NAME} --dumpPath ${snapshot_path} --host ${VP_NAMESPACE}-dynamodb --port 8000 --accessKey ${default_dynamodb_region} --secretKey ${default_dynamodb_region}
EOF
else
echo "Restoring the $dynamodb_table_name table on AWS DynamoDB..."
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v $HOME/.aws:/root/.aws -e AWS_PROFILE=${AWS_PROFILE} -v ${snapshot_path}:${snapshot_path} mattsurabian/dynamodump:1.1.1 sh -s <<EOF
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v $HOME/.aws:/root/.aws -e AWS_PROFILE=${AWS_PROFILE} -v ${snapshot_path}:${snapshot_path} bchew/dynamodump:1.1.2 sh -s <<EOF
dynamodump -m restore -r ${VP_DYNAMODB_REGION} -s ${dynamodb_table_name} -d ${VP_DYNAMODB_RESTORE_NAME} --dumpPath ${snapshot_path}
EOF
fi
Expand Down
4 changes: 2 additions & 2 deletions tasks/snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ if [ "${VP_DYNAMODB_REGION}" == "${local_dynamodb_region}" ]; then
echo "Snapshotting the $VP_DYNAMODB_TABLE table on the local DynamoDB instance..."
docker_vault_id=$(docker ps -q -f name=${VP_NAMESPACE}-vault1)
snap_name=$(docker ps -q -f name=${VP_NAMESPACE}-vault1)-${VP_SNAPSHOT_NAME}
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v ${vp_snapshot_cache}:/mnt/snapshots mattsurabian/dynamodump:1.1.1 sh -s <<EOF
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v ${vp_snapshot_cache}:/mnt/snapshots bchew/dynamodump:1.1.2 sh -s <<EOF
dynamodump -m backup -r ${VP_DYNAMODB_REGION} -s ${VP_DYNAMODB_TABLE} --dumpPath /mnt/snapshots/${snap_name} --host ${VP_NAMESPACE}-dynamodb --port 8000 --accessKey ${VP_DYNAMODB_REGION} --secretKey ${VP_DYNAMODB_REGION}
EOF
else
# auth must occur with expected AWS environment variables, IAM role, etc
snap_name=${VP_DYNAMODB_REGION}-${VP_SNAPSHOT_NAME}
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v $HOME/.aws:/root/.aws -e AWS_PROFILE=${AWS_PROFILE} -v ${vp_snapshot_cache}:/mnt/snapshots mattsurabian/dynamodump:1.1.1 sh -s <<EOF
docker run --rm -i --network ${VP_NAMESPACE} -u $(id -u):$(id -g) -v $HOME/.aws:/root/.aws -e AWS_PROFILE=${AWS_PROFILE} -v ${vp_snapshot_cache}:/mnt/snapshots bchew/dynamodump:1.1.2 sh -s <<EOF
dynamodump -m backup -r ${VP_DYNAMODB_REGION} -s ${VP_DYNAMODB_TABLE} --dumpPath /mnt/snapshots/${snap_name}
EOF
fi
Expand Down

0 comments on commit 429780c

Please sign in to comment.