Amplify-cli: Amplify push fails after adding amplify auth

Created on 23 Sep 2018  路  10Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
Amplify push fails after adding amplify auth

To Reproduce
Steps to reproduce the behavior:

  1. amplify add auth
  2. I just used default properties
  3. amplify push
  4. Resource is not in the state stackUpdateComplete, CREATE_FAILED

Screenshots
CREATE_FAILED testauth AWS::CloudFormation::Stack Sat Sep 22 2018 19:04:37 GMT-0400 (Eastern Daylight Time) Parameters: [authRoleArn, autoVerifiedAttributes, allowUnauthenticatedIdentities, smsVerificationMessage, userpoolClientReadAttributes, mfaTypes, emailVerificationSubject, useDefault, openIdLambdaIAMPolicy, userpoolClientGenerateSecret, mfaConfiguration, userpoolClientLogPolicy, openIdRolePolicy, identityPoolName, openIdLogPolicy, thirdPartyAuth, authSelections, smsAuthenticationMessage, roleExternalId, mfaLambdaLogPolicy, passwordPolicyMinLength, userPoolName, openIdLambdaRoleName, userpoolClientWriteAttributes, policyName, userpoolClientName, userpoolClientLambdaPolicy, resourceName, mfaLambdaIAMPolicy, mfaPassRolePolicy, emailVerificationMessage, userpoolClientRefreshTokenValidity, userpoolClientSetAttributes, unAuthRoleName, authRoleName, requiredAttributes, roleName, passwordPolicyCharacters, lambdaLogPolicy, unAuthRoleArn, userpoolClientLambdaRole, defaultPasswordPolicy, mfaLambdaRole] must have values

I have a parameters.json with filled in values and a .yml created in backend/auth but for some reason I am unable to do amplify push.

investigating

Most helpful comment

FWIW, I encountered this problem, I believe after the project directory name was changed and it did not pickup the parameters.json files. Fix was to copy contents of both amplify-meta.json files, do amplify init again, then put original amplify-meta.json files back. It won't remove the existing defined resources.

All 10 comments

Could you please check which region you鈥檙e deploying to?

I am deploying to us-east-1 N.Virginia

You might have reached the limit of certain AWS services:
Please check the number of S3 buckets, Cognito UserPools, Cognito Identify Pools, and Cloudformation stacks.

Is the error ouput you posted from the CLI? Is there any additional output in cloudformation?

Yes the error is from the CLI, nothing additional on cloudformation. I just re-initialized the project and migrated my code over, works now.

@jtan25 This is an intermittent Cloudformation issue which we've seen. Closing this issue for now.

I know this issue is closed but is there a fix on the horizon? I've looked at the cloud formation for the API, I see there are dependencies on the Auth template, but if it's present shouldn't it just read the values from the auth parameters.json; followed up with skipping the attempt to update the auth stack.

I can take the API Cloudformation template that is stored in S3 and pass the necessary params in Cloudformation and have the stack successfully be created. However, doing so I lose the option to update the GraphQL schema by using the amplify push api feature.

FWIW, I encountered this problem, I believe after the project directory name was changed and it did not pickup the parameters.json files. Fix was to copy contents of both amplify-meta.json files, do amplify init again, then put original amplify-meta.json files back. It won't remove the existing defined resources.

Encountered the same issue.To solve, I just reran amplify-init without copying over anything. Solved the issue and persisted all my data correctly.

TL;DR I had the same problem. If anyone else runs into this error, I suggest updating amplify-cli to the latest version.

I just installed amplify and tried it out. I got the same error. I found an error in the cloudFormation console. Under the stack that failed -> events, there's an error that says:

The runtime parameter of nodejs6.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs8.10) while creating or updating functions. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: da65986f-7c36-11e9-9bcc-cfe59ec061e8)

So I went into my project, in the file: /amplify/backend/auth/<projectName>/<authID>-cloudformation-template.yml and replaced all instances of nodejs6.10 with nodejs8.10. Now it works!

I'm using amplify-cli v 1.6.10 on mac. Before I used 1.1 I believe. If anyone else runs into this problem, I think the issue is simply upgrading your amplify-cli. At this point in time, the lambdas were using node.js6.10 but has since been updated

Was this page helpful?
0 / 5 - 0 ratings