将GCP云与terraform一起使用时,可以自动启用API吗? [英] Can I automatically enable APIs when using GCP cloud with terraform?

查看:149
本文介绍了将GCP云与terraform一起使用时,可以自动启用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"
}

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

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