Cloud Provider
Presets
Resource Type
EC2 Instance Configuration
aws_instance
Generate production-ready Terraform/HCL code for AWS, GCP, and Azure β pick a provider, choose a resource, configure options, and export ready-to-use .tf files.
aws_instance
Terraform is an infrastructure-as-code tool that lets you declare cloud resources in HCL (HashiCorp Configuration Language) files instead of clicking through consoles. You describe the end state β an EC2 instance, a VPC, a storage bucket β and Terraform computes the API calls needed to get there. Because infrastructure lives in plain text, you can version it in git, review it in pull requests, and reproduce an entire environment from scratch.
Pick a provider β AWS, GCP, or Azure β then a resource type: EC2, S3, RDS, or VPC on AWS; Compute Engine, Cloud Storage, Cloud SQL, or VPC on GCP; Resource Group, VM, Storage Account, or App Service on Azure. Fill in the form fields and the tool emits complete HCL, including the provider block, variables, and useful outputs. Copy the code or download it as main.tf β everything is generated in your browser, no cloud credentials required or sent anywhere.
Save the snippet as main.tf in an empty directory, then run terraform init to download the provider plugin, terraform fmt to normalize formatting, and terraform validate to catch syntax errors. terraform plan shows exactly what would be created without touching anything β always read the plan before terraform apply. Treat generated code as a reviewed starting point: adjust regions, instance sizes, and tags to match your environment before applying.
No. The state file records every attribute of every managed resource β including database passwords, private IPs, and access keys β in plain JSON, so committing it leaks secrets to anyone with repo access. It also invites corruption when two people apply at once. Use a remote backend instead: an S3 bucket with DynamoDB locking, a GCS bucket, or Terraform Cloud. Add terraform.tfstate and .terraform/ to .gitignore on day one.
Error acquiring the state lock usually means a crashed run left a stale lock β inspect and use terraform force-unlock only when you are sure no apply is running. A resource already exists error means it was created outside Terraform; bring it under management with terraform import rather than deleting it. Unpinned provider versions cause builds that worked yesterday to break today, so set required_providers with a version constraint. And drift from console edits shows up as surprise changes in the next plan.
Console changes are invisible: nobody reviews them, nobody can reproduce them, and six months later nobody remembers why that security group rule exists. With Terraform every change is a diff a teammate can approve, and terraform plan acts as a dry run before anything is touched. It is also multi-cloud β the same workflow and language manage AWS, GCP, and Azure β unlike CloudFormation or ARM templates, which lock you to a single vendor.
It is valid, idiomatic HCL that passes terraform validate, but production hardening is on you. Review defaults before applying: prefer private S3 ACLs with encryption and versioning enabled, restrict security groups instead of allowing 0.0.0.0/0, enable Multi-AZ and sensible backup retention for databases, and never hardcode secrets β pass them as sensitive variables or pull them from a secrets manager. The generator includes tags fields; use them, because untagged resources are how surprise cloud bills happen.