Search code examples
amazon-web-servicesaws-amplify

Is there a way for generating configuration file (yaml) or of some sort for AWS amplify project?


I am setting up a amplify project for a certain project. In near future, I would want the project to be transferred to different AWS account but with exact configuration. What's the best way to achieve so? Is there any way I can create some sort of script that would set up same project in different AWS account?


Solution

  • I do something very similar leveraging AWS Organizations with multiple member accounts and AWS SSO. At a high level, here are some things you will want to think about...

    You can find a high level architecture diagram about this here: https://aws.amazon.com/blogs/mobile/fintech-startup-creditgenie-ultimate-speed-from-mvp-to-growth/

    I've been meaning to write a blog post about this, but at a high level...

    1. Create an AWS organization from your root AWS account and setup AWS SSO.
    2. Create multiple member AWS accounts within the organization. e.g., customer1, customer2, etc.
    3. Create branches in your repository that match your account structure e.g., origin/customer1, origin/customer2.
    4. From each member AWS account, create an Amplify app in the Amplify console with 1 environment that points to the correct branch, e.g, AWS account customer1 should have an Amplify App with 1 environment called customer1 that points to the branch remote/customer1
    5. As you develop and merge changes into your main branch, you will want to also merge main into your "production" branches e.g., merge origin/main -> origin/customer1 etc.