Skip to content

Commit 4e8165a

Browse files
author
Vache, Aurelie
committed
fix: typos and add some informations
1 parent e81317f commit 4e8165a

File tree

4 files changed

+41
-15
lines changed

4 files changed

+41
-15
lines changed

template/assets/terraform.png

8.87 KB
Loading

terraform-cheat-sheet.adoc

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ destroy and import will not work. The command terraform init will install :
6969

7070
`$ terraform init -backend-config=cfg/s3.dev.tf -reconfigure`
7171

72-
`-reconfigure` is used in order to tell terraform to nt copy the existing state to the new remote state location.
72+
`-reconfigure` is used in order to tell terraform to not copy the existing state to the new remote state location.
7373

7474
=== Get
7575

@@ -151,6 +151,8 @@ $ terraform destroy -target aws_s3_bucket.my_bucket
151151

152152
=== Debug
153153

154+
The Terraform console command is useful for testing interpolations before using them in configurations. Terraform console will read configured state even if it is remote.
155+
154156
....
155157
$ echo "aws_iam_user.notif.arn" | terraform console
156158
arn:aws:iam::123456789:user/notif
@@ -162,6 +164,14 @@ arn:aws:iam::123456789:user/notif
162164

163165
Visual dependency graph of terraform resources.
164166

167+
=== Validate
168+
169+
Validate command is used to validate/check the syntax of the Terraform files. A syntax check is done on all the terraform files in the directory, and will display an error if any of the files doesn't validate. The syntax check does not cover every syntax common issues.
170+
171+
....
172+
$ terraform validate
173+
....
174+
165175
== State
166176

167177
=== How to tell to Terraform you moved a ressource in a module?
@@ -208,13 +218,20 @@ $ terraform workspace list
208218
prelive
209219
....
210220

221+
=== Show current workspace
222+
223+
....
224+
$ terraform workspace show
225+
dev
226+
....
227+
211228
== Tools
212229

213230
=== jq
214231

215232
jq is a lightweight command-line JSON processor. Combined with terraform output it can be powerful.
216233

217-
==== Installaton
234+
==== Installation
218235

219236
For Linux:
220237

@@ -312,12 +329,7 @@ Usage
312329
$ terraforming --help
313330
Commands:
314331
terraforming alb # ALB
315-
terraforming asg # AutoScaling Group
316-
terraforming cwa # CloudWatch Alarm
317-
terraforming dbpg # Database Parameter Group
318332
...
319-
terraforming snst # SNS Topic
320-
terraforming sqs # SQS
321333
terraforming vgw # VPN Gateway
322334
terraforming vpc # VPC
323335
....

terraform-cheat-sheet.pdf

386 Bytes
Binary file not shown.

terraform-cheat-sheet_temp.html

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h3 id="_init_terraform_and_don_t_ask_any_input">Init Terraform and don’t ask
9090
<div class="sect2">
9191
<h3 id="_change_backend_configuration_during_the_init">Change backend configuration during the init</h3>
9292
<p class=""><code>$ terraform init -backend-config=cfg/s3.dev.tf -reconfigure</code></p>
93-
<p class=""><code>-reconfigure</code> is used in order to tell terraform to nt copy the existing state to the new remote state location.</p>
93+
<p class=""><code>-reconfigure</code> is used in order to tell terraform to not copy the existing state to the new remote state location.</p>
9494
</div>
9595
<div class="sect2">
9696
<h3 id="_get">Get</h3>
@@ -163,6 +163,7 @@ <h3 id="_destroy">Destroy</h3>
163163
</div>
164164
<div class="sect2">
165165
<h3 id="_debug">Debug</h3>
166+
<p class="">The Terraform console command is useful for testing interpolations before using them in configurations. Terraform console will read configured state even if it is remote.</p>
166167
<div class="literalblock">
167168
<div class="content">
168169
<pre>$ echo "aws_iam_user.notif.arn" | terraform console
@@ -175,6 +176,15 @@ <h3 id="_graph">Graph</h3>
175176
<p class=""><code>$ terraform graph | dot –Tpng &gt; graph.png</code></p>
176177
<p class="">Visual dependency graph of terraform resources.</p>
177178
</div>
179+
<div class="sect2">
180+
<h3 id="_validate">Validate</h3>
181+
<p class="">Validate command is used to validate/check the syntax of the Terraform files. A syntax check is done on all the terraform files in the directory, and will display an error if any of the files doesn&#8217;t validate. The syntax check does not cover every syntax common issues.</p>
182+
<div class="literalblock">
183+
<div class="content">
184+
<pre>$ terraform validate</pre>
185+
</div>
186+
</div>
187+
</div>
178188
</div>
179189
</div>
180190
<div class="sect1">
@@ -228,6 +238,15 @@ <h3 id="_list_workspaces">List workspaces</h3>
228238
</div>
229239
</div>
230240
</div>
241+
<div class="sect2">
242+
<h3 id="_show_current_workspace">Show current workspace</h3>
243+
<div class="literalblock">
244+
<div class="content">
245+
<pre>$ terraform workspace show
246+
dev</pre>
247+
</div>
248+
</div>
249+
</div>
231250
</div>
232251
</div>
233252
<div class="sect1">
@@ -237,7 +256,7 @@ <h2 id="_tools">Tools</h2>
237256
<h3 id="_jq">jq</h3>
238257
<p class="">jq is a lightweight command-line JSON processor. Combined with terraform output it can be powerful.</p>
239258
<div class="sect3">
240-
<h4 id="_installaton">Installaton</h4>
259+
<h4 id="_installation_2">Installation</h4>
241260
<p class="">For Linux:</p>
242261
<p class=""><code>$ sudo apt-get install jq</code></p>
243262
<p class="">or</p>
@@ -288,7 +307,7 @@ <h3 id="_terraforming">Terraforming</h3>
288307
S3 buckets, SNS, VPC … You can use terraforming tool, a tool written in Ruby,
289308
which extract existing AWS resources and convert it to Terraform files!</p>
290309
<div class="sect3">
291-
<h4 id="_installation_2">Installation</h4>
310+
<h4 id="_installation_3">Installation</h4>
292311
<p class=""><code>$ sudo apt install ruby</code>
293312
or
294313
<code>$ sudo yum install ruby</code></p>
@@ -331,12 +350,7 @@ <h4 id="_usage_3">Usage</h4>
331350
<pre>$ terraforming --help
332351
Commands:
333352
terraforming alb # ALB
334-
terraforming asg # AutoScaling Group
335-
terraforming cwa # CloudWatch Alarm
336-
terraforming dbpg # Database Parameter Group
337353
...
338-
terraforming snst # SNS Topic
339-
terraforming sqs # SQS
340354
terraforming vgw # VPN Gateway
341355
terraforming vpc # VPC</pre>
342356
</div>

0 commit comments

Comments
 (0)