简体   繁体   English

地形:谷歌云。 为什么我不能在没有组织的情况下创建新项目?

[英]Terraform: Google cloud. Why cannot I create a new project without having an organisation?

I cannot understand the rationale behind prohibiting a user that has no organisation to create new google cloud projects with terraform.我无法理解禁止没有组织的用户使用 terraform 创建新的谷歌云项目背后的理由。 Indeed, if I use gcloud , I am able to create new projects and I can also do that using the web console.事实上,如果我使用gcloud ,我就可以创建新项目,也可以使用 Web 控制台来创建新项目。

As mentioned in the documentation :文档中所述:

The user or service account that is running Terraform when creating a google_project resource must have roles/resourcemanager.projectCreator on the specified organization.创建google_project资源时运行 Terraform 的用户或服务帐户必须在指定组织中具有roles/resourcemanager.projectCreator

The problem with roles/resourcemanager.projectCreator is, that it's an organization role - not project role. roles/resourcemanager.projectCreator的问题在于,它是一个组织角色,而不是项目角色。 Therefore without organization one cannot get this role.因此,没有组织就无法获得这一角色。

The ability to do it using the console but not through the official Terraform way is strange indeed.使用控制台而不是通过官方 Terraform 方式执行此操作的能力确实很奇怪。

But, it seems that there's a workaround, that will just require you to provide billing account and will enable you creating new project - by using the project module of Google's official cloud-foundation-fabric .但是,似乎有一种解决方法,只需要您提供计费帐户并使您能够创建新项目 - 通过使用 Google 官方cloud-foundation-fabricproject模块。

Basic example:基本示例:

module "project" {
  source          = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/project?ref=v19.0.0"
  billing_account = "your-billing-account"
  name            = "your-project-name"
  services = [
    "container.googleapis.com",
  ]
}

It might take some time (took me about 3.5 minutes), but did the job without creating organization.这可能需要一些时间(我花了大约 3.5 分钟),但在没有创建组织的情况下完成了这项工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您可以更改 Google Cloud 项目的组织所有权吗 - Can you change organisation ownership of a Google Cloud Project 尝试使用谷歌云登录 terraforms 的字符无效。 使用 cygwin - Invalid character trying to login terraforms with google cloud. using cygwin 如何使用 Terraform 在不同项目中为 Google Cloud 中的其他项目服务帐户添加 IAM 角色 - How can I add IAM role for other project service account in Google Cloud in different project using Terraform 我无法在 Google Cloud DNS 中创建 DNS 区域 - I cannot create a DNS zone in Google Cloud DNS Google Cloud CloudSQL 实例无法使用 Terraform 提供程序创建,并出现错误“未找到每产品每项目服务帐户” - Google Cloud CloudSQL Instance Fails To Create using Terraform Provider With Error "Per-Product Per-Project Service Account is not found" 在Google Cloud SQL Postgres上使用Terraform创建一个Replication Slot - Use Terraform on Google Cloud SQL Postgres to create a Replication Slot 如何通过 terraform 使用服务帐户创建谷歌云 pubsub 拉取订阅? - How to create a google cloud pubsub pull subscriptions with service account by terraform? 切换谷歌云项目后,我的 python 找不到我的新谷歌项目的存储桶? - After switching google cloud projects my python cannot find my new google project's storage bucket? terraform GCP 云 function 无需通过 terraform 在 CI 中部署或在本地运行时打破过去的部署? - terraform GCP cloud function without having to deploy via terraform in CI or breaking past deployments when running locally? 如何使用 terraform 在 Google Cloud Platform 中创建松弛通知通道 - How to create a slack notification channel in Google Cloud Platform with terraform
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM