Skip to content

Commit

Permalink
fix: e2e failed tests for auth Triggers PR (#7262)
Browse files Browse the repository at this point in the history
* fix: e2e failed tests for auth Triggers PR
* fix: update lambda nodejs runtime
  • Loading branch information
akshbhu authored May 5, 2021
1 parent a27a033 commit fedb6c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function createCustomResourceforAuthTrigger(context: any, authTriggerConne
function createCustomResource(stack: cdk.Stack, authTriggerConnections: AuthTriggerConnection[], userpoolId: cdk.CfnParameter) {
const triggerCode = fs.readFileSync(authTriggerAssetFilePath, 'utf-8');
const authTriggerFn = new lambda.Function(stack, 'authTriggerFn', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_12_X,
code: lambda.Code.fromInline(triggerCode),
handler: 'index.handler',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export async function uploadAuthTriggerTemplate(context: $TSContext) {
const category = 'auth';
let { amplifyMeta } = context.amplify.getProjectDetails();
const authResource = amplifyMeta?.auth ?? {};
const resourceDir = path.join(pathManager.getBackendDirPath(), category, Object.keys(authResource)[0]);
const authResourceParams = Object.keys(authResource);
if (authResourceParams.length === 0) {
return {};
}
const resourceDir = path.join(pathManager.getBackendDirPath(), category, authResourceParams[0]);
const authTriggerCfnFilePath = path.join(resourceDir, AUTH_TRIGGER_TEMPLATE);
const { DeploymentBucketName } = context.amplify.getProjectMeta()?.providers?.[ProviderName] ?? {};
try {
Expand Down

0 comments on commit fedb6c4

Please sign in to comment.