Skip to content

Commit

Permalink
(fix) graphql-schema predictions migration failure because of missing… (
Browse files Browse the repository at this point in the history
#8718)

* (fix) graphql-schema predictions migration failure because of missing storage

* (fix/cleanup) changed default for storage trigger to N, removed extraneous keydown

Co-authored-by: Sachin Panemangalore <sachinrp@amazon.com>
  • Loading branch information
sachscode and Sachin Panemangalore committed Nov 11, 2021
1 parent 5063651 commit 115b105
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ async function startAddTriggerFunctionFlow(
policyID: string,
existingTriggerFunction: string | undefined,
): Promise<string | undefined> {
const enableLambdaTriggerOnS3: boolean = await prompter.yesOrNo('Do you want to add a Lambda Trigger for your S3 Bucket?');
const enableLambdaTriggerOnS3: boolean = await prompter.yesOrNo('Do you want to add a Lambda Trigger for your S3 Bucket?', false);
let triggerFunction: string | undefined = undefined;
if (enableLambdaTriggerOnS3) {
try {
Expand Down
6 changes: 5 additions & 1 deletion packages/amplify-e2e-core/src/categories/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ export function addS3AndAuthWithAuthOnlyAccess(cwd: string, settings: any): Prom
.wait('Who should have access')
.sendCarriageReturn() // Auth users only
.wait('What kind of access do you want for')
.sendCtrlA() // Select all
.send(' ')
.sendKeyDown()
.send(' ')
.sendKeyDown()
.send(' ')
.sendCarriageReturn()
.wait('Do you want to add a Lambda Trigger for your S3 Bucket')
.sendConfirmNo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ export async function transformGraphQLSchema(context, options) {

// for the predictions directive get storage config
const s3ResourceName = await invokeS3GetResourceName(context);
const storageConfig = s3ResourceName ? await getBucketName(context, s3ResourceName ) : undefined;
const storageConfig = {
bucketName: s3ResourceName ? await getBucketName(context, s3ResourceName) : undefined,
};

const buildDir = path.normalize(path.join(resourceDir, 'build'));
const schemaFilePath = path.normalize(path.join(resourceDir, schemaFileName));
Expand Down

0 comments on commit 115b105

Please sign in to comment.