Skip to content

Instantly share code, notes, and snippets.

@croosen
Last active May 6, 2019 10:18
Show Gist options
  • Save croosen/d35f2d0586aa2e8459d1b79a78dbd4b0 to your computer and use it in GitHub Desktop.
Save croosen/d35f2d0586aa2e8459d1b79a78dbd4b0 to your computer and use it in GitHub Desktop.
# replace all nine occurrences of $AWSRegion in swagger.json with the region that you are creating your API and Lamdba in
$ sed -i '.bak' 's/$AWSRegion/us-east-1/g' swagger.json
# get the LambdaArn
$ aws cloudformation describe-stacks --stack-name apigateway --query Stacks[0].Outputs
# replace all nine occurrences of $LambdaArn in swagger.json with the ARN from the stack output above (e.g. arn:aws:lambda:us-east-1:YYY:function:apigateway-Lambda-XXX)
$ LambdaArn/arn:aws:lambda:us-east-1:YYY:function:apigateway-Lambda-XXX/g' swagger.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment