<commit_before>#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

locals {
  vault_tls_bucket = var.vault_tls_bucket != "" ? var.vault_tls_bucket : local.storage_bucket_name
}

# Configure the Google provider, locking to the 2.0 series.
provider "google" {
  version = "~> 2.0"
  project = var.project_id
  region  = var.region
}

# Enable required services on the project
resource "google_project_service" "service" {
  count   = length(var.project_services)
  project = var.project_id

  service = element(var.project_services, count.index)

  # Do not disable the service on destroy. This may be a shared project, and
  # we might not "own" the services we enable.
  disable_on_destroy = false
}

# Create the vault-admin service account.
resource "google_service_account" "vault-admin" {
  account_id   = var.service_account_name
  display_name = "<NAME>"
  project      = "${var.project_id}"

  depends_on = [google_project_service.service]
}

# Give project-level IAM permissions to the service account.
resource "google_project_iam_member" "project-iam" {
  count   = length(var.service_account_project_iam_roles)
  project = var.project_id
  role    = element(var.service_account_project_iam_roles, count.index)
  member  = "serviceAccount:${google_service_account.vault-admin.email}"

  depends_on = [google_project_service.service]
}

# Give additional project-level IAM permissions to the service account.
resource "google_project_iam_member" "additional-project-iam" {
  count   = length(var.service_account_project_additional_iam_roles)
  project = var.project_id
  role = element(
    var.service_account_project_additional_iam_roles,
    count.index,
  )
  member = "serviceAccount:${google_service_account.vault-admin.email}"

  depends_on = [google_project_service.service]<commit_msg>fix terraform 0.12 warning: Interpolation-only expressions are deprecated<commit_after>#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

locals {
  vault_tls_bucket = var.vault_tls_bucket != "" ? var.vault_tls_bucket : local.storage_bucket_name
}

# Configure the Google provider, locking to the 2.0 series.
provider "google" {
  version = "~> 2.0"
  project = var.project_id
  region  = var.region
}

# Enable required services on the project
resource "google_project_service" "service" {
  count   = length(var.project_services)
  project = var.project_id

  service = element(var.project_services, count.index)

  # Do not disable the service on destroy. This may be a shared project, and
  # we might not "own" the services we enable.
  disable_on_destroy = false
}

# Create the vault-admin service account.
resource "google_service_account" "vault-admin" {
  account_id   = var.service_account_name
  display_name = "<NAME>"
  project      = var.project_id

  depends_on = [google_project_service.service]
}

# Give project-level IAM permissions to the service account.
resource "google_project_iam_member" "project-iam" {
  count   = length(var.service_account_project_iam_roles)
  project = var.project_id
  role    = element(var.service_account_project_iam_roles, count.index)
  member  = "serviceAccount:${google_service_account.vault-admin.email}"

  depends_on = [google_project_service.service]
}

# Give additional project-level IAM permissions to the service account.
resource "google_project_iam_member" "additional-project-iam" {
  count   = length(var.service_account_project_additional_iam_roles)
  project = var.project_id
  role = element(
    var.service_account_project_additional_iam_roles,
    count.index,
  )
  member = "serviceAccount:${google_service_account.vault-admin.email}"

  depends_on = [google_project_service.service]
{'fraction_non_alphanumeric': 0.08487163165711861, 'fraction_numerical': 0.005728835136855506, 'mean_word_length': 4.665865384615385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1573443', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1393, 'n_words': 420}