Skip to content

Commit

Permalink
Use AWS_DEFAULT_REGION vs AWS_REGION
Browse files Browse the repository at this point in the history
  • Loading branch information
gasi committed Mar 9, 2022
1 parent a4398fa commit be3f9f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/zoomhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-2"
# See: https://github.com/aws/aws-cli/issues/735#issuecomment-39395188
AWS_DEFAULT_REGION: "us-east-2"
ZH_API_PASSWORD_DEVELOPMENT: ${{ secrets.ZH_API_PASSWORD_DEVELOPMENT }}
ZH_API_USERNAME_DEVELOPMENT: ${{ secrets.ZH_API_USERNAME_DEVELOPMENT }}
ZH_API_PASSWORD_STAGING: ${{ secrets.ZH_API_PASSWORD_STAGING }}
Expand Down
4 changes: 0 additions & 4 deletions ops/aws/deploy-processContent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ fi

update_code_output=$(
aws lambda update-function-code \
--region $AWS_REGION \
--zip-file fileb://function-processContent.zip \
--function-name processContent
)
Expand All @@ -61,7 +60,6 @@ update_configuration_output=$(
aws lambda update-function-configuration \
--function-name processContent \
--memory-size $MEMORY_SIZE \
--region $AWS_REGION \
--description "$(date +%FT%T%z)-$ZH_ENV-memory-$MEMORY_SIZE" \
--environment "Variables={NUM_CONCURRENT_UPLOADS=$NUM_CONCURRENT_UPLOADS,ROOT_PATH=$ROOT_PATH,S3_CACHE_BUCKET=$S3_CACHE_BUCKET,TMPDIR=$TMPDIR,VIPS_DISC_THRESHOLD=$VIPS_DISC_THRESHOLD,ZH_API_PASSWORD=$ZH_API_PASSWORD,ZH_API_USERNAME=$ZH_API_USERNAME}" \
--revision-id $(jq --raw-output '.RevisionId' <<< "$update_code_output")
Expand All @@ -70,14 +68,12 @@ update_configuration_output=$(
publish_output=$(
aws lambda publish-version \
--function-name processContent \
--region $AWS_REGION \
--code-sha256 $(jq --raw-output '.CodeSha256' <<< "$update_code_output") \
--revision-id $(jq --raw-output '.RevisionId' <<< "$update_configuration_output")
)

aws lambda update-alias \
--function-name processContent \
--region $AWS_REGION \
--function-version $(jq --raw-output '.Version' <<< "$publish_output") \
--revision-id $(jq --raw-output '.RevisionId' <<< "$publish_output") \
--name $ZH_ENV

0 comments on commit be3f9f0

Please sign in to comment.