Merge branch 'GoogleCloudPlatform:master' into example-wordpress
This commit is contained in:
commit
d9a99963a0
|
@ -32,7 +32,7 @@ jobs:
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Set up Terraform
|
- name: Set up Terraform
|
||||||
uses: hashicorp/setup-terraform@v1
|
uses: hashicorp/setup-terraform@v1
|
||||||
|
|
|
@ -22,7 +22,7 @@ on:
|
||||||
- closed
|
- closed
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: 3.10
|
PYTHON_VERSION: "3.10"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
if_merged:
|
if_merged:
|
||||||
|
|
|
@ -44,7 +44,7 @@ jobs:
|
||||||
|
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.16
|
go-version: "1.16"
|
||||||
|
|
||||||
- name: "Update all module names"
|
- name: "Update all module names"
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -28,7 +28,7 @@ on:
|
||||||
env:
|
env:
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: "/home/runner/credentials.json"
|
GOOGLE_APPLICATION_CREDENTIALS: "/home/runner/credentials.json"
|
||||||
PYTEST_ADDOPTS: "--color=yes"
|
PYTEST_ADDOPTS: "--color=yes"
|
||||||
PYTHON_VERSION: 3.9
|
PYTHON_VERSION: "3.10"
|
||||||
TF_PLUGIN_CACHE_DIR: "/home/runner/.terraform.d/plugin-cache"
|
TF_PLUGIN_CACHE_DIR: "/home/runner/.terraform.d/plugin-cache"
|
||||||
TF_VERSION: 1.1.8
|
TF_VERSION: 1.1.8
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,11 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
### MODULES
|
### MODULES
|
||||||
|
|
||||||
|
- [[#787](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/787)] Support manager role in cloud identity group module ([lcaggio](https://github.com/lcaggio)) <!-- 2022-08-31 10:29:05+00:00 -->
|
||||||
|
- [[#786](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/786)] Secret manager flag sensitive output ([ddaluka](https://github.com/ddaluka)) <!-- 2022-08-29 11:22:52+00:00 -->
|
||||||
|
- [[#775](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/775)] net-glb: Added support for regional external HTTP(s) load balancing ([rosmo](https://github.com/rosmo)) <!-- 2022-08-27 20:58:11+00:00 -->
|
||||||
|
- [[#784](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/784)] fix envoy-traffic-director config for xDS v3 ([drebes](https://github.com/drebes)) <!-- 2022-08-24 14:34:33+00:00 -->
|
||||||
|
- [[#785](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/785)] nginx-tls module ([drebes](https://github.com/drebes)) <!-- 2022-08-24 14:20:36+00:00 -->
|
||||||
- [[#783](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/783)] fix service unit indent on cloud-config-container module ([drebes](https://github.com/drebes)) <!-- 2022-08-24 07:38:48+00:00 -->
|
- [[#783](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/783)] fix service unit indent on cloud-config-container module ([drebes](https://github.com/drebes)) <!-- 2022-08-24 07:38:48+00:00 -->
|
||||||
- [[#782](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/782)] typo fix (max_scale -> min_scale) ([skalolazka](https://github.com/skalolazka)) <!-- 2022-08-23 17:04:56+00:00 -->
|
- [[#782](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/782)] typo fix (max_scale -> min_scale) ([skalolazka](https://github.com/skalolazka)) <!-- 2022-08-23 17:04:56+00:00 -->
|
||||||
- [[#778](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/778)] **incompatible change:** instance_termination_action must be set for compute-vm spot instances ([sruffilli](https://github.com/sruffilli)) <!-- 2022-08-20 16:37:17+00:00 -->
|
- [[#778](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/778)] **incompatible change:** instance_termination_action must be set for compute-vm spot instances ([sruffilli](https://github.com/sruffilli)) <!-- 2022-08-20 16:37:17+00:00 -->
|
||||||
|
|
|
@ -7,11 +7,10 @@ To use this module you must either run terraform as a user that has the Groups A
|
||||||
|
|
||||||
Please note that the underlying terraform resources only allow the creation of groups with members that are part of the organization. If you want to create memberships for identities outside your own organization, you have to manually allow members outside your organization in the Cloud Identity admin console.
|
Please note that the underlying terraform resources only allow the creation of groups with members that are part of the organization. If you want to create memberships for identities outside your own organization, you have to manually allow members outside your organization in the Cloud Identity admin console.
|
||||||
|
|
||||||
As of version 3.50 of the GCP Terraform provider two operations are not working:
|
As of version 4.34 of the GCP Terraform provider one operation is not working:
|
||||||
- removing a group that has at least one OWNER managed by terraform ([bug](https://github.com/hashicorp/terraform-provider-google/issues/7617))
|
- removing a group that has at least one OWNER managed by terraform ([bug](https://github.com/hashicorp/terraform-provider-google/issues/7617))
|
||||||
- removing a role from an existing membership ([bug](https://github.com/hashicorp/terraform-provider-google/issues/7616))
|
|
||||||
|
|
||||||
Until those two bugs are fixed, this module will only support the creation of MEMBER memberships.
|
Until that bug is fixed, this module will only support the creation of MEMBER and MANAGER memberships.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
@ -31,6 +30,26 @@ module "group" {
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=4
|
# tftest modules=1 resources=4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Group with managers
|
||||||
|
```hcl
|
||||||
|
module "group" {
|
||||||
|
source = "./modules/cloud-identity-group"
|
||||||
|
customer_id = "customers/C01234567"
|
||||||
|
name = "mygroup2@example.com"
|
||||||
|
display_name = "My group name 2"
|
||||||
|
description = "My group 2 Description"
|
||||||
|
members = [
|
||||||
|
"user1@example.com",
|
||||||
|
"user2@example.com",
|
||||||
|
"service-account@my-gcp-project.iam.gserviceaccount.com"
|
||||||
|
]
|
||||||
|
managers = [
|
||||||
|
"user3@example.com"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
# tftest modules=1 resources=5
|
||||||
|
```
|
||||||
<!-- BEGIN TFDOC -->
|
<!-- BEGIN TFDOC -->
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
@ -39,9 +58,10 @@ module "group" {
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [customer_id](variables.tf#L17) | Directory customer ID in the form customers/C0xxxxxxx. | <code>string</code> | ✓ | |
|
| [customer_id](variables.tf#L17) | Directory customer ID in the form customers/C0xxxxxxx. | <code>string</code> | ✓ | |
|
||||||
| [display_name](variables.tf#L32) | Group display name. | <code>string</code> | ✓ | |
|
| [display_name](variables.tf#L32) | Group display name. | <code>string</code> | ✓ | |
|
||||||
| [name](variables.tf#L43) | Group ID (usually an email). | <code>string</code> | ✓ | |
|
| [name](variables.tf#L49) | Group ID (usually an email). | <code>string</code> | ✓ | |
|
||||||
| [description](variables.tf#L26) | Group description. | <code>string</code> | | <code>null</code> |
|
| [description](variables.tf#L26) | Group description. | <code>string</code> | | <code>null</code> |
|
||||||
| [members](variables.tf#L37) | List of group members. | <code>list(string)</code> | | <code>[]</code> |
|
| [managers](variables.tf#L37) | List of group managers. | <code>list(string)</code> | | <code>[]</code> |
|
||||||
|
| [members](variables.tf#L43) | List of group members. | <code>list(string)</code> | | <code>[]</code> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
|
|
@ -36,17 +36,18 @@ resource "google_cloud_identity_group" "group" {
|
||||||
# roles { name = "MANAGER" }
|
# roles { name = "MANAGER" }
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# resource "google_cloud_identity_group_membership" "managers" {
|
resource "google_cloud_identity_group_membership" "managers" {
|
||||||
# group = google_cloud_identity_group.group.id
|
group = google_cloud_identity_group.group.id
|
||||||
# for_each = toset(var.managers)
|
for_each = toset(var.managers)
|
||||||
# preferred_member_key { id = each.key }
|
preferred_member_key { id = each.key }
|
||||||
# roles { name = "MEMBER" }
|
roles { name = "MEMBER" }
|
||||||
# roles { name = "MANAGER" }
|
roles { name = "MANAGER" }
|
||||||
# }
|
}
|
||||||
|
|
||||||
resource "google_cloud_identity_group_membership" "members" {
|
resource "google_cloud_identity_group_membership" "members" {
|
||||||
group = google_cloud_identity_group.group.id
|
group = google_cloud_identity_group.group.id
|
||||||
for_each = toset(var.members)
|
for_each = toset(var.members)
|
||||||
preferred_member_key { id = each.key }
|
preferred_member_key { id = each.key }
|
||||||
roles { name = "MEMBER" }
|
roles { name = "MEMBER" }
|
||||||
|
depends_on = [google_cloud_identity_group_membership.managers]
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,12 @@ variable "display_name" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "managers" {
|
||||||
|
description = "List of group managers."
|
||||||
|
type = list(string)
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
variable "members" {
|
variable "members" {
|
||||||
description = "List of group members."
|
description = "List of group members."
|
||||||
type = list(string)
|
type = list(string)
|
||||||
|
@ -50,9 +56,3 @@ variable "name" {
|
||||||
# type = list(string)
|
# type = list(string)
|
||||||
# default = []
|
# default = []
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# variable "managers" {
|
|
||||||
# description = "List of group managers."
|
|
||||||
# type = list(string)
|
|
||||||
# default = []
|
|
||||||
# }
|
|
||||||
|
|
|
@ -20,5 +20,6 @@ module "test" {
|
||||||
display_name = var.display_name
|
display_name = var.display_name
|
||||||
description = var.description
|
description = var.description
|
||||||
customer_id = var.customer_id
|
customer_id = var.customer_id
|
||||||
|
managers = var.managers
|
||||||
members = var.members
|
members = var.members
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,11 @@ variable "customer_id" {
|
||||||
default = "customers/C01234567"
|
default = "customers/C01234567"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "managers" {
|
||||||
|
type = list(string)
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
variable "members" {
|
variable "members" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
default = []
|
default = []
|
||||||
|
|
Loading…
Reference in New Issue