Describe the bug
I've made some changes to the authentication schema in the cloudformation.yml file and updated the parameters.json file to add 2 custom attributes. Whenever I try to push them to the cloud using "amplify push" the command instead pulls the current state of the cloud and reverts my local changes.
Amplify CLI Version
4.27.1
To Reproduce
Expected behavior
I want my User Pool attributes to be updated in the cloud.
Desktop (please complete the following information):
Update: tried adding the custom attributes in the cloud and running "amplify pull". The terminal informed me that there are no changes and nothing happened.
@Zablas have you been able to successfully push other resources in the project? What parameters / modifications did you make to the cloudformation template?
@edwardfoyle I have noticed an interesting thing that after running "amplify update auth" and doing some other unrelated changes and then running "amplify push" it no longer complains about missing attributes even though locally they are not present but they are represented in the cloud. I have added these lines of code in my cloud formation:
-
Name: notifications
Required: true
Mutable: true
AttributeDataType: String
StringAttributeConstraints:
MinLength: 1
MaxLength: 256
-
Name: radius
Required: true
Mutable: true
AttributeDataType: Number
NumberAttributeConstraints:
MinValue: 1
MaxValue: 100
These are now gone locally but as I've mentioned everything seems to still be working.
@Zablas you'll have to be careful about running update on resources where you have made manual changes to the templates. In some cases, update operations will overwrite changes that you have made manually. That being said, I would expect that after doing a push, what is present in the cloud would be the same as what you have locally. Are you sure you were looking at the same region / environment?
@edwardfoyle Yes, I am sure. These are my only resources open on this account.
I'm having the same issue, I updated my schema.graphql
OS: OSX
Node Version: v14.13.1
Amplify v4.29.8
(base) ➜ vite git:(aws-login) **amplify status**
Current Environment: dev
| Category | Resource name | Operation | Provider plugin |
| -------- | ------------- | --------- | ----------------- |
| Api | xxxxx | **Update** | awscloudformation |
| Auth | vxxxxx | No Change | awscloudformation |
| Storage | xxxxx | No Change | awscloudformation |
(base) ➜ vite git:(aws-login) amplify push
✔ Successfully pulled backend environment dev from the cloud.
Current Environment: dev
| Category | Resource name | Operation | Provider plugin |
| -------- | ------------- | --------- | ----------------- |
| Auth | xxxxxxxxx | No Change | awscloudformation |
| Storage | xxxxxxxxxx | No Change | awscloudformation |
| Api | xxxxxxxxx | No Change | awscloudformation |
All changes made to schema.graphql are reverted
@Stevenje @Zablas I've experienced this exact same issue when I'm modifying files in amplify/#current-cloud-backend/.. directories instead of files in amplify/backend/... :) Could you please check again if that's not the case?
hey @kaustavghosh06 unfortunately I had to move away from amplify - but if it helps the only file I edited was schema.graphql file and was trying to push updates from that. Not sure if thats in both locations. Hope that helps.
@Stevenje Yeah, the schema.graphql is present in both the directories. Closing this issue - but if you come across this anytime in the future please feel free to open up a new issue.
@kaustavghosh06 , please re-open this ticket. I have exactly the same issue that @Stevenje mentioned.
OS: OSX
Node Version: 10.22.1
Amplify: 4.37.1
| Category | Resource name | Operation | Provider plugin |
| -------- | --------------- | --------- | ----------------- |
| Api | f402 | Update | awscloudformation |
| Auth | cognito3d888862 | No Change | awscloudformation |
Here the changes are being recognized
and when I run amplify push it reverts to the old schema, like no change ever happen. 🤨
| Category | Resource name | Operation | Provider plugin |
| -------- | --------------- | --------- | ----------------- |
| Api | f402 | No Change | awscloudformation |
| Auth | cognito3d888862 | No Change | awscloudformation |
All changes made to schema.graphql are reverted
I updated to the latest amplify CLI just to be sure it was not that.
I've been working with amplify for the last year and this was never a problem
Thanks for your help!