Skip to content

Commit

Permalink
Merge pull request #147 from thefirstofthe300/seymourd/fix-gsuite-pro…
Browse files Browse the repository at this point in the history
…vider-regression

Fix regression in v1.1.0
  • Loading branch information
adrienthebo authored Feb 25, 2019
2 parents 83ec37e + c557f9e commit c182a16
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
14 changes: 12 additions & 2 deletions modules/gsuite_enabled/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@ module "gsuite_group" {
domain = "${var.domain}"
name = "${local.group_name}"
org_id = "${var.org_id}"
create_group = "${var.create_group}"
}

/******************************************
Gsuite Group Configuration
*****************************************/
resource "gsuite_group" "group" {
count = "${var.create_group ? 1 : 0}"

description = "${var.name} project group"
email = "${module.gsuite_group.email}"
name = "${local.group_name}"
}

/***********************************************
Expand All @@ -55,7 +65,7 @@ resource "gsuite_group_member" "api_s_account_api_sa_group_member" {
module "project-factory" {
source = "../core_project_factory/"

group_email = "${module.gsuite_group.email}"
group_email = "${element(compact(concat(gsuite_group.group.*.email, list(module.gsuite_group.email))), 0)}"
group_role = "${var.group_role}"
lien = "${var.lien}"
manage_group = "${var.group_name != "" || var.create_group}"
Expand Down
11 changes: 0 additions & 11 deletions modules/gsuite_group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,3 @@ locals {
data "google_organization" "org" {
organization = "${var.org_id}"
}

/******************************************
Gsuite Group Configuration
*****************************************/
resource "gsuite_group" "group" {
count = "${var.create_group ? 1 : 0}"

description = "${var.name} project group"
email = "${local.email}"
name = "${var.name}"
}
2 changes: 1 addition & 1 deletion modules/gsuite_group/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ output "domain" {

output "email" {
description = "The email address of the group."
value = "${element(compact(concat(gsuite_group.group.*.email, list(local.email))), 0)}"
value = "${local.email}"
}
5 changes: 0 additions & 5 deletions modules/gsuite_group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,3 @@ variable "name" {
variable "org_id" {
description = "The organization ID."
}

variable "create_group" {
description = "Whether to create the group or not"
default = "false"
}
2 changes: 1 addition & 1 deletion test/ci_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ finish() {
setup_environment() {
local tmpfile
tmpfile="$(mktemp)"
echo "${SERVICE_ACCOUNT_JSON}" > "${tmpfile}"
echo "${SERVICE_ACCOUNT_JSON}" >"${tmpfile}"

# gcloud variables
export CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE="${tmpfile}"
Expand Down

0 comments on commit c182a16

Please sign in to comment.