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:
.infrastructure
folder to the root of the project. This is where all my cdk code would reside. What I don't like about this is during the deploy pipeline I would need to cd
into that directoy and run yarn install
. Also wouldn't like how I'd have to prefix all my paths with ../
if I need to reference resources outside of the directory (e.g. Dockerfile)cdk.json
to the root of my project. This would solve the path prefix problem but I'd still need todo something along these lines cd .infrastructure && yarn install && cd .. && cdk deploy
lerna
or yarn workspaces
? Not sure how much I'd need to configure to webpacker to with those tools.I tend to over think things way too much...
Am I over complicating this or is a "fullstack engineer" really hard work sometimes? 😅
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'.