Skip to content

Commit aa143e6

Browse files
committed
parameterize region as query
1 parent f1307ae commit aa143e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/routes/v1/Aws.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ const router = Router();
77

88

99
router.get('/securitygroups', async (req: Request, res: Response) => {
10-
const { region, access_key, secret_key } = req.headers;
11-
10+
const { access_key, secret_key } = req.headers;
11+
const { region } = req.query
12+
1213
let ret:PromiseType = await execShellCommand(`docker-compose -f helper/docker-compose.yml run \
13-
-e AWS_DEFAULT_REGION=${region} \
14+
-e AWS_DEFAULT_REGION=${region || 'us-east-1'} \
1415
-e AWS_ACCESS_KEY_ID=${access_key} \
1516
-e AWS_SECRET_ACCESS_KEY=${secret_key} \
1617
--rm aws ec2 describe-security-groups \

0 commit comments

Comments
 (0)