Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform 执行状态和阶段关系 | 袁昊的学习笔记 #60

Open
howieyuen opened this issue Jan 18, 2024 · 0 comments
Open

Terraform 执行状态和阶段关系 | 袁昊的学习笔记 #60

howieyuen opened this issue Jan 18, 2024 · 0 comments

Comments

@howieyuen
Copy link
Owner

https://howieyuen.github.io/docs/XaC/infra-as-code/terraform-workflow/

Terraform 每次运行都经过多个操作阶段(Pending、Plan、Cost Estimation、Policy Check、Apply 和 Completion),Terraform Cloud 将这些阶段的进度显示为运行状态。 在 Terraform Cloud 主页上的工作区列表中,每个工作区都显示了它当前正在处理的运行状态。(或者,如果没有正在进行的运行,则为最近完成的运行的状态。)
Pending # 阶段状态:
Pending:Terraform Cloud 尚未开始运行操作。Terraform Cloud 按照排队的顺序处理每个工作区的运行,并且运行在每次运行完成之前一直处于挂起状态。 离开状态:
Discarded:如果用户在开始前放弃运行,则运行不会继续。 Planning:如果运行在队列中排在首位,它会自动进入 Plan 阶段。 图示:
Fetching # Terraform Cloud 可能需要在开始计划之前从 VCS 获取配置。当所有运行完成后,Terraform Cloud 会自动存档通过 VCS 创建的配置版本,然后重新获取文件以供后续运行使用。
阶段状态:
Fetching:如果 Terraform Cloud 尚未从 VCS 获取配置,则运行将进入此状态,直到配置可用。 离开状态:
Plan Errored:如果 Terraform Cloud 在从 VCS 获取配置时遇到错误,则运行不会继续。 如果 Terraform 成功获取配置,则运行进入下一阶段。 图示:
Pre-plan(可选) # 创建 Run Task,并关联 Workspace,选择在 “Pre-plan” 时执行,才有 Pre-plan 阶段。在此阶段,Terraform Cloud 将有关运行的信息发送到已配置的外部系统,并等待 passed 或 failed 响应以确定运行是否可以继续。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant