Theory:
Terraform (Laptop/System) —Plugins—> AWS (Providers)p
Terraform —> AWS Login (Access key, secret key)
Terraform —> Resource Creation EC2
.png)
Terraform Commands & Execution:-
Providers: (AWS/AZURE/GCP/IBM/ORACLE)
- A provider is responsible for understanding API interactions and exposing resources. if an API is available , you can create a provider. A provider uses a plugin. In order to make a provider available on terraform, we need to make a terraform unit, this commands download any plugins we need for our providers
Terraform Init:
- The terraform init command is used to initialize a working directory containing terraform configuration files. It is safe to run this command multiple times. This command will never delete your existing configuration or state. During init, the root configuration directory is consulted for Backend configuration and the chosen backend is initialized using the given configuration settings
Terraform Validate:
- The terraform validate command validates the configuration files in a directory, referring only to the configuration and not accessing any remote services such as remote state, provides APIs etc.
- validate runs checks that verify whether a configuration is syntactically valid and internally consistent, regardless of any provided variables or existing state. It is thus useful in general verification of reusable modules including correctness of attribute names and value types.
registry.terraform.io/aws
- TF INIT
- TF PLAN
- TF VALIDATE