# 代码结构示例

## Terraform 代码结构

{% hint style="info" %}
这些示例显示的是 AWS 提供商，但示例中显示的大部分原则可以应用于其他公共云提供商以及其他类型的提供商（DNS、DB、监控等）。
{% endhint %}

| Type 类型                                                                     | Description 描述                                           | Readiness 准备 |
| --------------------------------------------------------------------------- | -------------------------------------------------------- | ------------ |
| [small](/zh/examples/terraform/small-size-infrastructure.md)                | 很少资源，没有外部依赖。 单个 AWS 账户。 单一区域。 单一环境。                      | Yes          |
| [medium](/zh/examples/terraform/medium-size-infrastructure.md)              | 多个 AWS 账户和环境，使用 Terraform 的现成基础设施模块。                     | Yes          |
| [large](/zh/examples/terraform/large-size-infrastructure-with-terraform.md) | 许多 AWS 账户，许多地区，迫切需要减少复制粘贴、自定义基础设施模块、大量使用组合。 使用Terraform。 | WIP 生产中      |
| very-large                                                                  | 多个提供商（AWS、GCP、Azure）。 多云部署。 使用Terraform。                 | No           |

## Terragrunt 代码结构

| Type 类型    | Description 描述                                             | Readiness 准备 |
| ---------- | ---------------------------------------------------------- | ------------ |
| medium     | 多个 AWS 账户和环境，现成的基础设施模块，使用 Terragrunt 的组合模式。                | No           |
| large      | 许多 AWS 账户，许多地区，迫切需要减少复制粘贴、自定义基础设施模块、大量使用组合。 使用 Terragrunt。 | No           |
| very-large | 多个提供商（AWS、GCP、Azure）。 多云部署。 使用 Terragrunt。                 | No           |


---

# Agent Instructions: 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:

```
GET https://www.terraform-best-practices.com/zh/examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
