GCP-Terraform-无法编辑组织政策

时间:2020-09-25 20:34:07

标签: google-cloud-platform

我不小心执行了以下组织政策:

module "allowed_policy_member_domains_org_policy" {
  source     = "terraform-google-modules/org-policy/google"
  policy_for = "organization"

  constraint      = "constraints/iam.allowedPolicyMemberDomains"
  policy_type     = "list"
  organization_id = data.google_organization.org.org_id
  allow           = var.allowed_policy_member_domains
  enforce         = true
}

我不小心包括了强制文件,似乎使我无法执行组织策略。我是帐户的所有者,但是当我进入组织政策页面时,“编辑”按钮显示为灰色。

我去尝试向任何人添加任何角色,但现在我做不到:

can't add

请帮助!

1 个答案:

答案 0 :(得分:1)

想通了!

  1. 在您的Terraform SA所在的位置创建一个VM,并确保使用该SA作为服务帐户
  2. 运行import React, { useState, useEffect } from "react"; const App = () => { const [text, setText] = useState(""); const [list, setList] = useState([]); const addToList = () => { if (text !== "") { setList([...list, text]); setText(""); } }; const deleteItem = (index) => { const deletedList = list.filter((_, i) => i !== index); setList(deletedList); }; const listener = (e) => { e.stopPropagation(); if (e.key === "Enter") { console.log("event triggered"); if (text !== "") { console.log("updating"); setList((a) => [...a, text]); } setText(""); return ""; } }; // not needed, only here to show it only runs once useEffect(() => { console.log("Reloaded"); }, []); return ( <div> <input type="text" id="textbox" onChange={(e) => setText(e.target.value)} onKeyPress={listener} value={text} /> <button id="add" onClick={addToList}> {" "} Add </button> <ul> {list.map((a, i) => ( <li key={i}> {a}{" "} <button type="button" onClick={() => deleteItem(i)}> Delete </button> </li> ))} </ul> </div> ); }; export default App;

应该工作!