-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
169 lines (145 loc) · 5.34 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>terraform - the simple guide</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div class="scrollblock block-title">
<h1>terraform - the simple guide</h1>
<p>just a simple guide for getting started with terraform</p>
</div>
<div class="scrollblock block-setup">
<h2>setup</h2>
<p>
<a href="https://www.terraform.io/downloads.html">
Download Terraform</a>
</p>
</div>
<div class="scrollblock block-init">
<h2>initialize</h2>
<p>
You can initialize the working directory using<br>
<code>terraform init</code><br>
This is the first command that should be run after writing a new
Terraform configuration
</p>
</div>
<div class="scrollblock block-validate">
<h2>validate</h2>
<p>
Validate that the configuration is valid by running the command<br>
<code>terraform validate</code><br>
Requires the working directory to be initialized
</p>
</div>
<div class="scrollblock block-plan">
<h2>plan</h2>
<p>
Create an execution plan of changes that will be applied by
executing<br>
<code>terraform plan</code><br>
The existing infrastructure will not be modified
</p>
</div>
<div class="scrollblock block-apply">
<h2>apply</h2>
<p>
Deploy and apply the defined changes by running<br>
<code>terraform apply</code><br>
This will provision the resources in the data center infrastructure
</p>
</div>
<div class="scrollblock block-destroy">
<h2>destroy</h2>
<p>
To destroy all the Terraform-managed infrastructure, use<br>
<code>terrafrom destroy</code>
</p>
</div>
<div class="scrollblock block-modules">
<h2>modules</h2>
<p>
Terraform modules are files that contain blocks and the <code>.tf</code> ending<br>
</p>
</div>
<div class="scrollblock block-providers">
<h2>providers</h2>
<p>
Providers include resources that are used to define the
infrastructure that will be created<br><br>
<code>
provider "aws" { region = "us-east-1" }
</code><br><br>
<a href="https://registry.terraform.io/namespaces/hashicorp">
View all providers</a>
</p>
</div>
<div class="scrollblock block-blocks">
<h2>blocks</h2>
<p>
Blocks are used to define the configuration of an object,
like a resource<br><br>
Blocks have a <code>block type</code>, can have zero or more
<code>labels</code>, and have a body that contains any
number of <code>arguments</code> and nested blocks<br><br>
<code>
<block type> "<label>" "<label>" { <arguments> }
</code><br><br>
The ordering of blocks and the modules they are organized into are
generally not significant<br>
</p>
</div>
<div class="scrollblock block-types">
<h2>block types</h2>
<p>
Block types define the behavior of a block and how many labels
must follow the type keyword<br><br>
Some of the most common block types are <code>resource</code>,
intput <code>variable</code>, <code>output</code> varaible,
<code>data</code> source, etc<br>
</p>
</div>
<div class="scrollblock block-resources">
<h2>resources</h2>
<p>
Resouces define the infrastructure that will be created given what
arguments and other attributes the resource supports<br><br>
<code>resource "aws_instance" "webserver" { </code><br>
<code>ami = "ami-a1b2c3d4"</code><br>
<code>instance_type = var.instanceType }</code><br><br>
</p>
</div>
<div class="scrollblock block-variables">
<h2>variables</h2>
<p>
Input variables can be used as parameters<br><br>
<code>variable "instanceType" { default = "t2.micro" }</code><br>
</p>
</div>
<div class="scrollblock block-outputs">
<h2>outputs</h2>
<p>
Output variables define values that will be printed
when changes to the infrastructure are applied<br><br>
<code>output "webserver_public_ip" {</code><br>
<code>value = aws_instance.webserver.public_ip }</code><br><br>
You can also query outputs using<br><br>
<code>terraform output</code>
</p>
</div>
<div class="scrollblock block-data">
<h2>data</h2>
<p>
Data sources allow data to be fetched from outside of a Terrafrom
configuration<br><br>
<code>data "local_file" "input" {</code><br>
<code>filename = "localfile.txt" }</code><br><br>
Providers may offer data sources that allow you to fetch information
from the cloud
</p>
</div>
</body>
</html>