Reputation: 119
We have a working dev environment in azure.
The project is about hosting a frontend, a backend and a database via container apps. It is still in the beginning so there are not that many resources right now. We have a container app environment, some container apps, a vnet and a storage account among some others.
Our dev environment was created manually via the azure portal. Everything works flawless right now.
At this stage we want to create a prod environment. For this to happen we want to create a IaC repository that creates the resources as they are in the dev environment. Like changing the tag from "dev" to "prod" then all the resources get created just with a "prod" in their name insted of "dev".
I wanted to use terraform for this. I am new to the topic and terraform seemed straight forward. Since this project is quite new and there are still not that many resources online, I wanted to build it up from skretch with pure terraform components.
Since I am countering a lot of issues, I am wondering if my approach is the easiest or if there are some other best practices for that?
It basically is just copying one resource group and changing just one naming parameter. I looked into arm templates, but there I would have to rename a lot and it does not look like it is very adjustable when people are adding more and more resources via the azure portal.
Should we have directly started by setting up the environment with an iac repository instead of doing it in the azure portal?
Upvotes: 0
Views: 38
Reputation: 1773
just my 2 cents:
Q1: You can also look at bicep. I used both terraform and ARM template, personally speaking, bicep is my current preferred option at the moment. It is much easier than terraform as no state management required.
IaC itself requires work and efforts. It is pretty standard practice for cloud apps especially when there are multiple environments and the app is client facing. (not just a POC)
Q2: click-ops might be ok if you are just exploring and learning. We would eventually get into trouble when there are multiple devs in the team, or you have multiple env to manage. It is very painful to keep different envs exactly same by click-ops. Imagine what might happen if your application code is not version controlled.
Upvotes: 0