You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- To install terraform, find the right package for your system from [downloads] (https://www.terraform.io/downloads.html). Select the right package, right click and copy link location
12
+
- download the package using wget or curl: wget `paste link location`
13
+
- unzip the package: unzip terraform.zip
14
+
- terraform runs as a single binary. any other files in the package can be safely removed and terraform will still function. Move the terraform binary to one of the locations like /usr/bin or /usr/local/bin and include PATH.
15
+
- mv ~/terraform /usr/local/bin/teraform
16
+
- set PATH to reflect the binary. Refer to link in step 1 for installation and setup binary
17
+
- verify the installation: terraform -h
10
18
11
-
**Usage**
19
+
2. Installing aws-iam-authenticator for [Linux] (https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html)
20
+
21
+
3. Installing python-pydot,python-pydot-ng and graphviz for graph visualization:
Use aws configure to load your api access keys to default credentials file at "~/.aws/credentials"
28
+
1.Use aws configure to load your api access keys to default credentials file at "~/.aws/credentials" with profiles dev and prod. Loading through shared credentials file is not recommended, however a good approach is to get temporary STS credentials.
15
29
16
-
Create 2 profiles dev and prod and use the same for aws credentials as well.
30
+
2. terraform variables will be defaulted to region=us-west-2 and profile=dev if not specified during the terraform plan
17
31
18
-
terraform variables will be defaulted to region=us-west-2 and profile=dev if not specified during the terraform plan
32
+
3. All the code related to eks, vpc, storage will be under modules and for each environments for dev and prod can be created under environments directory. Always run from the envirnments main directory for terraform plan, apply, destroy and pull modules for code reusability
19
33
34
+
4. Terraform flow:
20
35
21
-
terraform validate
36
+
```
37
+
1. Initialize the plugins for the provider and sync the terraform backend
38
+
- terraform init
22
39
23
-
terraform init
40
+
2. To validate the syntax for terraform config files
41
+
- terraform validate
24
42
25
-
terraform plan -out=tfplan
43
+
3. To output the terraform resource config out to an output plan file before applying changes.
44
+
- terraform plan -out=tfplan
26
45
27
-
terraform apply tfplan
46
+
4. Apply changes to the terraform plan
47
+
- terraform apply tfplan
28
48
29
-
terraform destroy -auto-approve
49
+
5. View resources.
50
+
- terraform show
51
+
52
+
6. Destroy changes to the resources or tear down the infrastructure.
53
+
- terraform destroy -auto-approve
54
+
55
+
```
30
56
31
57
32
-
**Resource graph**
58
+
##Resource graph
33
59
--------------------------------
34
60
Resource graph of the terraform plan. Use graphviz to analyze it
0 commit comments