Unable to update appClientId locally in Flutter using AWS Amplify - flutter

I am using AWS Amplify for Flutter. I generated many configurations using the CLI and pushed them to AWS using amplify push. For some reason, I had to delete the App client created using Amplify after which I manually created an app client in Cognito.
Created App client in Cognito User Pool
Now I changed the app client ID in Flutter project to the new one(blurred in the images) in amplifyconfiguration.dart and amplify-meta.json in backend/ directory. According to Amplify CLI docs, we are allowed to do manual edits to amplify/backend.
amplify-meta.json change
Finally I did an amplify push so that these changes are deployed to Cloud too. But when I checked the amplify-meta.json in the backend/ directory, I saw that the app client ID was reverted back to the old one which I had deleted initially.
I feel this is the reason why I am not able to get the correct access token for a session, can someone please help me to know how I can update the app client ID locally??

Related

Failed to get Firebase project xxxxxx. Please make sure the project exists and your account has permission to access it

I have two projects in Flutter (A, B), in project A I make the normal connection to Firebase and everything works fine, it brings data, sends data, updates and deletes data. since that project is from my personal google account, but when I use project B, which is not personal, it is from an external account, it does not let me bring data, it does not let me do anything and I get console.
[2023-02-01T03:57:29.360Z] #firebase/firestore:
On the other hand when I do a firebase deploy I have the following error in my project B,
Failed to get Firebase project xxxxxx. Please make sure the project exists and your account has permission to access it
If anyone knows how I could verify the permissions on that project.
If you already have permission from project owner
Try this :
firebase logout
firebase login
Login with your email that content your Firebase project
firebase use --add
Choose the name of your project
Now type: firebase deploy
Also this might help : firebase login --reauth
You can check if your account has access to the Firebase project by heading to this link https://console.firebase.google.com/project/{PROJECT-ID}/settings/iam - just replace {PROJECT-ID} with the actual project ID of the Firebase project.
Once you've verified that you have the needed permissions, check if you're logged-in on Firebase CLI with the correct account. If you're already logged in, running firebase login should display the currently logged-in user. Otherwise, it'll prompt you to login to an account.
If you have other issues with the Firebase project, it's best to reach out to Firebase Support.

Pass environment variable values to spring boot profiles (application.properties file) when deploying from Github

I have a simple Spring Boot REST app that uses Mongo Atlas as the database and I have a couple of environment variables to pass to the project for the connection URL. I have defined this in the src/main/resources/application.properties which is the standard Spring profile for storing such properties. Here's the property name and value.
spring.data.mongodb.uri=mongodb+srv://${mongodb.username}:${mongodb.password}#....
I use VSCode for local dev and use a launch.json file which is not committed to my github repo to pass these values and I can run this locally. I was able to deploy this app successfully to Heroku and setup these two values in the Heroku console in my App settings and it all works fine on Heroku also. I am trying to deploy the same app to GCP App Engine but I could not find an easy way to pass these values. All the help articles seem to indicate that I need to use some gcp datastore and some cloud provider specific code in my app. Or use some kind of a github action script. That seems a little bit involved and I wanted to know if there is an easy way of passing these values to the app via gcp settings (just like in Heroku) without polluting my repo with cloud provider specific code or yml files.

How to change Amplify backend in local Flutter project

I have an Flutter project which is using Amazon Amplify resources.
My problem is that I have two Amplify solutions ( seperate appId, not just dev/prod environments ) that I'm using with my Flutter application.
Whenever I try to switch the Amplify files in local with : amplify pull --appId --envName dev.
I receive the error:
Amplify appId mismatch.
You are currently working in the amplify project with Id
Is there a way to switch appId's without deleting the Amplify CLI and installing it again?
It is supposed that when you go to the Backend environment of the app in Amplify it shows you:
amplify pull --appId ######### --envName dev
With the #'s as the id of the app. After that, you use:
amplify init
And this should allow you to select the new environment of the app.

Cloud Build service account not created when API enabled - Cant deploy app

I am having issues deploying an update to a current app which was last deployed in July 2019.
It asked me to enable Cloud Build.
I had to first enable billing account for the app. I did this. I then enabled the cloud build API.
I now get a permission denied error when I run gcloud app deploy. The docs say to check the service account permissions, but when I load that page it says I need to enable the Cloud Build API. I click on the link and it shows me that the API is enabled. I click manage, go settings, and it says "The Cloud Build API needs to be enabled before changing the permissions of the service account."
Usually enabling an API takes few minutes before you can use it. Can you try again deploying your app?
Additionally, you don't need to add any new permission to your cloud build service account unless you are using cloud build in some kind of CI/CD pipeline. in That case you need to ⁠add some few more permissions to this service account.
You can always check which APIs are enabled using ⁠gcloud command line.
I'd suggest try to disable and re-enable the API, wait for a few mins and try again.
UPDATE:
The issue described might be a result of a known issue.
I suggest you star this Public Issue to stay updated.

How can I pull changes made on the AppSync web-console with the Amplify CLI "pull" command

What I want to accomplish:
I have edited an amplify + AppSync project on the AppSync web console and I want to pull it onto my local machine.
What I did:
I have initialized an amplify project with the Amplify CLI by executing three commands:
amplify init
amplify add api
amplify push
(the added api is GraphQL)
Next I edited some of the auto generated GraphQL resolvers on the AppSync web console. (I have tested the edited resolvers with a client app -> they worked)
Afterwards however, when I execute a pull in the Amplify CLI:
amplify pull
it only pulls changes made to the local files before the last Amplify CLI push command,
so any changes made to the AppSync web console are not taken into account by the Amplify CLI pull command.
Questions:
Is this expected behavior?
Is there a way to include changes made to the Web Console in the Amplify CLI pull command? (especially changed resolvers)
Versions:
amplify cli: 4.13.3
Additional Things I Discovered That Could Be Helpful:
AWS-CloudFormation also only shows updates when changes are made using the Amplify CLI.
The AWS-S3 bucket that holds the amplify projects files, also only mirrors the changes pushed using the Amplify CLI.
You can do this manually by downloading the schema file from the console and replacing /amplify/backend/api/schema.graphql then running amplify push.
There is an issue open to automate this here: https://github.com/aws-amplify/amplify-cli/issues/1220