Skip to content

Commit bfa4168

Browse files
committed
OPST-1098 - Migrate webservices-infra/modules/workgroup to terraform-modules repo
need right email address + related gpg signature + not blocked w/privacy settings
1 parent 0013bb0 commit bfa4168

File tree

5 files changed

+115
-0
lines changed

5 files changed

+115
-0
lines changed

mozilla_workgroup/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Mozilla Workgroup
2+
3+
Builds on top of the [google workgroup module](../google_workgroup/) and contains constants for mozilla environments. This is the default to use for creating our internal tenants.
4+
5+
<!-- START_TF_DOCS -->
6+
## Requirements
7+
8+
| Name | Version |
9+
|------|---------|
10+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.0 |
11+
| <a name="requirement_google"></a> [google](#requirement\_google) | >= 3.0 |
12+
| <a name="requirement_google-beta"></a> [google-beta](#requirement\_google-beta) | >= 4.0 |
13+
14+
## Providers
15+
16+
No providers.
17+
18+
## Modules
19+
20+
| Name | Source | Version |
21+
|------|--------|---------|
22+
| <a name="module_workgroup"></a> [workgroup](#module\_workgroup) | github.com/mozilla/terraform-modules//google_workgroup | OPST-682 |
23+
24+
## Resources
25+
26+
No resources.
27+
28+
## Inputs
29+
30+
| Name | Description | Type | Default | Required |
31+
|------|-------------|------|---------|:--------:|
32+
| <a name="input_ids"></a> [ids](#input\_ids) | List of workgroup identifiers to look up access for | `set(string)` | n/a | yes |
33+
34+
## Outputs
35+
36+
| Name | Description |
37+
|------|-------------|
38+
| <a name="output_google_groups"></a> [google\_groups](#output\_google\_groups) | google groups associated with the input workgroups, unqualified |
39+
| <a name="output_members"></a> [members](#output\_members) | authoritative, fully-qualified list of members associated with the input workgroups |
40+
41+
<!-- BEGIN_TF_DOCS -->
42+
## Requirements
43+
44+
| Name | Version |
45+
|------|---------|
46+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.0 |
47+
| <a name="requirement_google"></a> [google](#requirement\_google) | >= 3.0 |
48+
| <a name="requirement_google-beta"></a> [google-beta](#requirement\_google-beta) | >= 4.0 |
49+
50+
## Providers
51+
52+
No providers.
53+
54+
## Modules
55+
56+
| Name | Source | Version |
57+
|------|--------|---------|
58+
| <a name="module_workgroup"></a> [workgroup](#module\_workgroup) | github.com/mozilla/terraform-modules//google_workgroup | main |
59+
60+
## Resources
61+
62+
No resources.
63+
64+
## Inputs
65+
66+
| Name | Description | Type | Default | Required |
67+
|------|-------------|------|---------|:--------:|
68+
| <a name="input_ids"></a> [ids](#input\_ids) | List of workgroup identifiers to look up access for | `set(string)` | n/a | yes |
69+
70+
## Outputs
71+
72+
| Name | Description |
73+
|------|-------------|
74+
| <a name="output_google_groups"></a> [google\_groups](#output\_google\_groups) | google groups associated with the input workgroups, unqualified |
75+
| <a name="output_members"></a> [members](#output\_members) | authoritative, fully-qualified list of members associated with the input workgroups |
76+
<!-- END_TF_DOCS -->

mozilla_workgroup/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module "workgroup" {
2+
source = "github.com/mozilla/terraform-modules//google_workgroup?ref=main"
3+
ids = var.ids
4+
roles = {}
5+
workgroup_outputs = ["members", "google_groups"]
6+
terraform_remote_state_bucket = "moz-fx-platform-mgmt-global-tf"
7+
terraform_remote_state_prefix = "projects/google-workspace-management"
8+
}

mozilla_workgroup/outputs.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
output "members" {
2+
description = "authoritative, fully-qualified list of members associated with the input workgroups"
3+
value = module.workgroup.members
4+
}
5+
6+
output "google_groups" {
7+
description = "google groups associated with the input workgroups, unqualified"
8+
value = module.workgroup.google_groups
9+
}

mozilla_workgroup/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
variable "ids" {
2+
type = set(string)
3+
description = "List of workgroup identifiers to look up access for"
4+
5+
validation {
6+
condition = alltrue([for i in var.ids : length(regexall("^workgroup:[a-zA-Z0-9-]+(/[a-zA-Z0-9\\.-]+)?$|^subgroup:[a-zA-Z0-9\\.-]+$", i)) > 0])
7+
error_message = "Bad workgroup identifier format, must match workgroup:WORKGROUP[/SUBGROUP] or subgroup:SUBGROUP."
8+
}
9+
}

mozilla_workgroup/versions.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
required_providers {
3+
google = {
4+
source = "hashicorp/google"
5+
version = ">= 3.0"
6+
}
7+
google-beta = {
8+
source = "hashicorp/google-beta"
9+
version = ">= 4.0"
10+
}
11+
}
12+
required_version = "~> 1.0"
13+
}

0 commit comments

Comments
 (0)