Just recently, Gartner included Infrastructure from Code on the Hype Cycle for Platform Engineering, 2024. A new entrant to the Hype Cycle, Infrastructure from Code offers organizations a way to deploy applications to the cloud more easily with Infrastructure as Code (IaC) automation.
Infrastructure from Code puts the application at the center of infrastructure provisioning. By analyzing what has already been coded in the application, it can auto-generate IaC developers require with the security, compliance and well-architected frameworks DevOps teams require. Development teams’ velocity increases while security and reliability are enforced.
So, want to see how it works? In this blog, we’ll give you an overview of how to demo StackGen, a provider of Infrastructure from Code. In just a few steps and less than five minutes, you can get a real feel for how StackGen can be your IaC cheatsheet!
Watch Cesar Rodriguez’s five minute demo of Infrastructure from Code for Lambda Based Applications
Step 1: Login to StackGen
You can login in to StackGen by visiting cloud.stackgen.com with your GitHub, Gitlab, Google or Bitbucket account.
![appCD login screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXcspGSanVEC6Eqqj1MxIrWt8dkM4widAXPsqV4lIBATmCJ-3OFEdB06T3inrRRpmFE6CwZ3q0gBp9itgvQTYjOABrHk5ABsluxfx8lIklF91twRoeMr-doGsLA3nIwymUnGMXSfoqR3BvjuzDJGfKgTWotc?key=zOBLSVNIcaaAbaHaNyCa8Q)
Step 2: Get to the demo repo
Once in, you’ll be welcomed to the StackGen developer edition. The developer edition is a SaaS-based version where you can connect your repos, view your deployment architecture, select AWS policies and compliance standards, and generate your IaC. And it is free to use!
![appCD Welcome Screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXdg1AG4OeHbgOiGyD_t_p7uvGh8DqmS8orbWcBCNjz-TJQxX2RLMU_-Plz8Lk1XlsnQdPxK8SWU4BgGBwNDOqWY600XupF2p_eEv8RsmSLtelxyT1zkn3FlRog0Zg4Sr4rqOUfsqeNg1xXmMZX-DSzp2Q1d?key=zOBLSVNIcaaAbaHaNyCa8Q)
We ask you three short questions. If you don’t want to answer, you can easily skip.
Next, you’ll have several options to generate your first IaC. You can do so from your own repositories or you can select Generate from StackGen Demo Repositories.
![Demo screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXfgkr3LZctOHX-jMJbQLlFrEG_dLP0CwEZwoJ-RRi16C8vmstwFjN6aOf7z-9mWH5p0OMl3l0Ao0v8cfkemdojanpQeWCBEMCLtutcgdaom_qfkBmUPk4W390EcTaxmLrTK_9RRYHb701rsJ-WzvPV_CdQ?key=zOBLSVNIcaaAbaHaNyCa8Q)
We provide four different demo repositories for you to try. For this blog, we’ll select retroboard (RetroBoard is a free tool for running team retrospectives) and hit proceed:
![Select retroboard demo screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXcz8y4O4wlG7D_6u0wdG6Lhev1Re7kWINukOJbvrahn1sf4MhsR2Jhn95wpDRccrVTQCsdgbwJ7eDL1aBfGgTzwyzw4oo12Jj_m9XWM5ypQCcjPoekRFelmD_NjvYMY3P9zeNY0qy7To-8VmRTjUIuz3KEu?key=zOBLSVNIcaaAbaHaNyCa8Q)
Step 3: Make choices
Next you’ll be presented with a view where you can configure selected repos, choose branches, languages and container images (if any). For this demo, the language is Python, we are using the main branch and have auto-generated additional information. When reviewed, hit proceed.
(Note: screenshot has more information available in the demo)
In this step, you’ll select what cloud provider you want to use AWS EKS, ECS or Lambda or Azure AKS. Your Target IaC will autopopulate to include Terraform and/or Helm. For this, we will select Lambda. On the right, you’ll see a summary of your repos, cloud services, target IaC and all the policies that are recommended.
![](https://lh7-us.googleusercontent.com/docsz/AD_4nXesDuIDUgc8UgnMGkPlPaxgXk5zaYS695xUe_RZJ3Jxlj49YAh7Bpd2UcaypMz2FGfwdA1GKjcBsvcZ9YDRvf_yUrWInhynDoQsmVgPAtFWh-DcJ1pvlJB_Px7W56i9MwMlze74DErmAGN2RmS-_pOpIk0?key=zOBLSVNIcaaAbaHaNyCa8Q)
You can click into the recommended policies for a list of what is selected. In the demo, you can turn on or off selected policies. If using within an organization, these can be selected by the DevOps, platform engineering or security teams so that developers do not have to consider what is required.
![Policy selection screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXeyVgnGh6z7yhsqUnURMQXe_yWRV7lYxmUqhGVHLIY_2Ki5ypQDt7iMbJaYnFtwHyR_Q5bBd3O42ibNGaUQWU3iET9kYYrtiKUb9Qp63ax7p012mgThkemTYOm6AhJYxVF73eGzPiV6lld7iYmkc2wxQNU?key=zOBLSVNIcaaAbaHaNyCa8Q)
Next you’ll name your appStack and can add an optional description. Once done, hit create.
![name your appstack screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXcjtvCYuVaVURRc057AmzSot5vQKmeiVkRBUi4E3eCm9AfPO1DzanmMqdi8vvoq5iKDGhICg--O2QkqSD3sFw85Dci1fFMKGce1goubei5aq08leKC_TNfT-QlbfYJTZRxY3zY13t19g4vAZCWXcgOqKd3P?key=zOBLSVNIcaaAbaHaNyCa8Q)
Step 4: Static-Code Analysis, Topology View and IaC Generation
StackGen performs a static-code analysis of your application. Analysis will take a few moments.
![appCD analyzing code screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXeDAYXdbs12W6I9BSBxIbI3BxvPEkTCC4W3Q8bThHh5BfPbXcODeM5iYmoULfvzwCjboDwT3sYcqU7dbqdTqvYyumltSFUovr-TdUaQfj5GciNkPKa-TfsAlVkI5d5wUzE6skXYY5hIrs_ElATK3FA2Q6Gr?key=zOBLSVNIcaaAbaHaNyCa8Q)
Upon completion, a topology view is created of the deployment architecture.
![](https://lh7-us.googleusercontent.com/docsz/AD_4nXe460TmP8EtTIcpQ17arwL9wM2bD4UvzcyosBXfiXtic7JqCjYIBYLEhOqeu4u_fCU0-CaXBmx0Z4X8lEK7u4rNoqy4lM3QgwGDXOzUVPAI7wNPOGFhEiqjmd1HNE2DLR5ePpPUxtA_44IZ5jGKwkTc-_fr?key=zOBLSVNIcaaAbaHaNyCa8Q)
Here you can review any errors that might appear and complete the required information.
Users can review if required the policies applied by clicking to the policies tab.
![Policy review screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXfZGBYKQ-qBc5mQtKJZToGAjBUQfvgw-_yOBvoJ79guKHyz5LYAPJHJkLNX9ujSkvI_1aSJOZRRL42PUz_HHCwA2uZlwSNwcHuaic2d840MPwEVhO4Fgasdye9PKBb3bUWbyr76uuT_1bl_eGoVx-mEwgo?key=zOBLSVNIcaaAbaHaNyCa8Q)
By clicking to the IaC tab, you can view your IaC before exporting in the event you’d like to review.
![Terraform IaC Review screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXcgdAeFNRY2HTzJnoYn18O6IjzEFO-dlWKM_C4xOGm9N8anwE4x_Q9N-jhFtWH7FT2Upzli1ab2Pm-sAdGZ2qO2rd5uhGUxwWKRfquSuckEwZNvvFcNK9Ye1D8mYWwfq9m1wlDPO_hVRIpBmVTk6B04eUU?key=zOBLSVNIcaaAbaHaNyCa8Q)
Once the required fields are fixed and no errors appear, users can export IaC.
![Topology no violations screen](https://lh7-us.googleusercontent.com/docsz/AD_4nXflyh-bn5tdU8jULndFmhi3gLCLEL7QjL4qKiMaVYyhwaeu10BcR_J_rpzf1Fg0Ef1M0-KTnStaFRbJGVJvgdr-0f2F_oE1c1rf7gWBAkYNkRRzPi9Flc7o9hbH6HtjLUchptJ0SqTVZ7XVU_OYEy5uJXA?key=zOBLSVNIcaaAbaHaNyCa8Q)
StackGen makes IaC easy with Infrastructure from Code. Within this short demo, you can see how to easily generate IaC without having to know every configuration, component or policy required.
If you want more information on how StackGen works, get the StackGen solution overview.