Skip to content

Commit

Permalink
Improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed Apr 2, 2021
1 parent 57f5c73 commit 93293f2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This module creates all necessary IAM groups and roles to support successful onb
module "connect_onboarding" {
source = "philips-labs/connect-onboarding/hsdp"
iam_org_id = var.iam_org_id
onboarding_iam_org_id = var.iam_org_id
provisioning_service_id = "6864c47b-xxx"
admin_users = ["bosmang"]
self_service_users = ["bosmang"]
Expand Down Expand Up @@ -45,7 +45,7 @@ No Modules.
|------|-------------|------|---------|:--------:|
| admin\_user\_ids | List of admin Connect IoT admin users IDs | `list(string)` | `[]` | no |
| admin\_users | List of admin Connect IoT admin users | `list(string)` | `[]` | no |
| iam\_org\_id | IAM organization (GUID) you want to onboard to Connect IOT | `string` | n/a | yes |
| onboarding\_iam\_org\_id | IAM organization (GUID) you want to onboard to Connect IoT | `string` | n/a | yes |
| provisioning\_service\_id | The IOT Connect provisioning service ID, provided during onboarding by HSDP | `string` | n/a | yes |
| self\_service\_users | List of users who can use the Connect IoT Self Service UI | `list(string)` | `[]` | no |

Expand Down
2 changes: 1 addition & 1 deletion data.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "hsdp_iam_org" "org" {
organization_id = var.iam_org_id
organization_id = var.onboarding_iam_org_id
}

data "hsdp_iam_user" "admin_user" {
Expand Down
16 changes: 8 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ resource "hsdp_iam_group" "connect_group" {
name = "DEVICEADMINGROUP_TF"
roles = [hsdp_iam_role.connect_role.id]
services = [var.provisioning_service_id]
managing_organization = var.iam_org_id
managing_organization = var.onboarding_iam_org_id
}

resource "hsdp_iam_group" "connect_admin_group" {
name = "CONNECT_ADMIN_GROUP_TF"
roles = [hsdp_iam_role.connect_admin.id]
users = concat([], data.hsdp_iam_user.admin_user.*.id)
managing_organization = var.iam_org_id
name = "CONNECT_ADMIN_GROUP_TF"
roles = [hsdp_iam_role.connect_admin.id]
users = concat([], data.hsdp_iam_user.admin_user.*.id)
managing_organization = var.onboarding_iam_org_id
}

resource "hsdp_iam_role" "connect_role" {
Expand All @@ -20,7 +20,7 @@ resource "hsdp_iam_role" "connect_role" {
"GROUP.READ",
"GROUP.WRITE"
]
managing_organization = var.iam_org_id
managing_organization = var.onboarding_iam_org_id
}

resource "hsdp_iam_role" "connect_readonly" {
Expand Down Expand Up @@ -64,7 +64,7 @@ resource "hsdp_iam_role" "connect_readonly" {
"MDM-DATABROKERSUBSCRIPTION.READ",
"MDM-DATATYPE.READ"
]
managing_organization = var.iam_org_id
managing_organization = var.onboarding_iam_org_id
}

resource "hsdp_iam_role" "connect_admin" {
Expand Down Expand Up @@ -178,5 +178,5 @@ resource "hsdp_iam_role" "connect_admin" {
"NS_PRODUCER.READ",
"MDM-AUTHENTICATIONMETHOD.CREATE"
]
managing_organization = var.iam_org_id
managing_organization = var.onboarding_iam_org_id
}
4 changes: 2 additions & 2 deletions self_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "hsdp_iam_group" "connect_self_service" {
name = "CONNECTSS_GROUP_TF"
roles = [hsdp_iam_role.connectss_role.id]
users = concat([], data.hsdp_iam_user.self_service_user.*.id)
managing_organization = var.iam_org_id
managing_organization = var.onboarding_iam_org_id
}

resource "hsdp_iam_role" "connectss_role" {
Expand All @@ -16,5 +16,5 @@ resource "hsdp_iam_role" "connectss_role" {
"CONNECTSS-PORTAL-BLR.ALL",
"CONNECTSS-PORTAL-DBS.ALL"
]
managing_organization = var.iam_org_id
managing_organization = var.onboarding_iam_org_id
}
8 changes: 4 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
variable "iam_org_id" {
variable "onboarding_iam_org_id" {
description = "IAM organization (GUID) you want to onboard to Connect IOT"
type = string
validation {
condition = can(regex("^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$", var.iam_org_id))
error_message = "The iam_org_id value must be a valid GUID."
condition = can(regex("^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$", var.onboarding_iam_org_id))
error_message = "The onboarding_iam_org_id value must be a valid GUID."
}
}

variable "provisioning_service_id" {
description = "The IOT Connect provisioning service ID, provided during onboarding by HSDP"
description = "The Connect IoT provisioning service ID, provided during onboarding by HSDP"
type = string
validation {
condition = can(regex("^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$", var.provisioning_service_id))
Expand Down

0 comments on commit 93293f2

Please sign in to comment.