Skip to content

Commit 04ed710

Browse files
author
Vache, Aurelie
committed
choe: separate in two different cheat sheets
1 parent 070ad80 commit 04ed710

6 files changed

+174
-81
lines changed

terraform-cheat-sheet.adoc

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,38 @@ Validate command is used to validate/check the syntax of the Terraform files. A
172172
$ terraform validate
173173
....
174174

175+
=== Providers
176+
177+
You can use a lot of providers/plugins in your terraform definition resources, so it can be useful to have a tree of providers used by modules in your project.
178+
179+
....
180+
$ terraform providers
181+
.
182+
├── provider.aws ~> 1.24.0
183+
├── module.my_module
184+
│   ├── provider.aws (inherited)
185+
│   ├── provider.null
186+
│   └── provider.template
187+
└── module.elastic
188+
└── provider.aws (inherited)
189+
....
190+
175191
== State
176192

193+
=== Pull remote state in a local copy
194+
195+
....
196+
$ terraform state pull > terraform.tfstate
197+
....
198+
199+
=== Push state in remote backend storage
200+
201+
....
202+
$ terraform state push
203+
....
204+
205+
This command is usefull if for example you riginally use a local tf state and then you define a backend storage, in S3 or Consul...
206+
177207
=== How to tell to Terraform you moved a ressource in a module?
178208

179209
If you moved an existing resource in a module, you need to update the state:
@@ -338,44 +368,4 @@ Example:
338368
`$ terraforming s3 > aws_s3.tf`
339369

340370
Remarks: As you can see, terraforming can’t extract for the moment API gateway
341-
resources so you need to write it manually.
342-
343-
== Known issues
344-
345-
=== Signature expired: xxxx is now earlier than xxx
346-
347-
If, suddently, you obtain an error message `Signature expired: xxx is now
348-
earlier than xxx'`, like this:
349-
350-
Don’t worry it’s not an issue in the AWS account/user/credentials in terraform files
351-
352-
BUT it’s an issue in your local machine date and time!
353-
354-
So the solution is, simply: update your date and time to the good time ;-).
355-
356-
=== AWS was not able to validate the provided access credentials
357-
358-
If, suddently, you obtain an error message _AWS was not able to validate the provided access credentials_, like this:
359-
360-
....
361-
* data.aws_vpc.vpc-titi: data.aws_vpc.vpc-titi:
362-
AuthFailure: AWS was not able to validate the provided access credentials
363-
status code: 401, request id: 9fbd5beb-e065-4933-ba67-2ceae9104c4c
364-
....
365-
366-
No worries, it’s the same issue as above: your local/VM machine date and time is
367-
not uptodate ;-).
368-
369-
=== Error configuring the backend s3: RequestError: send request failed
370-
371-
Again, you changed nothing but suddently you obtain a strange error message:
372-
373-
....
374-
Initializing the backend...
375-
376-
Error configuring the backend "s3": RequestError: send request failed
377-
caused by: Post https://sts.amazonaws.com/: Parent proxy unreacheable
378-
...
379-
....
380-
381-
It caused in reality by a proxy or a temporary issue between your network connectivity and AWS.
371+
resources so you need to write it manually.

terraform-cheat-sheet.pdf

-1016 Bytes
Binary file not shown.

terraform-cheat-sheet_temp.html

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,46 @@ <h3 id="_validate">Validate</h3>
185185
</div>
186186
</div>
187187
</div>
188+
<div class="sect2">
189+
<h3 id="_providers">Providers</h3>
190+
<p class="">You can use a lot of providers/plugins in your terraform definition resources, so it can be useful to have a tree of providers used by modules in your project.</p>
191+
<div class="literalblock">
192+
<div class="content">
193+
<pre>$ terraform providers
194+
.
195+
├── provider.aws ~&gt; 1.24.0
196+
├── module.my_module
197+
│   ├── provider.aws (inherited)
198+
│   ├── provider.null
199+
│   └── provider.template
200+
└── module.elastic
201+
└── provider.aws (inherited)</pre>
202+
</div>
203+
</div>
204+
</div>
188205
</div>
189206
</div>
190207
<div class="sect1">
191208
<h2 id="_state">State</h2>
192209
<div class="sectionbody">
193210
<div class="sect2">
211+
<h3 id="_pull_remote_state_in_a_local_copy">Pull remote state in a local copy</h3>
212+
<div class="literalblock">
213+
<div class="content">
214+
<pre>$ terraform state pull &gt; terraform.tfstate</pre>
215+
</div>
216+
</div>
217+
</div>
218+
<div class="sect2">
219+
<h3 id="_push_state_in_remote_backend_storage">Push state in remote backend storage</h3>
220+
<div class="literalblock">
221+
<div class="content">
222+
<pre>$ terraform state push</pre>
223+
</div>
224+
</div>
225+
<p class="">This command is usefull if for example you riginally use a local tf state and then you define a backend storage, in S3 or Consul&#8230;&#8203;</p>
226+
</div>
227+
<div class="sect2">
194228
<h3 id="_how_to_tell_to_terraform_you_moved_a_ressource_in_a_module">How to tell to Terraform you moved a ressource in a module?</h3>
195229
<p class="">If you moved an existing resource in a module, you need to update the state:</p>
196230
<div class="literalblock">
@@ -362,46 +396,6 @@ <h4 id="_usage_3">Usage</h4>
362396
</div>
363397
</div>
364398
</div>
365-
<div class="sect1">
366-
<h2 id="_known_issues">Known issues</h2>
367-
<div class="sectionbody">
368-
<div class="sect2">
369-
<h3 id="_signature_expired_xxxx_is_now_earlier_than_xxx">Signature expired: xxxx is now earlier than xxx</h3>
370-
<p class="">If, suddently, you obtain an error message <code>Signature expired: xxx is now
371-
earlier than xxx'</code>, like this:</p>
372-
<p class="">Don’t worry it’s not an issue in the AWS account/user/credentials in terraform files</p>
373-
<p class="">BUT it’s an issue in your local machine date and time!</p>
374-
<p class="">So the solution is, simply: update your date and time to the good time ;-).</p>
375-
</div>
376-
<div class="sect2">
377-
<h3 id="_aws_was_not_able_to_validate_the_provided_access_credentials">AWS was not able to validate the provided access credentials</h3>
378-
<p class="">If, suddently, you obtain an error message <em>AWS was not able to validate the provided access credentials</em>, like this:</p>
379-
<div class="literalblock">
380-
<div class="content">
381-
<pre>* data.aws_vpc.vpc-titi: data.aws_vpc.vpc-titi:
382-
AuthFailure: AWS was not able to validate the provided access credentials
383-
status code: 401, request id: 9fbd5beb-e065-4933-ba67-2ceae9104c4c</pre>
384-
</div>
385-
</div>
386-
<p class="">No worries, it’s the same issue as above: your local/VM machine date and time is
387-
not uptodate ;-).</p>
388-
</div>
389-
<div class="sect2">
390-
<h3 id="_error_configuring_the_backend_s3_requesterror_send_request_failed">Error configuring the backend s3: RequestError: send request failed</h3>
391-
<p class="">Again, you changed nothing but suddently you obtain a strange error message:</p>
392-
<div class="literalblock">
393-
<div class="content">
394-
<pre>Initializing the backend...
395-
396-
Error configuring the backend "s3": RequestError: send request failed
397-
caused by: Post https://sts.amazonaws.com/: Parent proxy unreacheable
398-
...</pre>
399-
</div>
400-
</div>
401-
<p class="">It caused in reality by a proxy or a temporary issue between your network connectivity and AWS.</p>
402-
</div>
403-
</div>
404-
</div>
405399
<div class="sect1 authors">
406400
<h3>Authors :</h3>
407401
<div class="author">
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
= Terraform known issues Cheat Sheet
2+
Aurélie Vache <https://twitter.com/aurelievache>
3+
:author: Aurélie Vache
4+
:authorbio: Cloud Dev(Ops) at Continental
5+
:pdf-width: 508mm
6+
:pdf-height: 361mm
7+
:version: v1.0.0
8+
9+
== Signature expired: xxxx is now earlier than xxx
10+
11+
If, suddently, you obtain an error message `Signature expired: xxx is now
12+
earlier than xxx'`, like this:
13+
14+
Don’t worry it’s not an issue in the AWS account/user/credentials in terraform files
15+
16+
BUT it’s an issue in your local machine date and time!
17+
18+
So the solution is, simply: update your date and time to the good time ;-).
19+
20+
== AWS was not able to validate the provided access credentials
21+
22+
If, suddently, you obtain an error message _AWS was not able to validate the provided access credentials_, like this:
23+
24+
....
25+
* data.aws_vpc.vpc-titi: data.aws_vpc.vpc-titi:
26+
AuthFailure: AWS was not able to validate the provided access credentials
27+
status code: 401, request id: 9fbd5beb-e065-4933-ba67-2ceae9104c4c
28+
....
29+
30+
No worries, it’s the same issue as above: your local/VM machine date and time is
31+
not uptodate ;-).
32+
33+
== Error configuring the backend s3: RequestError: send request failed
34+
35+
Again, you changed nothing but suddently you obtain a strange error message:
36+
37+
....
38+
Initializing the backend...
39+
40+
Error configuring the backend "s3": RequestError: send request failed
41+
caused by: Post https://sts.amazonaws.com/: Parent proxy unreacheable
42+
...
43+
....
44+
45+
It caused in reality by a proxy or a temporary issue between your network connectivity and AWS.
74.9 KB
Binary file not shown.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link href="./template/assets/style.css" rel="stylesheet">
6+
</head>
7+
<body>
8+
<header>
9+
<h1>Terraform known issues Cheat Sheet</h1>
10+
</header>
11+
<section class="content">
12+
<div class="sect1">
13+
<h2 id="_signature_expired_xxxx_is_now_earlier_than_xxx">Signature expired: xxxx is now earlier than xxx</h2>
14+
<div class="sectionbody">
15+
<p class="">If, suddently, you obtain an error message <code>Signature expired: xxx is now
16+
earlier than xxx'</code>, like this:</p>
17+
<p class="">Don’t worry it’s not an issue in the AWS account/user/credentials in terraform files</p>
18+
<p class="">BUT it’s an issue in your local machine date and time!</p>
19+
<p class="">So the solution is, simply: update your date and time to the good time ;-).</p>
20+
</div>
21+
</div>
22+
<div class="sect1">
23+
<h2 id="_aws_was_not_able_to_validate_the_provided_access_credentials">AWS was not able to validate the provided access credentials</h2>
24+
<div class="sectionbody">
25+
<p class="">If, suddently, you obtain an error message <em>AWS was not able to validate the provided access credentials</em>, like this:</p>
26+
<div class="literalblock">
27+
<div class="content">
28+
<pre>* data.aws_vpc.vpc-titi: data.aws_vpc.vpc-titi:
29+
AuthFailure: AWS was not able to validate the provided access credentials
30+
status code: 401, request id: 9fbd5beb-e065-4933-ba67-2ceae9104c4c</pre>
31+
</div>
32+
</div>
33+
<p class="">No worries, it’s the same issue as above: your local/VM machine date and time is
34+
not uptodate ;-).</p>
35+
</div>
36+
</div>
37+
<div class="sect1">
38+
<h2 id="_error_configuring_the_backend_s3_requesterror_send_request_failed">Error configuring the backend s3: RequestError: send request failed</h2>
39+
<div class="sectionbody">
40+
<p class="">Again, you changed nothing but suddently you obtain a strange error message:</p>
41+
<div class="literalblock">
42+
<div class="content">
43+
<pre>Initializing the backend...
44+
45+
Error configuring the backend "s3": RequestError: send request failed
46+
caused by: Post https://sts.amazonaws.com/: Parent proxy unreacheable
47+
...</pre>
48+
</div>
49+
</div>
50+
<p class="">It caused in reality by a proxy or a temporary issue between your network connectivity and AWS.</p>
51+
</div>
52+
</div>
53+
<div class="sect1 authors">
54+
<h3>Authors :</h3>
55+
<div class="author">
56+
<div class="author-avatar"><img src="http://avatars.io/twitter/aurelievache"/></div>
57+
<div class="author-name"><a href="https://twitter.com/aurelievache">@aurelievache</a></div>
58+
<div class="author-bio">Cloud Dev(Ops) at Continental</div>
59+
</div>
60+
61+
<div class="author-bio">v1.0.0</div>
62+
</div>
63+
</section>
64+
</body>

0 commit comments

Comments
 (0)