forked from release-engineering/exodus-gw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request release-engineering#405 from rohanpm/dev-config-table
dev env: update scripts/instructions for config table
- Loading branch information
Showing
5 changed files
with
62 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
# | ||
# Create a dynamodb table for config in the dev env's localstack instance. | ||
# | ||
# You will need to run this when: | ||
# - initially creating the dev env, or | ||
# - after cleaning it, or | ||
# - if you want to use a different table | ||
# | ||
|
||
# should match table for the environment you want to use in exodus-gw.ini | ||
TABLE_NAME="${1:-my-config}" | ||
|
||
ENV_FILE="~/.config/exodus-gw-dev/.env" | ||
|
||
if test -f "$ENV_FILE"; then | ||
. "$ENV_FILE" | ||
fi | ||
|
||
set -xe | ||
|
||
exec aws \ | ||
--endpoint-url="${EXODUS_GW_DYNAMODB_ENDPOINT_URL:-https://localhost:3377}" \ | ||
dynamodb \ | ||
create-table \ | ||
--table-name "${TABLE_NAME}" \ | ||
--attribute-definitions AttributeName=config_id,AttributeType=S \ | ||
AttributeName=from_date,AttributeType=S \ | ||
--key-schema AttributeName=config_id,KeyType=HASH \ | ||
AttributeName=from_date,KeyType=RANGE \ | ||
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# | ||
# Populate localstack with basic resources needed for exodus-gw to run. | ||
# | ||
# This script accepts no arguments and is only usable for the default | ||
# config in exodus-gw.ini. If you want to deploy different buckets/tables, | ||
# invoke the localstack-*-init scripts separately. | ||
# | ||
# You will need to run this when: | ||
# - initially creating the dev env, or | ||
# - after cleaning it | ||
# | ||
thisdir=$(dirname $0) | ||
|
||
# Note: we continue on error here because the DDB steps will complain if | ||
# tables already exist, which is inconvenient | ||
set -x | ||
|
||
$thisdir/localstack-s3-init | ||
$thisdir/localstack-dynamodb-init | ||
$thisdir/localstack-dynamodb-config-init |