-
Notifications
You must be signed in to change notification settings - Fork 0
/
terraform.tf
37 lines (31 loc) · 854 Bytes
/
terraform.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
provider "google" {
project = var.project
alias = "tokengen"
}
data "google_service_account_access_token" "sa" {
provider = google.tokengen
target_service_account = "iac-sa@${var.project}.iam.gserviceaccount.com"
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "3600s"
}
terraform {
required_version = "~> 1.5.0"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.80.0"
}
}
}
provider "google" {
project = var.project
region = var.region
zone = var.zone
access_token = data.google_service_account_access_token.sa.access_token
}
resource "google_project_service" "compute" {
service = "compute.googleapis.com"
}
resource "google_project_service" "container" {
service = "container.googleapis.com"
}