Skip to content

Commit

Permalink
Update example to v0.4.60
Browse files Browse the repository at this point in the history
  • Loading branch information
eschultink committed Sep 18, 2024
1 parent 46384f4 commit 81a581e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 32 deletions.
2 changes: 1 addition & 1 deletion google-workspace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ provider "google" {


module "worklytics_connectors_google_workspace" {
source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-google-workspace?ref=v0.4.59"
source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-google-workspace?ref=v0.4.60"

providers = {
google = google.google_workspace
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ terraform {

# general cases
module "worklytics_connectors" {
source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors?ref=v0.4.59"
source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors?ref=v0.4.60"

enabled_connectors = var.enabled_connectors
jira_cloud_id = var.jira_cloud_id
Expand Down Expand Up @@ -99,7 +99,7 @@ locals {
}

module "psoxy" {
source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-host?ref=v0.4.59"
source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-host?ref=v0.4.60"

environment_name = var.environment_name
aws_account_id = var.aws_account_id
Expand Down Expand Up @@ -156,7 +156,7 @@ locals {
module "connection_in_worklytics" {
for_each = local.all_instances

source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-psoxy-connection-aws?ref=v0.4.59"
source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-psoxy-connection-aws?ref=v0.4.60"

psoxy_instance_id = each.key
worklytics_host = var.worklytics_host
Expand Down
6 changes: 6 additions & 0 deletions msft-365-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ variable "msft_teams_example_call_record_guid" {
description = "example of MSFT Id (GUID) of a Teams Call Record for test API calls (OPTIONAL)"
default = "{EXAMPLE_MSFT_TEAMS_CALL_RECORD_GUID}"
}

variable "msft_teams_example_online_meeting_join_url" {
type = string
description = "example of an URL to join into an OnlineMeeting for test API calls (OPTIONAL)"
default = "{EXAMPLE_MSFT_TEAMS_ONLINE_MEETING_URL}"
}
57 changes: 29 additions & 28 deletions msft-365.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# BEGIN MSFT

module "worklytics_connectors_msft_365" {
source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-msft-365?ref=v0.4.59"

enabled_connectors = var.enabled_connectors
environment_id = var.environment_name
msft_tenant_id = var.msft_tenant_id
example_msft_user_guid = var.example_msft_user_guid
msft_owners_email = var.msft_owners_email
msft_teams_example_team_guid = var.msft_teams_example_team_guid
msft_teams_example_channel_guid = var.msft_teams_example_channel_guid
msft_teams_example_chat_guid = var.msft_teams_example_chat_guid
msft_teams_example_call_guid = var.msft_teams_example_call_guid
msft_teams_example_call_record_guid = var.msft_teams_example_call_record_guid
msft_connector_app_object_id = var.msft_connector_app_object_id
todos_as_local_files = var.todos_as_local_files
todo_step = 1
source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-msft-365?ref=v0.4.60"

enabled_connectors = var.enabled_connectors
environment_id = var.environment_name
msft_tenant_id = var.msft_tenant_id
example_msft_user_guid = var.example_msft_user_guid
msft_owners_email = var.msft_owners_email
msft_teams_example_team_guid = var.msft_teams_example_team_guid
msft_teams_example_channel_guid = var.msft_teams_example_channel_guid
msft_teams_example_chat_guid = var.msft_teams_example_chat_guid
msft_teams_example_call_guid = var.msft_teams_example_call_guid
msft_teams_example_call_record_guid = var.msft_teams_example_call_record_guid
msft_connector_app_object_id = var.msft_connector_app_object_id
msft_teams_example_online_meeting_join_url = var.msft_teams_example_online_meeting_join_url
todos_as_local_files = var.todos_as_local_files
todo_step = 1
}

provider "azuread" {
Expand Down Expand Up @@ -45,7 +46,7 @@ data "aws_region" "current" {
module "cognito_identity_pool" {
count = local.msft_365_enabled ? 1 : 0 # only provision identity pool if MSFT-365 connectors are enabled

source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-pool?ref=v0.4.59"
source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-pool?ref=v0.4.60"

developer_provider_name = local.developer_provider_name
name = "${local.env_qualifier}-azure-ad-federation"
Expand All @@ -57,24 +58,24 @@ locals {
# either ONE shared, or ONE per connector
shared_connector = local.provision_entraid_apps ? null : module.worklytics_connectors_msft_365.enabled_api_connectors[keys(module.worklytics_connectors_msft_365.enabled_api_connectors)[0]]
cognito_identity_login_ids = local.provision_entraid_apps ? {
for k, msft_connector in module.worklytics_connectors_msft_365.enabled_api_connectors :
k => msft_connector.connector.client_id
for k, msft_connector in module.worklytics_connectors_msft_365.enabled_api_connectors :
k => msft_connector.connector.client_id
} : {
"shared" : local.shared_connector.connector.client_id
}
"shared" : local.shared_connector.connector.client_id
}
}

module "cognito_identity" {
count = local.msft_365_enabled ? 1 : 0 # only provision identity pool if MSFT-365 connectors are enabled

source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-identity-cli?ref=v0.4.59"
source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-identity-cli?ref=v0.4.60"

aws_region = data.aws_region.current.id
aws_role = var.aws_assume_role_arn
identity_pool_id = module.cognito_identity_pool[0].pool_id
login_ids = {
for k, client_id in local.cognito_identity_login_ids :
k => "${local.developer_provider_name}=${client_id}"
k => "${local.developer_provider_name}=${client_id}"
}
}

Expand All @@ -88,22 +89,22 @@ resource "aws_iam_role_policy_attachment" "cognito_lambda_policy" {
locals {

enabled_to_entraid_object = { for k, msft_connector in module.worklytics_connectors_msft_365.enabled_api_connectors : k => {
connector_id: msft_connector.connector.id
display_name: msft_connector.display_name
connector_id : msft_connector.connector.id
display_name : msft_connector.display_name
}
}
shared_to_entraid_object = {
"shared" : {
connector_id: try(local.shared_connector.connector.id, null),
display_name: "Shared"
connector_id : try(local.shared_connector.connector.id, null),
display_name : "Shared"
}
}
}

module "msft_connection_auth_federation" {
for_each = local.provision_entraid_apps ? local.enabled_to_entraid_object : local.shared_to_entraid_object

source = "git::https://github.com/worklytics/psoxy//infra/modules/azuread-federated-credentials?ref=v0.4.59"
source = "git::https://github.com/worklytics/psoxy//infra/modules/azuread-federated-credentials?ref=v0.4.60"

application_object_id = each.value.connector_id
display_name = "${local.env_qualifier}AccessFromAWS"
Expand Down Expand Up @@ -131,4 +132,4 @@ locals {
output "msft_365_api_clients" {
description = "Map of API client identifiers. Useful for configuration of clients, terraform migration."
value = module.worklytics_connectors_msft_365.api_clients
}
}

0 comments on commit 81a581e

Please sign in to comment.