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
openapi: "3.0.1" | |
info: | |
title: "openbanking-mtls-test" | |
version: "2020-09-19 06:20:03UTC" | |
servers: | |
paths: | |
/v1/banking/accounts: | |
get: | |
responses: | |
default: |
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
/* getAccounts.js | |
This lambda returns a stubbed response for CDR Get Accounts API | |
https://consumerdatastandardsaustralia.github.io/standards/#get-accounts | |
*/ | |
exports.handler = async (event, context) => { | |
const response = { | |
statusCode: 200, | |
body: JSON.stringify({ |
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 function calls ec2.describeSecurityGroups with a filter of group-name = default | |
* If it find any ingress or egress rules in the default security group it calls | |
* ec2.revokeSecurityGroupIngress and ec2.revokeSecurityGroupEgress to remove these rules | |
* @param {[String} thisregion region to process | |
* @param {Function} cb callback | |
*/ | |
function deleteRulesFromDefaultSG(thisregion, cb) { | |
console.log("in deleteRulesFromDefaultSG processing region: ", thisregion); | |
var regional_ec2 = new aws.EC2({ |
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
/** | |
* Invokes the given lambda function with received invoke_params | |
* @param {Object} invoke_params object with region and VPC arrays | |
* @param {String} functionName Name of the Lambda function to invoke | |
*/ | |
function invokeLambda(invoke_params, functionName, callback) { | |
console.log("invokeLambda received invoke_params: " + JSON.stringify(invoke_params)); | |
console.log("invokeLambda received functionName: " + functionName); | |
var params = { | |
FunctionName: functionName, |
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
const aws = require('aws-sdk'); | |
const ec2 = new aws.EC2(); | |
const lambda = new aws.Lambda(); | |
exports.handler = (event, context, callback) => { | |
if (!(event.regions)) { | |
//lets get the regions | |
ec2.describeRegions({}, function(regionerr, region_data) { | |
if (regionerr) { | |
console.log("Error from ec2.describeRegions: ", regionerr); |
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
const aws = require('aws-sdk'); | |
const ec2 = new aws.EC2(); | |
const lambda = new aws.Lambda(); | |
exports.handler = (event, context, callback) => { | |
if (!(event.regions)) { | |
//lets get the regions | |
ec2.describeRegions({}, function(regionerr, region_data) { | |
if (regionerr) { | |
console.log("Error from ec2.describeRegions: ", regionerr); |