找不到Terraform Sentinel策略资源
我用的是terraform enterprise 我创建了main.tf文件,并放置了下面用于创建sentinel策略的代码找不到Terraform Sentinel策略资源,terraform,Terraform,我用的是terraform enterprise 我创建了main.tf文件,并放置了下面用于创建sentinel策略的代码 data "tfe_workspace_ids" "all" { names = ["*"] organization = myorg } locals { workspaces = "${data.tfe_workspace_ids.all.external_ids}" # map of names to IDs } resource "t
data "tfe_workspace_ids" "all" {
names = ["*"]
organization = myorg
}
locals {
workspaces = "${data.tfe_workspace_ids.all.external_ids}" # map of names to IDs
}
resource "tfe_sentinel_policy" "test" {
name = "my-policy-name"
description = "This policy always passes"
organization = "myorg"
policy = "main = rule { true }"
enforce_mode = "hard-mandatory"
}
然后,当我运行terraform应用程序时,计划成功,但应用程序失败,并显示以下错误消息
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# tfe_sentinel_policy.test will be created
+ resource "tfe_sentinel_policy" "test" {
+ description = "This policy always passes"
+ enforce_mode = "hard-mandatory"
+ id = (known after apply)
+ name = "my-policy-name"
+ organization = "myorg"
+ policy = "main = rule { true }"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions in workspace "tf-sentinel-governance"?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
tfe_sentinel_policy.test: Creating...
Error: Error creating sentinel policy my-policy-name for organization myorg: resource not found
on main.tf line 10, in resource "tfe_sentinel_policy" "test":
10: resource "tfe_sentinel_policy" "test" {
检查用于
tfe
提供者的令牌是否是团队令牌,而不是组织令牌。我在尝试将tfe\u通知\u配置添加到工作区时遇到了类似的情况。有人能帮忙吗?