question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

amplify push overwrites manual changes to userPoolGroups/template.js

See original GitHub issue

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

No response

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

4.52.0

What operating system are you using?

Mac

Amplify Categories

auth

Amplify Commands

push

Describe the bug

I need to make some changes to my user pool groups template. More specifically I am adding another action to the AssumeRolePolicyDocument section under the section that defines one of my user pool groups.

   "orgAdminGroupRole": {
            "Type": "AWS::IAM::Role",
            "Properties": {
                "RoleName":{
                    "Fn::Join": [
                        "",
                        [
                          {
                            "Ref": "authcognitoUserPoolId"
                          },
                          "-orgAdminGroupRole"
                        ]
                    ]
                },
                "AssumeRolePolicyDocument": {
                    "Version": "2012-10-17",
                    "Statement": [
                        {
                            "Sid": "",
                            "Effect": "Allow",
                            "Principal": {
                                "Federated": "cognito-identity.amazonaws.com"
                            },
                            "Action": [
                                "sts:AssumeRoleWithWebIdentity",
                                "sts:TagSession"
                            ],
                            "Condition": {
                              "StringEquals": {"cognito-identity.amazonaws.com:aud": {"Ref":"authcognitoIdentityPoolId"}},
                              "ForAnyValue:StringLike": {"cognito-identity.amazonaws.com:amr": "authenticated"}
                            }
                        }
                    ]
                }
            }
        },

After amplify push, the Action section gets overwritten to

"Action": "sts:AssumeRoleWithWebIdentity"

Expected behavior

Amplify push should not override the file but should just deployed.

Reproduction steps

Make changes to the template Run amplify push

GraphQL schema(s)

# Put schemas below this line


Log output

# Put your logs below this line


Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HieronymusLexcommented, Feb 10, 2022

@setterlee I have created #9738 for that same issue

1reaction
setterleecommented, Feb 3, 2022

Similar issue here but with the user-pool-group-precedence.json file, i’m trying to add some custom policies to give access to geolocations resources to my default users group but the amplify push command overrides the file…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amplify Push overwrites json file · Issue #10008 - GitHub
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made. I am trying to create...
Read more >
Manual deploys - AWS Amplify Hosting
This blog post describes the process for setting up a Lambda trigger to automatically deploy changes to Amplify Hosting when updates are made...
Read more >
amplify push causes local changes to be reverted instead of ...
I'm running Amplify CLI v4.27.1 and Node.js v12.18.3. Any ideas on why is this happening?
Read more >
Get started - Typical workflows - AWS Amplify Docs
Once you have made your category updates, run the command amplify push to update ... Based upon the resources added/updated, the aws-exports.js file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found