Resposta de referência
I've used IaC extensively, primarily with Terraform and AWS CloudFormation, across several projects to manage and provision cloud resources efficiently. My most significant experience involved building a multi-region, highly available application environment on AWS using Terraform. We had a core application that needed to run identically in production and staging, and also required disaster recovery capabilities. I defined all components—VPCs, subnets, EC2 instances, RDS databases, S3 buckets, load balancers, security groups, and IAM roles—as Terraform configurations. This allowed us to spin up entire environments consistently and repeatedly. For example, for a new application deployment, I'd create a main.tf
file that declared the AWS provider and then modularize the infrastructure into separate modules like vpc.tf
, compute.tf
, and database.tf
. This approach kept the configuration organized and reusable.
We integrated Terraform with our CI/CD pipelines using GitLab CI. Whenever a change was merged into the main branch, a terraform plan
would run automatically, showing us exactly what changes would occur before terraform apply
was executed manually by an approved engineer. This prevented unexpected modifications and ensured everyone understood the impact. One time, we needed to update the instance types for a fleet of worker nodes. Instead of manually modifying each instance, I adjusted a single variable in the Terraform configuration. Running terraform plan
showed the exact instances that would be replaced or modified, and after approval, terraform apply
updated the infrastructure with minimal downtime. It drastically reduced the risk of configuration drift between environments.
Before Terraform, I worked with AWS CloudFormation to manage a smaller set of resources for a legacy application. We had templates for creating S3 buckets, Lambda functions, and API Gateway endpoints. While CloudFormation is powerful, I found Terraform's multi-cloud capabilities and state management more flexible for our growing needs. With Terraform, I've also managed resources in Azure for a hybrid cloud setup, specifically setting up virtual networks and VPN connections to on-premises data centers. The consistent workflow across different providers using the same tool saved us a lot of time and effort in training and operational overhead. I'm comfortable writing custom modules, managing state files in S3 with DynamoDB locking, and using workspaces to isolate environments. It's been crucial for maintaining order and speed in our infrastructure deployments.