Skip to content

Commit

Permalink
Merge branch 'staging' into setup-ui-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-chew authored Jul 17, 2019
2 parents 36710cf + dc04c89 commit 4a554b2
Show file tree
Hide file tree
Showing 31 changed files with 153 additions and 772 deletions.
23 changes: 22 additions & 1 deletion cloudformation/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,14 @@ Resources:
- !Ref 'AWS::AccountId'
- ':marketplace-test-topic'

LambdaCommonLayer:
Type: AWS::Serverless::LayerVersion
Properties:
Description: 'Common code used by lambdas'
ContentUri: ../lambdas/common-layer/
CompatibleRuntimes:
- nodejs8.10

DevPortalLambdaFunction:
Type: AWS::Serverless::Function
Properties:
Expand All @@ -1005,7 +1013,6 @@ Resources:
FeedbackTableName: !Ref DevPortalFeedbackTableName
FeedbackSnsTopicArn:
!If [EnableFeedbackSubmission, !Ref FeedbackSubmittedSNSTopic, '']

# Adds the API as a trigger
Events:
ProxyApiRoot:
Expand All @@ -1020,6 +1027,8 @@ Resources:
RestApiId: !Ref ApiGatewayApi
Path: /{proxy+}
Method: ANY
Layers:
- !Ref LambdaCommonLayer

SubscriptionListenerLambdaFunction:
Type: AWS::Serverless::Function
Expand All @@ -1030,6 +1039,8 @@ Resources:
Role: !GetAtt BackendLambdaExecutionRole.Arn
Runtime: nodejs8.10
Timeout: 30
Layers:
- !Ref LambdaCommonLayer

CognitoUserPoolsConfirmationStrategyFunction:
Type: AWS::Serverless::Function
Expand All @@ -1040,6 +1051,8 @@ Resources:
Role: !GetAtt CognitoStrategyLambdaExecutionRole.Arn
Runtime: nodejs8.10
Timeout: 3
Layers:
- !Ref LambdaCommonLayer

CognitoUserPool:
Type: AWS::Cognito::UserPool
Expand Down Expand Up @@ -1110,6 +1123,8 @@ Resources:
CodeUri: ../lambdas/cfn-cognito-user-pools-client-settings
Handler: index.handler
Role: !GetAtt CognitoUserPoolClientSettingsBackingFnRole.Arn
Layers:
- !Ref LambdaCommonLayer

CognitoUserPoolClientSettings:
Type: AWS::CloudFormation::CustomResource
Expand Down Expand Up @@ -1190,6 +1205,8 @@ Resources:
CodeUri: ../lambdas/cfn-cognito-user-pools-domain
Handler: index.handler
Role: !GetAtt CognitoUserPoolDomainBackingFnRole.Arn
Layers:
- !Ref LambdaCommonLayer

CognitoUserPoolDomain:
Type: AWS::CloudFormation::CustomResource
Expand Down Expand Up @@ -1322,6 +1339,8 @@ Resources:
Environment:
Variables:
BucketName: !Ref ArtifactsS3BucketName
Layers:
- !Ref LambdaCommonLayer

CatalogUpdaterLambdaPermissions:
Type: AWS::Lambda::Permission
Expand All @@ -1344,6 +1363,8 @@ Resources:
Environment:
Variables:
StaticBucketName: !Ref ArtifactsS3BucketName
Layers:
- !Ref LambdaCommonLayer

StaticAssetUploader:
Type: AWS::CloudFormation::CustomResource
Expand Down
4 changes: 2 additions & 2 deletions lambdas/backend/__tests__/customers-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const customers = require('../_common/customers-controller')
const customers = require('dev-portal-common/customers-controller')
const promiser = require('../../setup-jest').promiser

describe('customersController', () => {
Expand Down Expand Up @@ -93,4 +93,4 @@ describe('customersController', () => {

expect(returnValue).toEqual(entry)
})
})
})
6 changes: 3 additions & 3 deletions lambdas/backend/express-route-handlers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const customersController = require('./_common/customers-controller.js')
const feedbackController = require('./_common/feedback-controller.js')
const customersController = require('dev-portal-common/customers-controller')
const feedbackController = require('dev-portal-common/feedback-controller')
const AWS = require('aws-sdk')
const catalog = require('./catalog/index')
const hash = require('object-hash')
const { getAllUsagePlans } = require('./shared/get-all-usage-plans')
const { getAllUsagePlans } = require('dev-portal-common/get-all-usage-plans')

const Datauri = require('datauri')

Expand Down
2 changes: 1 addition & 1 deletion lambdas/catalog-updater/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let AWS = require('aws-sdk'),
bucketName = '',
hash = require('object-hash')

const { getAllUsagePlans } = require('./shared/get-all-usage-plans')
const { getAllUsagePlans } = require('dev-portal-common/get-all-usage-plans')

/**
* Takes in an s3 listObjectsV2 object and returns whether it's a "swagger file" (one ending in .JSON, .YAML, or .YML),
Expand Down
33 changes: 0 additions & 33 deletions lambdas/catalog-updater/shared/get-all-usage-plans.js

This file was deleted.

4 changes: 2 additions & 2 deletions lambdas/cfn-cognito-user-pools-client-settings/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const AWS = require('aws-sdk');
const notifyCFN = require('./notify-cfn')
const notifyCFN = require('dev-portal-common/notify-cfn')

exports.handler = async (event, context) => {
try {
Expand Down Expand Up @@ -50,4 +50,4 @@ exports.handler = async (event, context) => {

console.error(`CognitoUserPoolClientSettings Error for request type ${event.RequestType}:`, error);
}
}
}
108 changes: 0 additions & 108 deletions lambdas/cfn-cognito-user-pools-client-settings/notify-cfn.js

This file was deleted.

4 changes: 2 additions & 2 deletions lambdas/cfn-cognito-user-pools-domain/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const AWS = require('aws-sdk');
const notifyCFN = require('./notify-cfn')
const notifyCFN = require('dev-portal-common/notify-cfn')

exports.handler = async (event, context) => {
try {
Expand Down Expand Up @@ -86,4 +86,4 @@ async function deleteUserPoolDomain(cognitoIdentityServiceProvider, domain) {
Domain: domain
}).promise();
}
}
}
Loading

0 comments on commit 4a554b2

Please sign in to comment.