diff --git a/README.md b/README.md index 8618422..8feee01 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ No resources. | [blob\_storage\_override\_name](#input\_blob\_storage\_override\_name) | S3 bucket name. Only used if s3\_enable\_override is enabled | `string` | `""` | no | | [cluster\_name](#input\_cluster\_name) | Name of the cluster | `string` | n/a | yes | | [feature\_blob\_storage\_enabled](#input\_feature\_blob\_storage\_enabled) | Enable blob storage feature in the platform | `bool` | `true` | no | +| [feature\_cloud\_integration\_enabled](#input\_feature\_cloud\_integration\_enabled) | Enable cloud integration feature in the platform | `bool` | `true` | no | | [feature\_docker\_registry\_enabled](#input\_feature\_docker\_registry\_enabled) | Enable docker registry feature in the platform | `bool` | `true` | no | | [feature\_secrets\_enabled](#input\_feature\_secrets\_enabled) | Enable secrets manager feature in the platform | `bool` | `true` | no | | [project](#input\_project) | GCP Project | `string` | n/a | yes | @@ -44,10 +45,10 @@ No resources. | Name | Description | |------|-------------| -| [bucket](#output\_bucket) | n/a | -| [bucket\_name](#output\_bucket\_name) | n/a | -| [bucket\_url](#output\_bucket\_url) | n/a | -| [serviceaccount\_keys](#output\_serviceaccount\_keys) | n/a | -| [serviceaccount\_name](#output\_serviceaccount\_name) | n/a | -| [serviceaccount\_roles](#output\_serviceaccount\_roles) | n/a | +| [artifact\_registry\_url](#output\_artifact\_registry\_url) | Artifact registry URL to connect | +| [bucket\_name](#output\_bucket\_name) | Name of the bucket | +| [bucket\_url](#output\_bucket\_url) | URL of the bucket | +| [serviceaccount\_keys](#output\_serviceaccount\_keys) | Service account keys | +| [serviceaccount\_name](#output\_serviceaccount\_name) | Name of the service account | +| [serviceaccount\_roles](#output\_serviceaccount\_roles) | Roles assigned to the TrueFoundry paltform GCP service account | \ No newline at end of file diff --git a/locals.tf b/locals.tf index 14a94d1..d05b98f 100644 --- a/locals.tf +++ b/locals.tf @@ -3,6 +3,7 @@ locals { "terraform-module" = "truefoundry-google-platform-features" "terraform" = "true" "cluster-name" = var.cluster_name + "truefoundry" = "managed" }, var.tags ) @@ -13,6 +14,7 @@ locals { var.feature_docker_registry_enabled ? ["${var.project}=>roles/artifactregistry.admin"] : [], var.feature_secrets_enabled ? ["${var.project}=>roles/secretmanager.admin"] : [], var.feature_blob_storage_enabled ? ["${var.project}=>roles/iam.serviceAccountTokenCreator"] : [], - var.feature_blob_storage_enabled ? ["${var.project}=>roles/storage.admin"] : [] + var.feature_blob_storage_enabled ? ["${var.project}=>roles/storage.admin"] : [], + var.feature_cloud_integration_enabled ? ["${var.project}=>roles/container.clusterViewer", "${var.project}=>roles/container.viewer"] : [] ) } \ No newline at end of file diff --git a/output.tf b/output.tf index 2529a0c..ba5b230 100644 --- a/output.tf +++ b/output.tf @@ -1,29 +1,38 @@ ################################################################################ # Buket ################################################################################ - -output "bucket" { - value = var.feature_blob_storage_enabled ? module.blob_storage[0].bucket : null -} output "bucket_name" { - value = var.feature_blob_storage_enabled ? module.blob_storage[0].name : "" + value = var.feature_blob_storage_enabled ? module.blob_storage[0].name : "" + description = "Name of the bucket" } output "bucket_url" { - value = var.feature_blob_storage_enabled ? module.blob_storage[0].url : "" + value = var.feature_blob_storage_enabled ? module.blob_storage[0].url : "" + description = "URL of the bucket" +} + +################################################################################ +# Docker registry (artifact registry) +################################################################################ +output "artifact_registry_url" { + value = var.feature_docker_registry_enabled ? "${var.region}-docker.pkg.dev/${var.project}" : "" + description = "Artifact registry URL to connect" } + ################################################################################ # IAM serviceaccount ################################################################################ output "serviceaccount_name" { - value = module.service_accounts.service_accounts_map + value = module.service_accounts.service_accounts_map + description = "Name of the service account" } output "serviceaccount_keys" { - value = module.service_accounts.keys - sensitive = true + value = module.service_accounts.keys + sensitive = true + description = "Service account keys" } output "serviceaccount_roles" { - value = local.serviceaccount_roles - + value = local.serviceaccount_roles + description = "Roles assigned to the TrueFoundry paltform GCP service account" } \ No newline at end of file diff --git a/variables.tf b/variables.tf index 38dbfd2..a84b7e5 100644 --- a/variables.tf +++ b/variables.tf @@ -79,4 +79,13 @@ variable "feature_docker_registry_enabled" { description = "Enable docker registry feature in the platform" type = bool default = true +} + +################################################################################ +# Cloud integration +################################################################################ +variable "feature_cloud_integration_enabled" { + description = "Enable cloud integration feature in the platform" + type = bool + default = true } \ No newline at end of file