Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit a9f222b9 authored by Kenny Moore's avatar Kenny Moore
Browse files

Cleaning up to work with HITS


Co-authored-by: Adam Robinson's avataradarobin@umich.edu <adarobin@umich.edu>
Co-authored-by: default avatarbryanro92 <ross785@gmail.com>
Co-authored-by: default avatarMichael Shen <mjlshen@yahoo.com>
Co-authored-by: default avatarJohn Walsh <michaeljohn32@yahoo.com>
parent 316d1c4c
......@@ -12,7 +12,7 @@ locals{
}
resource "google_project" "gcp_project" {
name = "${var.project_name}"
name = var.project_name
project_id = var.project_id == "" ? "${local.project_name_string}-${random_id.id.hex}" : var.project_id
folder_id = local.folder[var.division]
billing_account = var.billing_id
......@@ -23,7 +23,7 @@ resource "google_project" "gcp_project" {
}
resource "google_project_iam_member" "project_iam" {
project = "${google_project.gcp_project.project_id}"
project = google_project.gcp_project.project_id
role = "roles/editor"
member = "group:${var.project_mcomm}"
}
......@@ -35,9 +35,9 @@ locals{
}
resource "google_logging_project_sink" "log_export" {
project = "${google_project.gcp_project.project_id}"
project = google_project.gcp_project.project_id
name = "${google_project.gcp_project.project_id}-log-export"
destination = "${var.log_export_destination}"
destination = var.log_export_destination
# filter = "projects/${google_project.gcp_project.project_id}/logs/cloudaudit.googleapis.com%2Factivity" # Need this
filter = local.filter_string
unique_writer_identity = true
......@@ -46,13 +46,13 @@ resource "google_logging_project_sink" "log_export" {
# Give unique writer permission to publish/write to pub/sub topic
resource google_pubsub_topic_iam_member "publisher" {
project = "vci-mcloud-service" # should make this a var
topic = "${var.log_export_destination}"
topic = var.log_export_destination
role = "roles/pubsub.publisher"
member = google_logging_project_sink.log_export.writer_identity
}
resource "google_project_service" "compute-api" {
project = "${google_project.gcp_project.project_id}"
project = google_project.gcp_project.project_id
service = "compute.googleapis.com"
# disable_dependent_services = true
}
......@@ -67,7 +67,7 @@ locals {
}
resource "google_compute_network" "default_vpc" {
project = "${google_project.gcp_project.project_id}"
project = google_project.gcp_project.project_id
name = "${var.prefix}-default-vpc"
routing_mode = "GLOBAL"
auto_create_subnetworks = false
......@@ -75,7 +75,7 @@ resource "google_compute_network" "default_vpc" {
resource "google_compute_subnetwork" "default_subnet" {
for_each = local.default_subnets
project = "${google_project.gcp_project.project_id}"
project = google_project.gcp_project.project_id
name = "default-${each.key}"
region = each.key
ip_cidr_range = each.value
......
# resource "google_compute_subnetwork" "modify_default"{
# name = var.default_subnets[0]
# network = google_compute_network.default_vpc.self_link
# }
data "google_compute_subnetwork" "subnet_input"{
name = var.default_subnets[0]
project = var.project_id
region = "us-central1"
}
locals {
start_cidr = "10.255.192.0/18"
k8s_networks = ["pods","services"]
subnets = cidrsubnets(local.start_cidr,1,2)
}
resource "google_compute_subnetwork" "modify_subnet" {
name = var.default_subnet
ip_cidr_range = data.google_compute_subnetwork.subnet_input.ip_cidr_range
region = "us-central1"
network = data.google_compute_subnetwork.subnet_input.network
secondary_ip_range {
range_name = "gke-services"
ip_cidr_range = "10.255.224.0/20"
}
}
# resource "google_compute_subnetwork" "default_subnet" {
# for_each = local.default_subnets
# project = "${google_project.gcp_project.project_id}"
# name = "default-${each.key}"
# region = each.key
# ip_cidr_range = each.value
# network = google_compute_network.default_vpc.self_link
# }
# module "kubernetes-engine" {
# source = "terraform-google-modules/kubernetes-engine/google"
# version = "5.1.1"
# project_id = module.gcp_project.project_id
# name = "gke-test-1"
# region = "us-central1"
# # zones = ["us-central1-a", "us-central1-b", "us-central1-f"]
# network = "um-default-vpc"
# subnetwork = "default-us-central1"
# ip_range_pods = "us-central1-01-gke-01-pods"
# ip_range_services = "us-central1-01-gke-01-services"
# # http_load_balancing = false
# horizontal_pod_autoscaling = true
# kubernetes_dashboard = true
# # network_policy = true
# # node_pools = [{"name": "node-pool01"}]
# remove_default_node_pool = true
# }
\ No newline at end of file
variable "project_id" {
}
variable "prefix" {
}
variable "default_vpc_name" {
}
variable "default_vpc_self_link" {
}
variable "default_subnets" {
}
\ No newline at end of file
......@@ -22,7 +22,7 @@ locals{
resource "google_compute_network" "vpn_vpc" {
project = var.project_id
name = "${var.prefix}-vpn-vpc"
name = "${var.prefix}-vpn"
routing_mode = "GLOBAL"
auto_create_subnetworks = false
}
......
variable "regions" {
default = ["us-central1","us-east1"] #, "us-west1"]
}
variable "supernet" {
}
# variable "subnet_cidr" {
# default = ""
# }
......
......@@ -17,6 +17,12 @@ output "default_vpc_name"{
output "default_vpc_self_link"{
value = google_compute_network.default_vpc.self_link
}
output "default_vpc_id"{
value = google_compute_network.default_vpc.id
}
output "default_subnets"{
value = values(google_compute_subnetwork.default_subnet)[*]["name"]
value = {for k, v in google_compute_subnetwork.default_subnet : k => v.name}
# value = values(google_compute_subnetwork.default_subnet)[*]["name"]
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment