When playing around with the Amplify settings, I discover the Amplify Studio.
There you could use DataStore for the existing project but that polluted my generated types for the project.
I can manually delete all _version and other keys, but when running amplify codegen -> the unwanted keys will be back.
I want to remove DataStore from my project but I can't find how?
You can run amplify api remove in your project root folder.
The other option might be to remove backend from Amplify Console(this is eu-central-1 region, select your region), select your app, select backend environment and there is option 'delete' from dropdown menu
I was recently able to accomplish this by doing the following:
First run: amplify update api
Select from one of the below mentioned services: GraphQL
Select a setting to edit: Disable conflict detection
Update API: amplify push
After the update the _version and _lastChangedAt fields were still on the DynamoDB objects, but you can manually remove those if you want them gone.
Related
Question
Is there any way to point existing Amplify apps to new repositories? Failing that, is there a way to clone Amplify app settings (including Backend environments) from one app to another?
Background
I was a complete newcomer to AWS until several months ago, when I inherited responsibility for an existing set of AWS apps developed by another team.
In our AWS account, Amplify is configured to use GitLab repositories which were under the previous team's control. I got a copy of the code, but I don't have access to the repositories.
So I uploaded the code to a new Bitbucket repository, and now I need to point the existing apps in Amplify to the new repositories. My goal is to be able to push changes to my new repository and have Amplify detect those changes so the new build can be pushed.
3 Unsuccessful Solutions
I've tried approaching this problem from a few different angles.
1. Create a new app
I created a new app which points to the new repository, which proved to be very simple. But I didn't anticipate how difficult it would be to migrate settings (especially the Backend environment) from one app to the other. So I thought it might be simpler to point the existing apps at the new repository.
2. Reconnect Repository
I thought that configuring a new repository for an existing app would be relatively straightforward. Here's the procedure I followed.
Log into AWS Console and navigate to the Amplify service
From the list of apps, select the one I want to modify
Under "App settings", select the "General" tab
Click the "Reconnect repository" button
A dialog box popped up: "Reconnect your Git repository". It prompted me to select from a dropdown list of "Recently updated repositories", but that list was empty. There's no place to enter an address for a new repository, so this path seems to be a dead end.
3. Create a Connection
I tried to "Create a connection to Bitbucket" as described in AWS documentation here: https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-create-bitbucket.html
But the "Developer Tools" console seems unrelated to Amplify. The connection was created successfully, but it doesn't appear in the "Recently updated repositories" list, and I don't know how else it can be used.
If you are okay with a CLI solution, have a look at the comment below from https://github.com/aws-amplify/amplify-hosting/issues/288#issuecomment-737192995
aws amplify update-app --app-id AMPLIFY_APP_ID --repository REPOSITORY_URL --access-token ACCESS_TOKEN
... worked for me, transferring from one github account to another
github account and repo. I know it's not quite what the OP was doing,
but thought it may be worth noting that:
The AMPLIFY_APP_ID is the last bit of the app ARN (e.g.
dXXXXXXXXXXXXX)
For github repositories, the access token is a
Personal Access Token (https://github.com/settings/tokens).
I gave it all of the repo and admin:repo_hook privileges. That had to be created from the repository owner's account, not a contributor.
This helped me to change that app to point to a different GitHub repository.
AWS CLI requires some setup though, the documentation is available here https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
Edit: You might also have to Reconnect The Repository using the UI after changing it using the CLI
What I expect: After typing amplify codegen models, it should generate the model "classes" for my already existing backend.
What happens: Message Output:
No AppSync API configured. Please add an API.
What I did so far:
Already did the Amplify Prerequisites mentioned here
I added my existing API to my Android Project by amplify codegen
That resulted in generated files for mutations/queries/subscriptions and the schema.json as you can see on the screenshot below.
I wanted to generate the models classes as mentioned here
But as said, the model classes are not generated. May someone has the solution for my situation out there. Would help me a lot :)
amplify codegen models uses CLI codegen to generate models to be used for the new Amplify API and Amplify DataStore categories, which is separate from the generated code used by the AppSync client.
To generate models for Amplify API, try using the following command: amplify add api, to add a new API. When prompted to edit your models, follow the instructions to edit the schema.graphql file in specified path.
If you try amplify codegen models at this point, then you will find that the models are generated.
I currently am working on an Application with a MySQL back-end hosted on GCP. Code is Node.js and we use CircleCI and Sequelize. Right now after deploying my scripts, if I had any schema changes, I would go in to the database and manually add those fields with sql scripts. We create migrations in our code and want to add those new field programmatically. I need to go in the container root and manually run the npx sequelize db:migrate. Is there a way to automate that?
For background info, I come from the database side not developer side, so please be gentle if my question seems to have an obvious answer.
I need to use a custom db instead of one that boxfuse creates when deploying my application to aws. I created a aws rds database, and the app won't connect to it after deploying, instead it uses a database that boxfuse creates while deploying. I use flyway for migrations.
I tried to put the url, username and password into a configuration boxfuse.yml file, but nothing happens.
I read the boxfuse documentation, but couldn't find a solution to my problem.
Is there a easy way to solve my problem?
To use your own database and prevent Boxfuse from provisioning one for you, the easiest is to recreate your app with -db.type=none (see https://cloudcaptain.sh/docs/payloads/springboot#databases)
Alternatively if you want to use both the Boxfuse-provisioned database and your own, you have to manually define a second DataSource bean with the correct connection parameters which you can then pass to Flyway or any other library requiring it.
I created an on-demand webjob. In the management portal there is no option to upload a new zip, to update it.
I can delete the existing webjob and create a new one, but I would like to keep my logs.
Is there any way to re-deploy it, overriding the old version, maintaining the logs?
You can connect to the website where the webjob is at via FTP and update the necessary files without erasing your log files.
You can get the credentials to connect via FTP from the Publish Profile.
UPDATE
Added screenshot to find credentiales easier per Erik's comment
You can also use your website's debug console at: https://yoursitename.scm.azurewebsites.net/DebugConsole
There you get a file explorer in your browser where you can drag/drop files (even zips that will be extracted into your website).
In the file browser go to d:\home\site\wwwroot\App_Data\jobs\triggered\jobname
Some more info about this at: http://blog.amitapple.com/post/74215124623/deploy-azure-webjobs/