Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multi azure account #2

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ e.g. for Azure ContainerApp:
```hcl
module "my_azure_container_app_example_generic_integration" {
source = "port-labs/integration-factory/ocean//examples/azure_container_app_azure_integration"
version = ">=0.0.7"
version = ">=0.0.19"

integration_type = "some-integration"

Expand Down
6 changes: 3 additions & 3 deletions examples/azure_container_app_azure_integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```hcl
module "ocean_container_app_example_azure-integration" {
source = "port-labs/integration-factory/ocean//examples/azure_container_app_azure_integration"
version = ">=0.0.7"
version = ">=0.0.19"

port_client_id = "xxxxx-xxxx-xxxx-xxxx"
port_client_secret = "yyyy-yyyy-yyyy-yyyy"
Expand All @@ -15,7 +15,7 @@ module "ocean_container_app_example_azure-integration" {
```hcl
module "ocean_container_app_example_azure-integration" {
source = "port-labs/integration-factory/ocean//examples/azure_container_app_azure_integration"
version = ">=0.0.7"
version = ">=0.0.19"

port_client_id = "xxxxx-xxxx-xxxx-xxxx"
port_client_secret = "yyyy-yyyy-yyyy-yyyy"
Expand All @@ -28,7 +28,7 @@ module "ocean_container_app_example_azure-integration" {
```hcl
module "ocean_container_app_example_azure-integration" {
source = "port-labs/integration-factory/ocean//examples/azure_container_app_azure_integration"
version = ">=0.0.7"
version = ">=0.0.19"

port_client_id = "xxxxx-xxxx-xxxx-xxxx"
port_client_secret = "yyyy-yyyy-yyyy-yyyy"
Expand Down
8 changes: 3 additions & 5 deletions examples/azure_container_app_azure_integration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ locals {
chunked_resources_filter_values = chunklist(var.resources_filter_values, 25)
# creates a dictionary with the index of the chunk as key and the chunk as value
chunked_resouces_filter_dict = { for i in range(length(local.chunked_resources_filter_values)) : i => local.chunked_resources_filter_values[i] }

# check if additional_secrets contains OCEAN__INTEGRATION__CONFIG__SUBSCRIPTION_ID if not exists adds it from the current subscription
additional_secrets = contains(keys(var.additional_secrets), "OCEAN__INTEGRATION__CONFIG__SUBSCRIPTION_ID") ? var.additional_secrets : merge(var.additional_secrets,
{"OCEAN__INTEGRATION__CONFIG__SUBSCRIPTION_ID" = data.azurerm_subscription.current_subscription.subscription_id})
}


Expand All @@ -35,6 +31,7 @@ module "ocean_integration" {
}
integration_version = var.integration_version

permissions_scope = var.permissions_scope
needs_assigned_identity = var.needs_assigned_identity
resource_group_name = var.resource_group_name
subscription_id = var.hosting_subscription_id
Expand All @@ -49,11 +46,12 @@ module "ocean_integration" {
not_data_actions = []
}
additional_environment_variables = var.additional_environment_variables
additional_secrets = local.additional_secrets
additional_secrets = var.additional_secrets
}

resource "azurerm_eventgrid_system_topic" "subscription_event_grid_topic" {
# if the event grid topic name is not provided, the module will create a new one
depends_on = [module.ocean_integration]
count = var.event_grid_system_topic_name != "" ? 0 : 1
name = "subscription-event-grid-topic"
resource_group_name = module.ocean_integration.resource_group_name
Expand Down
6 changes: 6 additions & 0 deletions examples/azure_container_app_azure_integration/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,10 @@ variable "needs_assigned_identity"{
type = bool
default = true
description = "If false, no identity will be assigned to the container"
}

variable "permissions_scope" {
type = list(string)
default = null
description = "The scope assigned to the managed identity of the integration"
}
4 changes: 2 additions & 2 deletions modules/azure_container_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Terraform module which creates Ocean Integration on Azure ContainerApp.
```hcl
module "ocean-containerapp_example_basic-integration" {
source = "port-labs/integration-factory/ocean//examples/azure_container_app_generic"
version = ">=0.0.7"
version = ">=0.0.19"

integration_type = "some-integration"

Expand All @@ -23,7 +23,7 @@ module "ocean-containerapp_example_basic-integration" {
```hcl
module "ocean-container_app_example_azure-integration" {
source = "port-labs/integration-factory/ocean//examples/azure_container_app_azure_integration"
version = ">=0.0.7"
version = ">=0.0.19"

port_client_id = "xxxxx-xxxx-xxxx-xxxx"
port_client_secret = "yyyy-yyyy-yyyy-yyyy"
Expand Down
1 change: 1 addition & 0 deletions modules/azure_container_app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module "port_ocean_authorization" {
integration = var.integration
permissions = var.permissions
subscription_id = local.full_subscription_id
permissions_scope = var.permissions_scope
}

module "port_ocean_container_app" {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure_helpers/authorization/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ variable "permissions" {
variable "permissions_scope" {
type = list(string)
default = null
description = "The scope of the permissions"
description = "The scope assigned to the managed identity of the integration"
}