> For the complete documentation index, see [llms.txt](https://www.terraform-best-practices.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.terraform-best-practices.com/ba/examples/terraform/large-size-infrastructure-with-terraform.md).

# Kreiranje velike infrastrukture uz pomoc Terraforma

Source: <https://github.com/antonbabenko/terraform-best-practices/tree/master/examples/large-terraform>

Ovaj primjer sadrzi kod koji je primjer organizacije Terrafrom konfiguracije za vece infrastrukture, u primjeru se koriste:

* 2 AWS racuna
* 2 regiona
* 2 odvojena okruzenja (`produkcijsko` and `testno`). Svako okruzenje je smjesteno unutar posebnog AWS racuna i resursi se prostiru izmedju 2 regije.
* Svako okruzenje koristi razlicitu verziju infrastrukturnog modula (`alb`) preuzetog sa [Terraform Registry-a](https://registry.terraform.io/)
* Svako okruzenje koristi istu verziju internog modula `modules/network` posto je taj modul preuzet iz lokalnog direktorija.

{% hint style="info" %}
U velikim projektima kao sto je opisano ovdje prednosti koristenja Terragrunta postaju ocigledne. Pogledajte [Primjeri organizacije koda sa Terragruntom](/ba/examples/terragrunt.md).
{% endhint %}

{% hint style="success" %}

* Idealan za projekte gdje je infrastruktura logicki razdvojena (radvojeni AWS racuni)&#x20;
* Dobar kada nema potrebe da mijenjate resurse koji su dijeljeni izmedju AWS racuna (jedno okruzenje = jedan AWS racun = jedan Terraform fajl stanja)
* Dobar kada nema potrebe za orkestracijom izmjena izmedju okruzenja
* Dobar kada su resursi infrastrukture u razilicitim okruzenjima sa svrhom i kada se ne mogu generalizovati (npr: neki resursi se ne koriste u jednom od okruzenja ili u nekom od regiona)
  {% endhint %}

{% hint style="warning" %}
Kako projekat raste, bit ce teze odrzati ova okruzenja u azuriranom stanju. Razmislite o upotrebi infrastruktrurnih modula za zadatke koji se ponavljaju.
{% endhint %}

##


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.terraform-best-practices.com/ba/examples/terraform/large-size-infrastructure-with-terraform.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
