Skip to content

Commit ad12a30

Browse files
author
abregman
committed
update
1 parent 21206e7 commit ad12a30

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
:information_source:  This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE
44

5-
:bar_chart:  There are currently **2610** exercises and questions
5+
:bar_chart:  There are currently **2619** exercises and questions
66

77
:warning:  You can use these for preparing for an interview but most of the questions and exercises don't represent an actual interview. Please read [FAQ page](faq.md) for more details
88

topics/terraform/README.md

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,24 @@ dynamic "tag" {
13271327

13281328
#### Misc
13291329

1330+
<details>
1331+
<summary>What are meta-arguments in Terraform?</summary><br><b>
1332+
1333+
Arguments that affect the lifecycle of a resources (its creation, modification, ...) and supported by Terraform regardless to the type of resource in which they are used.
1334+
1335+
Some examples:
1336+
1337+
* count: how many resources to create out of one definition of a resource
1338+
* lifecycle: how to treat resource creation or removal
1339+
1340+
</b></details>
1341+
1342+
<details>
1343+
<summary>What meta-arguments are you familiar with?</summary><br><b>
1344+
1345+
* count: how many resources to create out of one definition of a resource
1346+
* lifecycle: how to treat resource creation or removal
1347+
* depends_on: create a dependency between resources
13301348
</b></details>
13311349

13321350
<details>
@@ -1367,14 +1385,9 @@ False. terraform console is ready-only.
13671385
</b></details>
13681386

13691387
<details>
1370-
<summary>What are meta-arguments in Terraform?</summary><br><b>
1371-
1372-
Arguments that affect the lifecycle of a resources (its creation, modification, ...) and supported by Terraform regardless to the type of resource in which they are used.
1373-
1374-
Some examples:
1388+
<summary>Explain what <code>depends_on</code> used for and given an example</summary><br><b>
13751389

1376-
* count: how many resources to create out of one definition of a resource
1377-
* lifecycle: how to treat resource creation or removal
1390+
`depends_on` used to create a dependency between resources in Terraform. For example, there is an application you would like to deploy in a cluster. If the cluster isn't ready (and also managed by Terraform of course) then you can't deploy the app. In this case, you will define "depends_on" in the app configuration and its value will be the cluster resource.
13781391

13791392
</b></details>
13801393

@@ -1636,6 +1649,24 @@ module "some_module" {
16361649

16371650
</b></details>
16381651

1652+
<details>
1653+
<summary>How to manage multiple AWS accounts?</summary><br><b>
1654+
1655+
One way is to define multiple different provider blocks, each with its own "assume_role"
1656+
1657+
```
1658+
provider "aws" {
1659+
region = "us-west-1"
1660+
alias = "some-region"
1661+
1662+
assume_role {
1663+
role_arn = "arn:aws:iam::<SOME_ACCOUNT_ID>:role/<SOME_ROLE_NAME>"
1664+
}
1665+
}
1666+
```
1667+
1668+
</b></details>
1669+
16391670
### Validations
16401671

16411672
<details>
@@ -1845,3 +1876,10 @@ Instead of defining tags at resource level, consider using `default_tags` as par
18451876
If it's a matter of changing a resource name, you could make use of `terraform state mv <ORIGINAL_RESOURCE_NAME> <NEW_RESOURCE_NAME>`
18461877

18471878
</b></details>
1879+
1880+
<details>
1881+
<summary>You try to deploy a cluster and an app on that cluster, but the app resource was created before the cluster. How to manage such situation?</summary><br><b>
1882+
1883+
Use the meta-argument `depends_on` in the app resource definition. This way the app will depend on the cluster resource and order will be maintained in creation of the resources.
1884+
1885+
</b></details>

0 commit comments

Comments
 (0)