Skip to content

Commit

Permalink
parameterize region as query
Browse files Browse the repository at this point in the history
  • Loading branch information
KimKiHyuk committed Oct 3, 2020
1 parent f1307ae commit aa143e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/routes/v1/Aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ const router = Router();


router.get('/securitygroups', async (req: Request, res: Response) => {
const { region, access_key, secret_key } = req.headers;

const { access_key, secret_key } = req.headers;
const { region } = req.query

let ret:PromiseType = await execShellCommand(`docker-compose -f helper/docker-compose.yml run \
-e AWS_DEFAULT_REGION=${region} \
-e AWS_DEFAULT_REGION=${region || 'us-east-1'} \
-e AWS_ACCESS_KEY_ID=${access_key} \
-e AWS_SECRET_ACCESS_KEY=${secret_key} \
--rm aws ec2 describe-security-groups \
Expand Down

0 comments on commit aa143e6

Please sign in to comment.