英文:
Seems Terraform GitLab provider does not provide Slack/Teams webhook URL anymore
问题
目前我们正在使用Terraform来“检查”(通过terraform plan -detailed-exitcode
)当前的GitLab资源是否符合我们在*.tf
文件中描述的规范。
自2023年3月1日以来,我们的夜间流水线运行执行这些检查失败,因为Terraform GitLab提供程序(甚至是GitLab.com的API服务器)不再“看到”配置的Slack/Teams Webhook URL。
这导致反复执行 terraform apply
不断成功,但每次调用也指出需要更改这些Webhook URL:
$ terraform apply
[...]
Terraform使用所选的提供程序生成以下执行计划。资源操作用以下符号表示:
~ 在原地更新
Terraform将执行以下操作:
# module.GitlabProject.gitlab_service_microsoft_teams.[...] 将在原地更新
~ 资源 "gitlab_service_microsoft_teams" "[...]" {
id = "[...]"
~ webhook = (敏感值)
# (隐藏了15个未更改的属性)
}
# module.GitlabProject.gitlab_service_slack.[...] 将在原地更新
~ 资源 "gitlab_service_slack" "[...]" {
id = "[...]"
~ webhook = (敏感值)
# (隐藏了23个未更改的属性)
}
计划:0 添加,2 更改,0 销毁。
您想执行这些操作吗?
Terraform将执行上述描述的操作。
仅接受“是”来批准。
输入一个值:是
[...]
应用完成!资源:0 添加,2 更改,0 销毁。
一遍又一遍地发出terraform apply
会产生完全相同的输出每次!
由于Terraform状态包含“webhook”字段的空值...
$ terraform state pull | grep '"webhook":'
"webhook": "",
"webhook": "",
...我怀疑Terraform提供程序在处理此字段时失败,或者GitLab.com的API服务器不再提供此字段的值(自2023年2月底以来)。在GitLab的API中搜索了有关此主题可能更改的信息,但没有找到。
顺便提一下,我们提到的Webhook URL 在我们的GitLab项目上已经正确设置...它们在我们项目的GitLab页面上可见...而且我们仍然会收到有关Slack/Teams频道的通知(不仅仅是我在开头描述的流水线运行失败的通知)...
所以在我看来,这似乎是Terraform提供程序和/或GitLab.com API服务器的问题。
对此有什么想法/提示吗?
英文:
Currently we are using Terraform to "check" (via terraform plan -detailed-exitcode
) whether current GitLab resources
comply with our specification (described in *.tf
files).
Since 1st of March (2023), our nightly pipeline run executing these checks fails due to the fact that Terraform GitLab Provider (or even GitLab.com's API
server) does not "see" configured Slack/Teams webhook URLs anymore.
This yields to the behaviour that repeated issuance of terraform apply
constantly succeeds, but each invocation
also states that these webhook URLs needs to get changed:
$ terraform apply
[...]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# module.GitlabProject.gitlab_service_microsoft_teams.[...] will be updated in-place
~ resource "gitlab_service_microsoft_teams" "[...]" {
id = "[...]"
~ webhook = (sensitive value)
# (15 unchanged attributes hidden)
}
# module.GitlabProject.gitlab_service_slack.[...] will be updated in-place
~ resource "gitlab_service_slack" "[...]" {
id = "[...]"
~ webhook = (sensitive value)
# (23 unchanged attributes hidden)
}
Plan: 0 to add, 2 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
[...]
Apply complete! Resources: 0 added, 2 changed, 0 destroyed.
Issuing terraform apply
again and again comes up with exactly the same output each time!
As Terraform State contains empty value of webhook
field ...
$ terraform state pull | grep '"webhook":'
"webhook": "",
"webhook": "",
... I suspect that either Terraform Provider fails in handling this field, or GitLab.com's API server does not provide
this field's value anymore (since end of February 2023). Searched for information regarding possible changes on this topic in GitLab's API, but found none.
By the way, mentioned webhook URLs are set correctly on our GitLab projects ... they are visible on our project's
GitLab page ... and we still receive notifications on our Slack/Teams channels (not only regarding failing pipeline
runs I've described at the beginning) ...
So it seems to me to be a Terraform Provider and/or GitLab.com API server issue.
Any ideas/hints on this?
答案1
得分: 1
有一个新的资源integration_microsoft_teams可用,解决了报告的问题。
英文:
There is a new resource integration_microsoft_teams available, which solves the reported issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论