focusaurus / focusaurus/hexagonal-lambda

Terraform apply fails first, then works 2nd time in some cases

未關閉
#1 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug help wanted
主要語言
JavaScript
星號
27
分支
3
PR 合併指標
30 天內沒有已合併 PR

描述

Sometimes a `terraform apply` run does some things successfully but fails before completing. Then I rerun it again immediately without any other changes/actions and it succeeds. My strong hunch about this is that most likely my resource dependencies are not modeled correctly in terraform. I have seen this in at least 2 specific cases.

1. Fresh install into a blank slate AWS account.

```
aws_api_gateway_deployment.hexagonal-lambda-dev: Error creating API Gateway Deployment: BadRequestException: The REST API doesn't contain any methods
status code: 400, request id: redacted
```

2. Creating a new lambda function.

```
Error applying plan:

1 error(s) occurred:

* aws_iam_role_policy_attachment.post-up: 1 error(s) occurred:

* aws_iam_role_policy_attachment.post-up: [WARN] Error attaching policy arn:aws:iam::REDACTED:policy/terraform-redacted to IAM Role post-up: NoSuchEntity: Role not found for post-up
status code: 404, request id: redacted
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

檢查 aws_api_gateway_deployment、API 方法、Lambda 函式和 aws_iam_role_policy_attachment.post-up 的 Terraform 設定。首先在空白的 AWS 帳戶中重現初始 apply,並將資源相依性圖與第二次執行進行比較;當第一次 apply 完成且未出現所回報的兩個錯誤中的任何一個時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
aws, terraform
領域
cloud, infrastructure
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。