ruby-on-railsdevopsgithub-actionsaws-cdkinfrastructure-as-code

aws-cdk: Any good guides or suggestions for folder structure for web applications?


context: I mostly do rails development along with webpacker. Webpacker puts a package.json at the root of the project.

I was wondering what suggestions people might have for adding aws-cdk into a basic rails application (or any type of web application framework) to make a nice deployment pipeline?

This I've thought about for directory structure:

I tend to over think things way too much...

Am I over complicating this or is a "fullstack engineer" really hard work sometimes? 😅


Solution

  • If you are interested in combining your Infrastructure as Code with your application's deployment strategy you should look into cdk-pipelines. This way, you would just run cdk deploy and all of the build commands would be seperate from the deployment and run as part of the CI/CD build project. I work in .NET but this is how I've structured the folders:

    my-repo
        my-cool-project
            src
               MyApi
               MyWebApp
            cdk
               cdk.json
               ...
    

    Dockerfiles live in 'MyApi', and 'MyWebApp'.