From ab693b5d94d46e0f675be034fe771dbe1bf713dd Mon Sep 17 00:00:00 2001 From: YJ <83238190+yj1910@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:35:59 +0530 Subject: [PATCH] Update README.md --- beginners/init-plan-apply/README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/beginners/init-plan-apply/README.md b/beginners/init-plan-apply/README.md index 9ab29c6..b4a0fb3 100644 --- a/beginners/init-plan-apply/README.md +++ b/beginners/init-plan-apply/README.md @@ -1 +1,26 @@ -# Terraform Init-Plan-Apply +# Terraform init-plan-apply +Terraform Workflow: Initialization, Planning, and Application + +## 1. Terraform Init +- The `terraform init` command initializes a working directory containing Terraform configuration files. +- It's the **first step** after writing a new configuration or cloning an existing one. +- Key points: + - Prepares the working directory for Terraform use. + - Can be run multiple times without issues. + - Performs steps like backend initialization, module installation, and plugin installation. + - Safe to run even after initialization. + +## 2. Terraform Plan +- Use `terraform plan` to create an execution plan. +- It previews changes before applying them. +- Customize planning modes and options. +- Plan shows additions, modifications, and deletions of resources. +- Useful for verifying configuration and understanding impact of changes. + +## 3. Terraform Apply +- After reviewing the plan, apply it with `terraform apply`. +- Prompts for approval before taking actions. +- Creates, updates, or destroys resources based on the plan. +- Flags like `-input=false` and `-auto-approve` allow automation. + +Remember, these three commands—`init`, `plan`, and `apply`—form the core workflow for managing infrastructure with Terraform. Understanding their logic is essential for successful infrastructure management.