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

Update cloud integration reference #3

Merged
merged 4 commits into from
Jul 3, 2024
Merged
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
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ No modules.
| <a name="input_blob_storage_cors_allowed_maxage"></a> [blob\_storage\_cors\_allowed\_maxage](#input\_blob\_storage\_cors\_allowed\_maxage) | List of allowed maxage for CORS of storage account | `number` | `3000` | no |
| <a name="input_blob_storage_cors_allowed_methods"></a> [blob\_storage\_cors\_allowed\_methods](#input\_blob\_storage\_cors\_allowed\_methods) | List of allowed methods for CORS of storage account | `list(string)` | <pre>[<br> "GET",<br> "POST",<br> "PUT"<br>]</pre> | no |
| <a name="input_blob_storage_cors_allowed_origins"></a> [blob\_storage\_cors\_allowed\_origins](#input\_blob\_storage\_cors\_allowed\_origins) | List of allowed origin for CORS of storage account | `list(string)` | <pre>[<br> "*"<br>]</pre> | no |
| <a name="input_cloud_integration_azuread_application_enable_override"></a> [cloud\_integration\_azuread\_application\_enable\_override](#input\_cloud\_integration\_azuread\_application\_enable\_override) | Enable overriding the name of azuread application. This will only be used if feature\_cloud\_integration\_azuread\_application\_enabled is true. You need to pass cloud\_integration\_azuread\_application\_override\_name to pass the azuread application name | `bool` | `false` | no |
| <a name="input_cloud_integration_azuread_application_override_name"></a> [cloud\_integration\_azuread\_application\_override\_name](#input\_cloud\_integration\_azuread\_application\_override\_name) | Azuread application name. Only used if cloud\_integration\_azuread\_application\_enable\_override is true | `string` | `""` | no |
| <a name="input_cloud_integration_service_principal_password_expiry_end_date"></a> [cloud\_integration\_service\_principal\_password\_expiry\_end\_date](#input\_cloud\_integration\_service\_principal\_password\_expiry\_end\_date) | End date post which service principal password would expire | `string` | `"2124-02-12T09:42:53Z"` | no |
| <a name="input_cloud_integration_service_principal_role"></a> [cloud\_integration\_service\_principal\_role](#input\_cloud\_integration\_service\_principal\_role) | Role that will be assigned to the service principal on AKS cluster | `string` | `"Reader"` | no |
| <a name="input_cloud_integration_sign_in_audience"></a> [cloud\_integration\_sign\_in\_audience](#input\_cloud\_integration\_sign\_in\_audience) | sign\_in\_audience of the cloud integration | `string` | `"AzureADMyOrg"` | no |
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | ID of the AKS cluster | `string` | n/a | yes |
| <a name="input_cluster_integration_azuread_application_enable_override"></a> [cluster\_integration\_azuread\_application\_enable\_override](#input\_cluster\_integration\_azuread\_application\_enable\_override) | Enable overriding the name of azuread application. This will only be used if feature\_cluster\_integration\_azuread\_application\_enabled is true. You need to pass cluster\_integration\_azuread\_application\_override\_name to pass the azuread application name | `bool` | `false` | no |
| <a name="input_cluster_integration_azuread_application_override_name"></a> [cluster\_integration\_azuread\_application\_override\_name](#input\_cluster\_integration\_azuread\_application\_override\_name) | Azuread application name. Only used if cluster\_integration\_azuread\_application\_enable\_override is true | `string` | `""` | no |
| <a name="input_cluster_integration_service_principal_password_expiry_end_date"></a> [cluster\_integration\_service\_principal\_password\_expiry\_end\_date](#input\_cluster\_integration\_service\_principal\_password\_expiry\_end\_date) | End date post which service principal password would expire | `string` | `"2124-02-12T09:42:53Z"` | no |
| <a name="input_cluster_integration_service_principal_role"></a> [cluster\_integration\_service\_principal\_role](#input\_cluster\_integration\_service\_principal\_role) | Role that will be assigned to the service principal on AKS cluster | `string` | `"Reader"` | no |
| <a name="input_cluster_integration_sign_in_audience"></a> [cluster\_integration\_sign\_in\_audience](#input\_cluster\_integration\_sign\_in\_audience) | sign\_in\_audience of the cluster integration | `string` | `"AzureADMyOrg"` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the AKS cluster | `string` | n/a | yes |
| <a name="input_container_registry_admin_enabled"></a> [container\_registry\_admin\_enabled](#input\_container\_registry\_admin\_enabled) | Enable admin for the docker registry | `bool` | `true` | no |
| <a name="input_container_registry_enable_override"></a> [container\_registry\_enable\_override](#input\_container\_registry\_enable\_override) | Enable overriding the name of container registry. This will only be used if feature\_container\_registry\_enabled is true. You need to pass container\_registry\_override\_name to pass the container registry name | `bool` | `false` | no |
| <a name="input_container_registry_override_name"></a> [container\_registry\_override\_name](#input\_container\_registry\_override\_name) | Container registry name. Only used if container\_registry\_enable\_override is true | `string` | `""` | no |
| <a name="input_container_registry_public_network_access_enabled"></a> [container\_registry\_public\_network\_access\_enabled](#input\_container\_registry\_public\_network\_access\_enabled) | Whether public network access is allowed for the container registry | `bool` | `true` | no |
| <a name="input_container_registry_sku"></a> [container\_registry\_sku](#input\_container\_registry\_sku) | SKU of the docker registry | `string` | `"Standard"` | no |
| <a name="input_feature_blob_storage_enabled"></a> [feature\_blob\_storage\_enabled](#input\_feature\_blob\_storage\_enabled) | Enable blob storage feature in the platform | `bool` | `true` | no |
| <a name="input_feature_cloud_integration_enabled"></a> [feature\_cloud\_integration\_enabled](#input\_feature\_cloud\_integration\_enabled) | Enable the support of cloud integration | `bool` | `true` | no |
| <a name="input_feature_cluster_integration_enabled"></a> [feature\_cluster\_integration\_enabled](#input\_feature\_cluster\_integration\_enabled) | Enable the support of cluster integration | `bool` | `true` | no |
| <a name="input_feature_container_registry_enabled"></a> [feature\_container\_registry\_enabled](#input\_feature\_container\_registry\_enabled) | Enable docker registry feature in the platform | `bool` | `true` | no |
| <a name="input_location"></a> [location](#input\_location) | Location of the storage account and container registry. This should be kept similar to resource group for ideal performance. | `string` | n/a | yes |
| <a name="input_platform_feature_enabled"></a> [platform\_feature\_enabled](#input\_platform\_feature\_enabled) | Enable platform features like container registry and storage account | `bool` | `true` | no |
Expand All @@ -77,12 +77,12 @@ No modules.
| <a name="output_truefoundry_blob_storage_account_primary_location"></a> [truefoundry\_blob\_storage\_account\_primary\_location](#output\_truefoundry\_blob\_storage\_account\_primary\_location) | Storage account primary location |
| <a name="output_truefoundry_blob_storage_account_primary_web_host"></a> [truefoundry\_blob\_storage\_account\_primary\_web\_host](#output\_truefoundry\_blob\_storage\_account\_primary\_web\_host) | Storage account primary web host url |
| <a name="output_truefoundry_blob_storage_root_url"></a> [truefoundry\_blob\_storage\_root\_url](#output\_truefoundry\_blob\_storage\_root\_url) | Storage account root URL for blob storage |
| <a name="output_truefoundry_cloud_integrations_azuread_application_client_id"></a> [truefoundry\_cloud\_integrations\_azuread\_application\_client\_id](#output\_truefoundry\_cloud\_integrations\_azuread\_application\_client\_id) | Azure AD application client ID |
| <a name="output_truefoundry_cloud_integrations_azuread_application_id"></a> [truefoundry\_cloud\_integrations\_azuread\_application\_id](#output\_truefoundry\_cloud\_integrations\_azuread\_application\_id) | Azure AD application ID |
| <a name="output_truefoundry_cloud_integrations_azuread_application_name"></a> [truefoundry\_cloud\_integrations\_azuread\_application\_name](#output\_truefoundry\_cloud\_integrations\_azuread\_application\_name) | n/a |
| <a name="output_truefoundry_cloud_integrations_service_principal_name"></a> [truefoundry\_cloud\_integrations\_service\_principal\_name](#output\_truefoundry\_cloud\_integrations\_service\_principal\_name) | n/a |
| <a name="output_truefoundry_cloud_integrations_service_principal_password"></a> [truefoundry\_cloud\_integrations\_service\_principal\_password](#output\_truefoundry\_cloud\_integrations\_service\_principal\_password) | n/a |
| <a name="output_truefoundry_cloud_integrations_service_principal_tenant_id"></a> [truefoundry\_cloud\_integrations\_service\_principal\_tenant\_id](#output\_truefoundry\_cloud\_integrations\_service\_principal\_tenant\_id) | n/a |
| <a name="output_truefoundry_cluster_integrations_azuread_application_client_id"></a> [truefoundry\_cluster\_integrations\_azuread\_application\_client\_id](#output\_truefoundry\_cluster\_integrations\_azuread\_application\_client\_id) | Azure AD application client ID |
| <a name="output_truefoundry_cluster_integrations_azuread_application_id"></a> [truefoundry\_cluster\_integrations\_azuread\_application\_id](#output\_truefoundry\_cluster\_integrations\_azuread\_application\_id) | Azure AD application ID |
| <a name="output_truefoundry_cluster_integrations_azuread_application_name"></a> [truefoundry\_cluster\_integrations\_azuread\_application\_name](#output\_truefoundry\_cluster\_integrations\_azuread\_application\_name) | n/a |
| <a name="output_truefoundry_cluster_integrations_service_principal_name"></a> [truefoundry\_cluster\_integrations\_service\_principal\_name](#output\_truefoundry\_cluster\_integrations\_service\_principal\_name) | n/a |
| <a name="output_truefoundry_cluster_integrations_service_principal_password"></a> [truefoundry\_cluster\_integrations\_service\_principal\_password](#output\_truefoundry\_cluster\_integrations\_service\_principal\_password) | n/a |
| <a name="output_truefoundry_cluster_integrations_service_principal_tenant_id"></a> [truefoundry\_cluster\_integrations\_service\_principal\_tenant\_id](#output\_truefoundry\_cluster\_integrations\_service\_principal\_tenant\_id) | n/a |
| <a name="output_truefoundry_container_registry_admin_password"></a> [truefoundry\_container\_registry\_admin\_password](#output\_truefoundry\_container\_registry\_admin\_password) | Container registry admin password |
| <a name="output_truefoundry_container_registry_admin_username"></a> [truefoundry\_container\_registry\_admin\_username](#output\_truefoundry\_container\_registry\_admin\_username) | Container registry admin username |
| <a name="output_truefoundry_container_registry_id"></a> [truefoundry\_container\_registry\_id](#output\_truefoundry\_container\_registry\_id) | Container registry ID |
Expand Down
16 changes: 8 additions & 8 deletions cloud_integration.tf → cluster_integration.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
resource "azuread_application" "truefoundry_platform_features_application" {
count = var.platform_feature_enabled ? var.feature_cloud_integration_enabled ? 1 : 0 : 0
count = var.platform_feature_enabled ? var.feature_cluster_integration_enabled ? 1 : 0 : 0
display_name = local.azuread_application
sign_in_audience = var.cloud_integration_sign_in_audience
sign_in_audience = var.cluster_integration_sign_in_audience
}

resource "azuread_service_principal" "truefoundry_platform_features_service_principal" {
count = var.platform_feature_enabled ? var.feature_cloud_integration_enabled ? 1 : 0 : 0
count = var.platform_feature_enabled ? var.feature_cluster_integration_enabled ? 1 : 0 : 0
client_id = azuread_application.truefoundry_platform_features_application[0].client_id
}

resource "azuread_service_principal_password" "truefoundry_platform_features_service_principal_password" {
count = var.platform_feature_enabled ? var.feature_cloud_integration_enabled ? 1 : 0 : 0
count = var.platform_feature_enabled ? var.feature_cluster_integration_enabled ? 1 : 0 : 0
service_principal_id = azuread_service_principal.truefoundry_platform_features_service_principal[0].object_id
display_name = local.service_principal_password
end_date = var.cloud_integration_service_principal_password_expiry_end_date
end_date = var.cluster_integration_service_principal_password_expiry_end_date
}

resource "azurerm_role_assignment" "truefoundry_reader_role_assignment" {
count = var.platform_feature_enabled ? var.feature_cloud_integration_enabled ? 1 : 0 : 0
count = var.platform_feature_enabled ? var.feature_cluster_integration_enabled ? 1 : 0 : 0
scope = var.cluster_id
role_definition_name = var.cloud_integration_service_principal_role
role_definition_name = var.cluster_integration_service_principal_role
principal_id = azuread_service_principal.truefoundry_platform_features_service_principal[0].object_id
}
}
2 changes: 1 addition & 1 deletion container.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ resource "azurerm_storage_container" "truefoundry_platform_container" {
count = var.platform_feature_enabled ? var.feature_blob_storage_enabled ? 1 : 0 : 0
name = local.container_name
storage_account_name = azurerm_storage_account.truefoundry_platform_storage_account[0].name
}
}
4 changes: 2 additions & 2 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ locals {
storage_account_name = var.blob_storage_account_enable_override ? var.blob_storage_account_override_name : "${substr(local.cluster_name, 0, 22)}sa"
container_name = var.blob_container_enable_override ? var.blob_container_override_name : "${substr(var.cluster_name, 0, 62)}cn"
container_registry_name = var.container_registry_enable_override ? var.container_registry_override_name : "${substr(local.cluster_name, 5, 47)}reg"
azuread_application = var.cloud_integration_azuread_application_enable_override ? var.cloud_integration_azuread_application_override_name : "${substr(var.cluster_name, 0, 117)}app"
azuread_application = var.cluster_integration_azuread_application_enable_override ? var.cluster_integration_azuread_application_override_name : "${substr(var.cluster_name, 0, 117)}app"
service_principal_password = "${local.cluster_name}sp"
tags = merge(
{
Expand All @@ -13,4 +13,4 @@ locals {
"truefoundry" = "managed"
},
var.tags)
}
}
28 changes: 14 additions & 14 deletions output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,33 @@ output "truefoundry_container_registry_admin_password" {
}

##################################################################################
## Cloud Integrations
## Cluster Integrations
##################################################################################

output "truefoundry_cloud_integrations_azuread_application_id" {
value = var.feature_cloud_integration_enabled ? azuread_application.truefoundry_platform_features_application[0].id : ""
output "truefoundry_cluster_integrations_azuread_application_id" {
value = var.feature_cluster_integration_enabled ? azuread_application.truefoundry_platform_features_application[0].id : ""
description = "Azure AD application ID"
}

output "truefoundry_cloud_integrations_azuread_application_client_id" {
value = var.feature_cloud_integration_enabled ? azuread_application.truefoundry_platform_features_application[0].client_id : ""
output "truefoundry_cluster_integrations_azuread_application_client_id" {
value = var.feature_cluster_integration_enabled ? azuread_application.truefoundry_platform_features_application[0].client_id : ""
description = "Azure AD application client ID"
}

output "truefoundry_cloud_integrations_service_principal_name" {
value = var.feature_cloud_integration_enabled ? azuread_service_principal_password.truefoundry_platform_features_service_principal_password[0].value : ""
output "truefoundry_cluster_integrations_service_principal_name" {
value = var.feature_cluster_integration_enabled ? azuread_service_principal_password.truefoundry_platform_features_service_principal_password[0].value : ""
sensitive = true
}

output "truefoundry_cloud_integrations_service_principal_tenant_id" {
value = var.feature_cloud_integration_enabled ? azuread_service_principal.truefoundry_platform_features_service_principal[0].application_tenant_id : ""
output "truefoundry_cluster_integrations_service_principal_tenant_id" {
value = var.feature_cluster_integration_enabled ? azuread_service_principal.truefoundry_platform_features_service_principal[0].application_tenant_id : ""
}

output "truefoundry_cloud_integrations_service_principal_password" {
value = var.feature_cloud_integration_enabled ? azuread_service_principal_password.truefoundry_platform_features_service_principal_password[0].value : ""
output "truefoundry_cluster_integrations_service_principal_password" {
value = var.feature_cluster_integration_enabled ? azuread_service_principal_password.truefoundry_platform_features_service_principal_password[0].value : ""
sensitive = true
}

output "truefoundry_cloud_integrations_azuread_application_name" {
value = var.feature_cloud_integration_enabled ? local.cluster_name : ""
}
output "truefoundry_cluster_integrations_azuread_application_name" {
value = var.feature_cluster_integration_enabled ? local.cluster_name : ""
}
1 change: 0 additions & 1 deletion registry.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ resource "azurerm_container_registry" "truefoundry_container_registry" {
public_network_access_enabled = var.container_registry_public_network_access_enabled
tags = local.tags
}

Loading
Loading