{"id":25032056,"url":"https://github.com/chintanboghara/aws-infrastructure-using-terraform","last_synced_at":"2025-03-30T20:17:08.832Z","repository":{"id":267453570,"uuid":"901298926","full_name":"chintanboghara/AWS-infrastructure-using-Terraform","owner":"chintanboghara","description":"Build, change, and destroy AWS infrastructure using Terraform.","archived":false,"fork":false,"pushed_at":"2025-01-25T05:34:33.000Z","size":57,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T06:21:10.013Z","etag":null,"topics":["aws","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chintanboghara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-10T12:04:06.000Z","updated_at":"2025-01-25T05:34:36.000Z","dependencies_parsed_at":"2025-01-25T06:32:07.052Z","dependency_job_id":null,"html_url":"https://github.com/chintanboghara/AWS-infrastructure-using-Terraform","commit_stats":null,"previous_names":["chintanboghara/iac-terraform","chintanboghara/terraform","chintanboghara/aws-infrastructure-using-terraform"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FAWS-infrastructure-using-Terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FAWS-infrastructure-using-Terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FAWS-infrastructure-using-Terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FAWS-infrastructure-using-Terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chintanboghara","download_url":"https://codeload.github.com/chintanboghara/AWS-infrastructure-using-Terraform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237387409,"owners_count":19301900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","terraform"],"created_at":"2025-02-05T22:56:56.544Z","updated_at":"2025-02-05T22:56:57.257Z","avatar_url":"https://github.com/chintanboghara.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Core Commands\n\n- `terraform init`: Initializes a working directory containing Terraform configuration files. Downloads required providers and configures the backend.  \n  ```bash\n  terraform init\n  ```\n\n- `terraform plan`: Generates an execution plan showing proposed infrastructure changes.  \n  ```bash\n  terraform plan\n  ```\n\n- `terraform apply`: Applies changes to reach the desired infrastructure state. Use `-auto-approve` to skip confirmation.  \n  ```bash\n  terraform apply  # Interactive mode\n  terraform apply -auto-approve  # Skip prompt\n  ```\n\n- `terraform destroy`: Destroys all managed infrastructure. Use with caution!  \n  ```bash\n  terraform destroy  # Interactive mode\n  terraform destroy -auto-approve  # Skip prompt\n  ```\n\n- `terraform validate`: Checks configuration files for syntax and consistency.  \n  ```bash\n  terraform validate\n  ```\n\n- `terraform fmt`: Rewrites configuration files to a standardized format.  \n  ```bash\n  terraform fmt\n  ```\n\n- `terraform show`: Displays the current state or a saved plan in readable format.  \n  ```bash\n  terraform show\n  ```\n\n- `terraform output`: Prints output values from the state file.  \n  ```bash\n  terraform output\n  ```\n\n- `terraform refresh`: Syncs the state file with real-world infrastructure (rarely used directly).  \n  ```bash\n  terraform refresh\n  ```\n\n## State Management Commands\n\n- `terraform state list`: Lists resources tracked in the state.  \n  ```bash\n  terraform state list\n  ```\n\n- `terraform state show \u003cresource\u003e`: Displays details of a specific resource. Replace `\u003cresource\u003e` with the resource address.  \n  ```bash\n  terraform state show aws_instance.web\n  ```\n\n- `terraform state pull`: Outputs the raw state data.  \n  ```bash\n  terraform state pull \u003e state.json\n  ```\n\n- `terraform state push`: Overwrites remote state with a local state file (**use with caution**).  \n  ```bash\n  terraform state push terraform.tfstate\n  ```\n\n- `terraform state mv`: Moves a resource within the state (useful for refactoring).  \n  ```bash\n  terraform state mv aws_instance.old aws_instance.new\n  ```\n\n- `terraform state rm`: Removes a resource from the state (does not destroy the resource).  \n  ```bash\n  terraform state rm aws_instance.web\n  ```\n\n- `terraform import \u003cresource\u003e \u003cid\u003e`: Imports existing infrastructure into the state.  \n  ```bash\n  terraform import aws_instance.web i-1234567890abcdef0\n  ```\n\n## Workspace Commands\n\n- `terraform workspace new \u003cname\u003e`: Creates a new workspace.  \n  ```bash\n  terraform workspace new dev\n  ```\n\n- `terraform workspace select \u003cname\u003e`: Switches to a workspace.  \n  ```bash\n  terraform workspace select prod\n  ```\n\n- `terraform workspace list`: Lists all workspaces.  \n  ```bash\n  terraform workspace list\n  ```\n\n- `terraform workspace delete \u003cname\u003e`: Deletes a workspace.  \n  ```bash\n  terraform workspace delete staging\n  ```\n\n## Utility Commands\n\n- `terraform version`: Shows Terraform and provider versions.  \n  ```bash\n  terraform version\n  ```\n\n- `terraform get`: Downloads and updates modules.  \n  ```bash\n  terraform get\n  ```\n\n- `terraform graph`: Generates a visual dependency graph.  \n  ```bash\n  terraform graph | dot -Tsvg \u003e graph.svg\n  ```\n\n- `terraform taint \u003cresource\u003e`: Forces recreation of a resource on the next apply.  \n  ```bash\n  terraform taint aws_instance.web\n  ```\n\n- `terraform untaint \u003cresource\u003e`: Removes taint from a resource.  \n  ```bash\n  terraform untaint aws_instance.web\n  ```\n\n## Advanced Commands\n\n- `terraform force-unlock \u003clock-id\u003e`: Manually releases a stuck state lock.  \n  ```bash\n  terraform force-unlock 3a0d98d0-0d1a-2345-6789-abc123def456\n  ```\n\n- `terraform console`: Launches an interactive console for testing expressions.  \n  ```bash\n  terraform console\n  ```\n\n- `terraform providers`: Displays provider configurations.  \n  ```bash\n  terraform providers\n  ```\n\n- `terraform state replace-provider`: Updates the provider in the state file.  \n  ```bash\n  terraform state replace-provider hashicorp/aws registry.acme.corp/acme/aws\n  ```\n\n## Environment Variables\n\n- `TF_LOG`: Sets logging verbosity (e.g., `TRACE`, `DEBUG`, `INFO`).  \n  ```bash\n  export TF_LOG=DEBUG\n  ```\n\n- `TF_VAR_\u003cvariable_name\u003e`: Sets a Terraform variable via the environment.  \n  ```bash\n  export TF_VAR_region=\"us-west-2\"\n  ```\n\n- `TF_CLI_ARGS`: Passes global CLI arguments.  \n  ```bash\n  export TF_CLI_ARGS=\"-input=false\"\n  ```\n\n- `TF_IN_AUTOMATION`: Suppresses prompts in CI/CD environments.  \n  ```bash\n  export TF_IN_AUTOMATION=true\n  ```\n\n\u003e **Note**: Always review Terraform plans carefully before applying changes. Use destructive commands like `destroy` and `state push` with caution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchintanboghara%2Faws-infrastructure-using-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchintanboghara%2Faws-infrastructure-using-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchintanboghara%2Faws-infrastructure-using-terraform/lists"}