mirror of https://github.com/fluxcd/flux2.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
Terraform
50 lines
1.2 KiB
Terraform
2 years ago
|
provider "google" {
|
||
|
project = var.gcp_project_id
|
||
|
region = var.gcp_region
|
||
|
zone = var.gcp_zone
|
||
|
}
|
||
|
|
||
|
resource "random_pet" "suffix" {}
|
||
|
|
||
|
data "google_kms_key_ring" "keyring" {
|
||
|
name = var.gcp_keyring
|
||
|
location = "global"
|
||
|
}
|
||
|
|
||
|
data "google_kms_crypto_key" "my_crypto_key" {
|
||
|
name = var.gcp_crypto_key
|
||
|
key_ring = data.google_kms_key_ring.keyring.id
|
||
|
}
|
||
|
|
||
|
data "google_project" "project" {
|
||
|
}
|
||
|
|
||
|
module "gke" {
|
||
|
source = "git::https://github.com/fluxcd/test-infra.git//tf-modules/gcp/gke"
|
||
|
name = "flux-e2e-${random_pet.suffix.id}"
|
||
|
tags = var.tags
|
||
|
}
|
||
|
|
||
|
module "gcr" {
|
||
|
source = "git::https://github.com/fluxcd/test-infra.git//tf-modules/gcp/gcr"
|
||
|
name = "flux-e2e-${random_pet.suffix.id}"
|
||
|
tags = var.tags
|
||
|
}
|
||
|
|
||
|
resource "google_sourcerepo_repository" "fleet-infra" {
|
||
|
name = "fleet-infra-${random_pet.suffix.id}"
|
||
|
}
|
||
|
|
||
|
resource "google_sourcerepo_repository" "application" {
|
||
|
name = "application-${random_pet.suffix.id}"
|
||
|
}
|
||
|
|
||
|
resource "google_kms_key_ring_iam_binding" "key_ring" {
|
||
|
key_ring_id = data.google_kms_key_ring.keyring.id
|
||
|
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
|
||
|
|
||
|
members = [
|
||
|
"serviceAccount:${data.google_project.project.number}-compute@developer.gserviceaccount.com",
|
||
|
]
|
||
|
}
|