使用带有 terraform 的 GCP 云时,我可以自动启用 API 吗? [英] Can I automatically enable APIs when using GCP cloud with terraform?

查看:20
本文介绍了使用带有 terraform 的 GCP 云时,我可以自动启用 API 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用 terraform 的 GCP 非常陌生,我想使用集中式工具部署我的所有模块.

I am very new to GCP with terraform and I want to deploy all my modules using centralized tools.

有没有什么办法可以去掉每次都启用google API的步骤,这样部署就不会中断了?

Is there any way to remove the step of enabling google API's every time so that deployment is not interrupted?

推荐答案

有一个名为google_project_service"的 Terraform 资源定义允许启用服务 (API).这记录在 google_project_service.

There is a Terraform resource definition called "google_project_service" that allows one to enable a service (API). This is documented at google_project_service.

一个用法示例如下:

resource "google_project_service" "project" {
  project = "your-project-id"
  service = "iam.googleapis.com"
}

这篇关于使用带有 terraform 的 GCP 云时,我可以自动启用 API 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆